This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_hooks/flutter_hooks.dart'; | |
import 'package:infinite_scroll_sliver_list/get_flowers_use_case.dart'; | |
class InfiniteScrollPage extends HookWidget { | |
const InfiniteScrollPage({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
final getFlowersUseCase = GetFlowersUseCase(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_hooks/flutter_hooks.dart'; | |
import 'package:infinite_scroll_sliver_list/get_flowers_use_case.dart'; | |
class InfiniteScrollPage extends HookWidget { | |
const InfiniteScrollPage({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
final getFlowersUseCase = GetFlowersUseCase(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math'; | |
const List<String> _flowers = [ | |
// 1st page | |
'Rose', | |
'Hydrangea', | |
'Sunflower', | |
'Daisy', | |
'Orchid', | |
'Lily', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: infinite_scroll_sliver_list | |
description: Example Flutter project with infinite scrolling SliverList. | |
publish_to: 'none' | |
version: 1.0.0+1 | |
environment: | |
sdk: '>=3.1.0 <4.0.0' | |
dependencies: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Environments config with GetIt | |
final getIt = GetIt.instance; | |
const dev = Environment(AppEnv.devName); | |
const prod = Environment(AppEnv.prodName); | |
@InjectableInit(preferRelativeImports: false) | |
void configureDependencies(String appEnv) => $initGetIt(getIt, environment: appEnv); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// FLAG_DISMISS_KEYGUARD | |
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N_MR1) { | |
val keyguardManager = getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager | |
keyguardManager.requestDismissKeyguard(this, null) | |
} else { | |
window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD) | |
} | |
/// FLAG_SHOW_WHEN_LOCKED | |
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Dao | |
interface MovieDao { | |
@Query("SELECT * FROM movie WHERE title = :title LIMIT 1") | |
suspend fun findMovieByTitle(title: String?): Movie? | |
@Insert(onConflict = OnConflictStrategy.IGNORE) | |
suspend fun insert(vararg directors: Movie) | |
@Update(onConflict = OnConflictStrategy.IGNORE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onCreateOptionsMenu(menu: Menu?): Boolean { | |
menuInflater.inflate(R.menu.overflow, menu) | |
return true | |
} | |
override fun onOptionsItemSelected(item: MenuItem): Boolean { | |
return when (item.itemId) { | |
R.id.action_delete_list_data -> { | |
deleteCurrentListData() | |
true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
def lifecycle_version = "2.2.0" | |
def room_version = "2.2.5" | |
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" | |
implementation 'androidx.appcompat:appcompat:1.3.0-alpha01' | |
implementation 'com.google.android.material:material:1.1.0' | |
implementation 'androidx.constraintlayout:constraintlayout:1.1.3' | |
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<paths> | |
<files-path name="movies_csv_files" path="."/> | |
</paths> |
NewerOlder