This file contains 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
/// Read details on https://theprogrammingway.com/flutter-file-upload-using-webview-on-android/ | |
import 'dart:io'; | |
import 'package:file_picker/file_picker.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:webview_flutter/webview_flutter.dart'; | |
import 'package:webview_flutter_android/webview_flutter_android.dart'; | |
void main() { | |
runApp(const MyApp()); |
This file contains 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
analyzer: | |
errors: | |
# treat missing required parameters as a warning (not a hint) | |
missing_required_param: warning | |
# treat missing returns as a warning (not a hint) | |
missing_return: warning | |
linter: | |
rules: | |
- always_declare_return_types |
This file contains 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
final _webViewPlugin = FlutterWebviewPlugin(); | |
@override | |
Widget build(BuildContext context) { | |
return WillPopScope( | |
child: WebviewScaffold( | |
url: "https://www.google.com", | |
withZoom: false, | |
withLocalStorage: true, | |
withJavascript: true, |
This file contains 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 | |
Widget build(BuildContext context) { | |
return ListView.separated( | |
padding: EdgeInsets.only(top: 8), | |
separatorBuilder: (context, index) => Icon(Icons.add), | |
itemBuilder: (BuildContext context, int index) { | |
return ListTile( | |
title: Text(list[index].title), | |
leading: Image.network(list[index].image_url), | |
subtitle: Text(list[index].subtitle), |
This file contains 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 | |
Widget build(BuildContext context) { | |
return ListView.separated( | |
padding: EdgeInsets.only(top: 8), | |
separatorBuilder: (context, index) => Divider( | |
height: 2, | |
color: Colors.red, | |
), | |
itemBuilder: (BuildContext context, int index) { | |
return ListTile( |
This file contains 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 | |
Widget build(BuildContext context) { | |
return ListView.builder( | |
itemBuilder: (context, index) { | |
return ListTile( | |
title: Text(list[index].title), | |
leading: Image.network(list[index].image_url), | |
subtitle: Text(list[index].subtitle), | |
); | |
}, |
This file contains 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
package com.itcse.beerrecepies; | |
import org.junit.rules.TestRule; | |
import org.junit.runner.Description; | |
import org.junit.runners.model.Statement; | |
import java.util.concurrent.Callable; | |
import io.reactivex.Scheduler; | |
import io.reactivex.android.plugins.RxAndroidPlugins; |
This file contains 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
@Module(includes = { | |
AndroidInjectionModule.class, RepositoryModule.class, | |
MySharedPreferencesModule.class | |
ViewModelModule.class, LocalRepositoryModule.class, MQTTModule.class | |
}) | |
abstract class AppModule { | |
/* | |
* Singleton annotation isn't necessary since Application instance is unique but is here for | |
* convention. In general, providing Activity, Fragment, BroadcastReceiver, etc does not require | |
* them to be scoped since they are the components being injected and their instance is unique. |
This file contains 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
@Module | |
public abstract class ViewModelModule { | |
@Binds | |
@IntoMap | |
@ViewModelKey(SplashScreenViewModel.class) | |
abstract ViewModel bindSplashScreenViewModel(final SplashScreenViewModel splashScreenViewModel); | |
@Binds | |
@IntoMap | |
@ViewModelKey(LoginActivityViewModel.class) |
This file contains 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
@Singleton | |
public class CustomViewModelFactory implements ViewModelProvider.Factory { | |
private final Map<Class<? extends ViewModel>, Provider<ViewModel>> creators; | |
@Inject | |
CustomViewModelFactory(Map<Class<? extends ViewModel>, Provider<ViewModel>> creators) { | |
this.creators = creators; | |
} | |
@NonNull |