| { | |||||
| // Use IntelliSense to learn about possible attributes. | |||||
| // Hover to view descriptions of existing attributes. | |||||
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |||||
| "version": "0.2.0", | |||||
| "configurations": [ | |||||
| { | |||||
| "name": "mobile-app", | |||||
| "request": "launch", | |||||
| "type": "dart", | |||||
| "args": [ | |||||
| "--no-sound-null-safety" | |||||
| ] | |||||
| }, | |||||
| { | |||||
| "name": "mobile-app (profile mode)", | |||||
| "request": "launch", | |||||
| "type": "dart", | |||||
| "flutterMode": "profile" | |||||
| }, | |||||
| { | |||||
| "name": "mobile-app (release mode)", | |||||
| "request": "launch", | |||||
| "type": "dart", | |||||
| "flutterMode": "release" | |||||
| } | |||||
| ] | |||||
| } |
| dependencies { | dependencies { | ||||
| implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||||
| implementation 'com.google.firebase:firebase-messaging:20.1.0' | |||||
| // implementation 'com.google.firebase:firebase-messaging:20.1.0' | |||||
| } | } | ||||
| apply plugin: 'com.google.gms.google-services' | apply plugin: 'com.google.gms.google-services' |
| <uses-permission android:name="android.permission.INTERNET"/> | <uses-permission android:name="android.permission.INTERNET"/> | ||||
| <uses-permission android:name="android.permission.CAMERA" /> | <uses-permission android:name="android.permission.CAMERA" /> | ||||
| <application | <application | ||||
| android:name=".Application" | |||||
| android:label="Tiên Phong Farm" | android:label="Tiên Phong Farm" | ||||
| android:icon="@mipmap/ic_launcher" | android:icon="@mipmap/ic_launcher" | ||||
| android:requestLegacyExternalStorage="true"> | android:requestLegacyExternalStorage="true"> | ||||
| android:label="" /> | android:label="" /> | ||||
| <activity | <activity | ||||
| android:name=".MainActivity" | android:name=".MainActivity" | ||||
| android:exported="true" | |||||
| android:label="Tiên Phong Farm" | android:label="Tiên Phong Farm" | ||||
| android:launchMode="singleTop" | android:launchMode="singleTop" | ||||
| android:theme="@style/LaunchTheme" | android:theme="@style/LaunchTheme" |
| package vn.azteam.tpfarm | |||||
| import io.flutter.app.FlutterApplication | |||||
| import io.flutter.plugin.common.PluginRegistry | |||||
| import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback | |||||
| import io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin | |||||
| import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService | |||||
| class Application : FlutterApplication(), PluginRegistrantCallback { | |||||
| override fun onCreate() { | |||||
| super.onCreate() | |||||
| FlutterFirebaseMessagingService.setPluginRegistrant(this) | |||||
| } | |||||
| override fun registerWith(registry: PluginRegistry?) { | |||||
| FirebaseMessagingPlugin.registerWith(registry?.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin")) | |||||
| } | |||||
| } |
| package vn.azteam.tpfarm | |||||
| import io.flutter.plugin.common.PluginRegistry | |||||
| import io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin | |||||
| object FirebaseCloudMessagingPluginRegistrant { | |||||
| fun registerWith(registry: PluginRegistry) { | |||||
| if (alreadyRegisteredWith(registry)) { | |||||
| return | |||||
| } | |||||
| FirebaseMessagingPlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin")) | |||||
| } | |||||
| private fun alreadyRegisteredWith(registry: PluginRegistry): Boolean { | |||||
| val key = FirebaseCloudMessagingPluginRegistrant::class.java!!.getCanonicalName() | |||||
| if (registry.hasPlugin(key)) { | |||||
| return true | |||||
| } | |||||
| registry.registrarFor(key) | |||||
| return false | |||||
| } | |||||
| } |
| package vn.azteam.tpfarm | package vn.azteam.tpfarm | ||||
| import android.os.Build | |||||
| import android.os.Bundle | |||||
| import androidx.core.view.WindowCompat | |||||
| import io.flutter.embedding.android.FlutterActivity | import io.flutter.embedding.android.FlutterActivity | ||||
| import io.flutter.embedding.android.FlutterFragmentActivity; | |||||
| class MainActivity: FlutterActivity() { | |||||
| } | |||||
| class MainActivity: FlutterFragmentActivity () { | |||||
| override fun onCreate(savedInstanceState: Bundle?) { | |||||
| WindowCompat.setDecorFitsSystemWindows(getWindow(), false) | |||||
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { | |||||
| splashScreen.setOnExitAnimationListener { splashScreenView -> splashScreenView.remove() } | |||||
| } | |||||
| super.onCreate(savedInstanceState) | |||||
| } | |||||
| } |
| <item android:drawable="@android:color/white" /> | <item android:drawable="@android:color/white" /> | ||||
| <!-- You can insert your own image assets here --> | <!-- You can insert your own image assets here --> | ||||
| <item> | |||||
| <!-- <item> | |||||
| <bitmap | <bitmap | ||||
| android:gravity="center" | android:gravity="center" | ||||
| android:src="@mipmap/splash_tpf" /> | android:src="@mipmap/splash_tpf" /> | ||||
| </item> | |||||
| </item> --> | |||||
| </layer-list> | </layer-list> |
| buildscript { | buildscript { | ||||
| ext.kotlin_version = '1.3.61' | |||||
| ext.kotlin_version = "1.7.10" | |||||
| repositories { | repositories { | ||||
| google() | google() | ||||
| jcenter() | jcenter() | ||||
| } | } | ||||
| dependencies { | dependencies { | ||||
| classpath 'com.android.tools.build:gradle:3.5.0' | |||||
| classpath 'com.google.gms:google-services:4.3.3' | |||||
| classpath 'com.android.tools.build:gradle:7.0.0' | |||||
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||||
| classpath 'com.google.gms:google-services:4.3.8' | |||||
| } | } | ||||
| } | } | ||||
| distributionPath=wrapper/dists | distributionPath=wrapper/dists | ||||
| zipStoreBase=GRADLE_USER_HOME | zipStoreBase=GRADLE_USER_HOME | ||||
| zipStorePath=wrapper/dists | zipStorePath=wrapper/dists | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip | |||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip |
| 97C146E61CF9000F007C117D /* Project object */ = { | 97C146E61CF9000F007C117D /* Project object */ = { | ||||
| isa = PBXProject; | isa = PBXProject; | ||||
| attributes = { | attributes = { | ||||
| LastUpgradeCheck = 1020; | |||||
| LastUpgradeCheck = 1300; | |||||
| ORGANIZATIONNAME = ""; | ORGANIZATIONNAME = ""; | ||||
| TargetAttributes = { | TargetAttributes = { | ||||
| 97C146ED1CF9000F007C117D = { | 97C146ED1CF9000F007C117D = { |
| <Workspace | <Workspace | ||||
| version = "1.0"> | version = "1.0"> | ||||
| <FileRef | <FileRef | ||||
| location = "group:Runner.xcodeproj"> | |||||
| location = "self:"> | |||||
| </FileRef> | </FileRef> | ||||
| </Workspace> | </Workspace> |
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||
| <Scheme | <Scheme | ||||
| LastUpgradeVersion = "1020" | |||||
| LastUpgradeVersion = "1300" | |||||
| version = "1.3"> | version = "1.3"> | ||||
| <BuildAction | <BuildAction | ||||
| parallelizeBuildables = "YES" | parallelizeBuildables = "YES" |
| </array> | </array> | ||||
| <key>UIViewControllerBasedStatusBarAppearance</key> | <key>UIViewControllerBasedStatusBarAppearance</key> | ||||
| <false/> | <false/> | ||||
| <key>CADisableMinimumFrameDurationOnPhone</key> | |||||
| <true/> | |||||
| </dict> | </dict> | ||||
| </plist> | </plist> |
| import 'package:farm_tpf/presentation/screens/login/view/login_page.dart'; | import 'package:farm_tpf/presentation/screens/login/view/login_page.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/splash/view/splash_page.dart'; | import 'package:farm_tpf/presentation/screens/splash/view/splash_page.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/tabbar/tabbar.dart'; | import 'package:farm_tpf/presentation/screens/tabbar/tabbar.dart'; | ||||
| import 'package:farm_tpf/routes/route_name.dart'; | |||||
| import 'package:farm_tpf/routes/routes.dart'; | |||||
| import 'package:farm_tpf/utils/const_color.dart'; | import 'package:farm_tpf/utils/const_color.dart'; | ||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
| import 'package:flutter_bloc/flutter_bloc.dart'; | import 'package:flutter_bloc/flutter_bloc.dart'; | ||||
| import 'authentication/bloc/authentication_bloc.dart'; | import 'authentication/bloc/authentication_bloc.dart'; | ||||
| import 'data/repository/authentication_repository.dart'; | import 'data/repository/authentication_repository.dart'; | ||||
| import 'main.dart'; | |||||
| class App extends StatelessWidget { | class App extends StatelessWidget { | ||||
| const App({ | const App({ | ||||
| Key? key, | Key? key, | ||||
| required this.authenticationRepository, | required this.authenticationRepository, | ||||
| }) : assert(authenticationRepository != null), | |||||
| super(key: key); | |||||
| }) : super(key: key); | |||||
| final AuthenticationRepository authenticationRepository; | final AuthenticationRepository authenticationRepository; | ||||
| } | } | ||||
| class _AppViewState extends State<AppView> { | class _AppViewState extends State<AppView> { | ||||
| final _navigatorKey = GlobalKey<NavigatorState>(); | |||||
| NavigatorState? get _navigator => globalNavigator.currentState; | |||||
| NavigatorState get _navigator => _navigatorKey.currentState!; | |||||
| // NavigatorState get _navigator => _navigatorKey.currentState!; | |||||
| @override | @override | ||||
| Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
| return GetMaterialApp( | return GetMaterialApp( | ||||
| debugShowCheckedModeBanner: false, | debugShowCheckedModeBanner: false, | ||||
| initialRoute: RouteName.home, | |||||
| navigatorKey: globalNavigator, | |||||
| theme: ThemeData( | theme: ThemeData( | ||||
| backgroundColor: Colors.white, | backgroundColor: Colors.white, | ||||
| brightness: Brightness.light, | brightness: Brightness.light, | ||||
| Theme.of(context).textTheme, | Theme.of(context).textTheme, | ||||
| ), | ), | ||||
| ), | ), | ||||
| navigatorKey: _navigatorKey, | |||||
| // navigatorKey: _navigatorKey, | |||||
| builder: (context, child) { | builder: (context, child) { | ||||
| // return TabbarScreen(); | |||||
| // return LoginPage(); | |||||
| return BlocListener<AuthenticationBloc, AuthenticationState>( | return BlocListener<AuthenticationBloc, AuthenticationState>( | ||||
| listener: (context, state) { | listener: (context, state) { | ||||
| switch (state.status) { | switch (state.status) { | ||||
| case AuthenticationStatus.authenticated: | case AuthenticationStatus.authenticated: | ||||
| _navigator.pushAndRemoveUntil<void>( | |||||
| _navigator!.pushAndRemoveUntil<void>( | |||||
| TabbarScreen.route(), | TabbarScreen.route(), | ||||
| (route) => false, | (route) => false, | ||||
| ); | ); | ||||
| break; | break; | ||||
| // _navigator.pushAndRemoveUntil<void>( | |||||
| // TabbarScreen.route(), | |||||
| // (route) => false, | |||||
| // ); | |||||
| break; | |||||
| case AuthenticationStatus.unauthenticated: | case AuthenticationStatus.unauthenticated: | ||||
| _navigator.pushAndRemoveUntil<void>( | |||||
| _navigator!.pushAndRemoveUntil<void>( | |||||
| LoginPage.route(), | LoginPage.route(), | ||||
| (route) => false, | (route) => false, | ||||
| ); | ); | ||||
| // _navigator.pushAndRemoveUntil<void>( | |||||
| // LoginPage.route(), | |||||
| // (route) => false, | |||||
| // ); | |||||
| break; | break; | ||||
| default: | default: | ||||
| _navigator!.pushAndRemoveUntil<void>( | |||||
| LoginPage.route(), | |||||
| (route) => false, | |||||
| ); | |||||
| break; | break; | ||||
| } | } | ||||
| }, | }, | ||||
| child: child, | child: child, | ||||
| ); | ); | ||||
| }, | }, | ||||
| onGenerateRoute: (_) => SplashPage.route(), | |||||
| onGenerateRoute: Routes.buildRoutes, | |||||
| ); | ); | ||||
| } | } | ||||
| } | } |
| User({this.idToken}); | User({this.idToken}); | ||||
| User.fromJson(Map<String, dynamic> json) { | User.fromJson(Map<String, dynamic> json) { | ||||
| idToken = json['idToken']; | |||||
| idToken = json['id_token']; | |||||
| } | } | ||||
| Map<String, dynamic> toJson() { | Map<String, dynamic> toJson() { | ||||
| final Map<String, dynamic> data = new Map<String, dynamic>(); | final Map<String, dynamic> data = new Map<String, dynamic>(); | ||||
| data['idToken'] = this.idToken; | |||||
| data['id_token'] = this.idToken; | |||||
| return data; | return data; | ||||
| } | } | ||||
| } | } |
| // dio.interceptors.add(AuthInterceptor()); | // dio.interceptors.add(AuthInterceptor()); | ||||
| dio.interceptors.add(HttpLogInterceptor()); | dio.interceptors.add(HttpLogInterceptor()); | ||||
| dio.interceptors.add( | |||||
| DioCacheManager(CacheConfig(baseUrl: ConstCommon.baseUrl)).interceptor); | |||||
| dio.interceptors.add(DioCacheManager(CacheConfig(baseUrl: ConstCommon.baseUrl)).interceptor); | |||||
| return dio; | return dio; | ||||
| } | } | ||||
| @override | @override | ||||
| Future onRequest(RequestOptions options) async { | Future onRequest(RequestOptions options) async { | ||||
| var token = await pref.getString(DATA_CONST.TOKEN_KEY); | var token = await pref.getString(DATA_CONST.TOKEN_KEY); | ||||
| options.headers["Authorization"] = "Bearer $token"; | |||||
| // options.headers["Authorization"] = "Bearer $token"; | |||||
| options.headers["Authorization"] = | |||||
| "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJsZWNhb2FuaHF1b2MiLCJhdXRoIjoiUk9MRV9VU0VSIiwiZXhwIjoxNjc4ODk1MTIyfQ.jj3RbPZ4Q1yL9ImFGEPsJyy9SCVe7SKDw5vzHu6no2eUpWg78KVzEypY8W51VzrRa9gV04Yhp_l3YvEe8lsttQ"; | |||||
| options.receiveTimeout = 20000; | options.receiveTimeout = 20000; | ||||
| // log("onRequest: ${options.uri}\n" | |||||
| // "data=${options.data}\n" | |||||
| // "method=${options.method}\n" | |||||
| // "headers=${options.headers}\n" | |||||
| // "queryParameters=${options.queryParameters}"); | |||||
| log("onRequest: ${options.uri}\n" | |||||
| "data=${options.data}\n" | |||||
| "method=${options.method}\n" | |||||
| "headers=${options.headers}\n" | |||||
| "queryParameters=${options.queryParameters}"); | |||||
| return options; | return options; | ||||
| } | } | ||||
| @override | @override | ||||
| Future onResponse(Response response) { | Future onResponse(Response response) { | ||||
| // log("onResponse: $response"); | |||||
| log("onResponse: $response"); | |||||
| return super.onResponse(response); | return super.onResponse(response); | ||||
| } | } | ||||
| @override | @override | ||||
| Future onError(DioError err) { | Future onError(DioError err) { | ||||
| // log("onError: $err\n" | |||||
| // "Response: ${err.response}"); | |||||
| log("onError: $err\n" | |||||
| "Response: ${err.response}"); | |||||
| return super.onError(err); | return super.onError(err); | ||||
| } | } | ||||
| } | } |
| class _RestClient implements RestClient { | class _RestClient implements RestClient { | ||||
| _RestClient(this._dio, {this.baseUrl}) { | _RestClient(this._dio, {this.baseUrl}) { | ||||
| ArgumentError.checkNotNull(_dio, '_dio'); | ArgumentError.checkNotNull(_dio, '_dio'); | ||||
| baseUrl ??= 'https://smf.presshome.vn/'; | |||||
| baseUrl ??= 'https://tpf.aztrace.vn/'; | |||||
| } | } | ||||
| final Dio _dio; | final Dio _dio; |
| yield* _controller.stream; | yield* _controller.stream; | ||||
| } | } | ||||
| Future<User> signInWithCredentials(String username, String password) { | |||||
| Future<User> signInWithCredentials(String username, String password) async { | |||||
| final client = RestClient(dio); | final client = RestClient(dio); | ||||
| var result = client.login(UserRequest(username: username, password: password)); | |||||
| return result; | |||||
| try { | |||||
| var url = 'https://tpf.aztrace.vn/api/authenticate'; | |||||
| var res = await dio.post(url, data: UserRequest(username: username, password: password)); | |||||
| var user = User.fromJson(res.data); | |||||
| return user; | |||||
| // return ResponseUser.fromJson(res.data); | |||||
| } catch (e) { | |||||
| rethrow; | |||||
| } | |||||
| // var result = client.login(UserRequest(username: username, password: password)); | |||||
| // return result; | |||||
| } | } | ||||
| void logOut() { | void logOut() { |
| import 'package:barcode_scan/barcode_scan.dart'; | |||||
| // import 'package:barcode_scan/barcode_scan.dart'; | |||||
| import 'package:camera/camera.dart'; | import 'package:camera/camera.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/plot_detail/sc_plot_detail.dart'; | import 'package:farm_tpf/presentation/screens/plot_detail/sc_plot_detail.dart'; | ||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
| import 'data/repository/repository.dart'; | import 'data/repository/repository.dart'; | ||||
| import 'presentation/custom_widgets/widget_utils.dart'; | import 'presentation/custom_widgets/widget_utils.dart'; | ||||
| List<CameraDescription> cameras = []; | |||||
| final GlobalKey<NavigatorState> globalNavigator = GlobalKey<NavigatorState>(); | |||||
| // List<CameraDescription> cameras = []; | |||||
| Future<void> main() async { | Future<void> main() async { | ||||
| // Fetch the available cameras before initializing the app. | // Fetch the available cameras before initializing the app. | ||||
| try { | |||||
| WidgetsFlutterBinding.ensureInitialized(); | |||||
| cameras = await availableCameras(); | |||||
| } on CameraException catch (e) { | |||||
| print(e.description); | |||||
| } | |||||
| // try { | |||||
| // WidgetsFlutterBinding.ensureInitialized(); | |||||
| // // cameras = await availableCameras(); | |||||
| // } on CameraException catch (e) { | |||||
| // print(e.description); | |||||
| // } | |||||
| WidgetsFlutterBinding.ensureInitialized(); | |||||
| runApp(App(authenticationRepository: AuthenticationRepository())); | runApp(App(authenticationRepository: AuthenticationRepository())); | ||||
| // runApp(MaterialApp( | |||||
| // home: Scaffold( | |||||
| // appBar: AppBar(), | |||||
| // body: Container( | |||||
| // color: Colors.red, | |||||
| // // width: 100, | |||||
| // // height: 100, | |||||
| // ), | |||||
| // ), | |||||
| // )); | |||||
| } | } | ||||
| void myBackgroundMessageHandler(Map<String, dynamic> message) { | void myBackgroundMessageHandler(Map<String, dynamic> message) { | ||||
| } | } | ||||
| Future scan(BuildContext context) async { | Future scan(BuildContext context) async { | ||||
| var _aspectTolerance = 0.00; | |||||
| var _selectedCamera = -1; | |||||
| var _useAutoFocus = true; | |||||
| var _autoEnableFlash = false; | |||||
| var repository = Repository(); | |||||
| try { | |||||
| var options = ScanOptions( | |||||
| strings: { | |||||
| "cancel": "Huỷ", | |||||
| "flash_on": "Bật flash", | |||||
| "flash_off": "Tắt flash", | |||||
| }, | |||||
| useCamera: _selectedCamera, | |||||
| autoEnableFlash: _autoEnableFlash, | |||||
| android: AndroidOptions( | |||||
| aspectTolerance: _aspectTolerance, | |||||
| useAutoFocus: _useAutoFocus, | |||||
| ), | |||||
| ); | |||||
| var result = await BarcodeScanner.scan(options: options); | |||||
| print(result.toString()); | |||||
| if (result.type == ResultType.Cancelled) { | |||||
| print("canncel"); | |||||
| } else if (result.type == ResultType.Error) { | |||||
| print("error"); | |||||
| } else { | |||||
| print("show check crop"); | |||||
| _showAlertCheckCropCode(context, result.rawContent, repository); | |||||
| } | |||||
| } on PlatformException catch (e) { | |||||
| print("error: ${e.message}"); | |||||
| } | |||||
| print('scan QR'); | |||||
| // var _aspectTolerance = 0.00; | |||||
| // var _selectedCamera = -1; | |||||
| // var _useAutoFocus = true; | |||||
| // var _autoEnableFlash = false; | |||||
| // var repository = Repository(); | |||||
| // try { | |||||
| // var options = ScanOptions( | |||||
| // strings: { | |||||
| // "cancel": "Huỷ", | |||||
| // "flash_on": "Bật flash", | |||||
| // "flash_off": "Tắt flash", | |||||
| // }, | |||||
| // useCamera: _selectedCamera, | |||||
| // autoEnableFlash: _autoEnableFlash, | |||||
| // android: AndroidOptions( | |||||
| // aspectTolerance: _aspectTolerance, | |||||
| // useAutoFocus: _useAutoFocus, | |||||
| // ), | |||||
| // ); | |||||
| // var result = await BarcodeScanner.scan(options: options); | |||||
| // print(result.toString()); | |||||
| // if (result.type == ResultType.Cancelled) { | |||||
| // print("canncel"); | |||||
| // } else if (result.type == ResultType.Error) { | |||||
| // print("error"); | |||||
| // } else { | |||||
| // print("show check crop"); | |||||
| // _showAlertCheckCropCode(context, result.rawContent, repository); | |||||
| // } | |||||
| // } on PlatformException catch (e) { | |||||
| // print("error: ${e.message}"); | |||||
| // } | |||||
| } | } | ||||
| _showAlertCheckCropCode(BuildContext context, String cropCode, Repository repository) async { | |||||
| Get.defaultDialog(title: "Kiểm tra thông tin lô ....", middleText: "", content: const CircularProgressIndicator()); | |||||
| try { | |||||
| await repository.getPlotDetailByCode(cropCode, page: 1, size: 1).then((value) { | |||||
| print("ok"); | |||||
| if (Get.isDialogOpen) Get.back(); | |||||
| Get.to(PlotDetailScreen(cropId: value.tbCropDTO?.id ?? -1, cropType: value.tbCropDTO?.type ?? -1, initialIndex: 0)); | |||||
| }).catchError((onError) { | |||||
| Utils.showDialog( | |||||
| title: "Không tìm thấy lô", | |||||
| message: "Thử lại với mã tem khác?", | |||||
| textConfirm: "Thử lại", | |||||
| textCancel: "Huỷ", | |||||
| onConfirm: () { | |||||
| Get.back(); | |||||
| scan(context); | |||||
| }); | |||||
| }); | |||||
| } catch (e) { | |||||
| Utils.showDialog( | |||||
| title: "Không tìm thấy lô", | |||||
| message: "Thử lại với mã tem khác?", | |||||
| textConfirm: "Thử lại", | |||||
| textCancel: "Huỷ", | |||||
| onConfirm: () { | |||||
| Get.back(); | |||||
| scan(context); | |||||
| }); | |||||
| } | |||||
| } | |||||
| // _showAlertCheckCropCode(BuildContext context, String cropCode, Repository repository) async { | |||||
| // Get.defaultDialog(title: "Kiểm tra thông tin lô ....", middleText: "", content: const CircularProgressIndicator()); | |||||
| // try { | |||||
| // await repository.getPlotDetailByCode(cropCode, page: 1, size: 1).then((value) { | |||||
| // print("ok"); | |||||
| // if (Get.isDialogOpen) Get.back(); | |||||
| // Get.to(PlotDetailScreen(cropId: value.tbCropDTO?.id ?? -1, cropType: value.tbCropDTO?.type ?? -1, initialIndex: 0)); | |||||
| // }).catchError((onError) { | |||||
| // Utils.showDialog( | |||||
| // title: "Không tìm thấy lô", | |||||
| // message: "Thử lại với mã tem khác?", | |||||
| // textConfirm: "Thử lại", | |||||
| // textCancel: "Huỷ", | |||||
| // onConfirm: () { | |||||
| // Get.back(); | |||||
| // scan(context); | |||||
| // }); | |||||
| // }); | |||||
| // } catch (e) { | |||||
| // Utils.showDialog( | |||||
| // title: "Không tìm thấy lô", | |||||
| // message: "Thử lại với mã tem khác?", | |||||
| // textConfirm: "Thử lại", | |||||
| // textCancel: "Huỷ", | |||||
| // onConfirm: () { | |||||
| // Get.back(); | |||||
| // scan(context); | |||||
| // }); | |||||
| // } | |||||
| // } |
| import 'package:camera/camera.dart'; | import 'package:camera/camera.dart'; | ||||
| import 'package:farm_tpf/main.dart'; | import 'package:farm_tpf/main.dart'; | ||||
| import 'package:farm_tpf/presentation/custom_widgets/widget_utils.dart'; | import 'package:farm_tpf/presentation/custom_widgets/widget_utils.dart'; | ||||
| import 'package:file_picker/file_picker.dart'; | |||||
| // import 'package:file_picker/file_picker.dart'; | |||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
| import 'package:get/get.dart'; | import 'package:get/get.dart'; | ||||
| import 'package:video_player/video_player.dart'; | import 'package:video_player/video_player.dart'; | ||||
| VoidCallback? videoPlayerListener; | VoidCallback? videoPlayerListener; | ||||
| bool enableAudio = true; | bool enableAudio = true; | ||||
| int indexCamera = 0; | int indexCamera = 0; | ||||
| List<CameraDescription> cameras = []; | |||||
| @override | @override | ||||
| void initState() { | void initState() { |
| import 'package:farm_tpf/utils/const_assets.dart'; | import 'package:farm_tpf/utils/const_assets.dart'; | ||||
| import 'package:farm_tpf/utils/const_common.dart'; | import 'package:farm_tpf/utils/const_common.dart'; | ||||
| import 'package:farm_tpf/utils/const_string.dart'; | import 'package:farm_tpf/utils/const_string.dart'; | ||||
| import 'package:file_picker/file_picker.dart'; | |||||
| // import 'package:file_picker/file_picker.dart'; | |||||
| import 'package:flutter/cupertino.dart'; | import 'package:flutter/cupertino.dart'; | ||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
| import 'package:flutter_bloc/flutter_bloc.dart'; | import 'package:flutter_bloc/flutter_bloc.dart'; | ||||
| } | } | ||||
| }); | }); | ||||
| }), | }), | ||||
| CupertinoDialogAction( | |||||
| child: const Text(label_select_image_from_library), | |||||
| onPressed: () async { | |||||
| Navigator.pop(context, 'Discard'); | |||||
| FilePickerResult result = await FilePicker.platform.pickFiles(type: FileType.image, allowMultiple: true); | |||||
| if (result != null) { | |||||
| var listFuture = <Future<File>>[]; | |||||
| result.files.forEach((element) { | |||||
| listFuture.add(UtilAction.compressImage(File(element.path))); | |||||
| }); | |||||
| Future.wait(listFuture).then((values) { | |||||
| var isExistedFileTooLarge = false; | |||||
| values.forEach((compressFile) { | |||||
| if (compressFile.lengthSync() > ConstCommon.kFileSize) { | |||||
| isExistedFileTooLarge = true; | |||||
| } else { | |||||
| var newMedia = Media() | |||||
| ..isVideo = false | |||||
| ..isServerFile = false | |||||
| ..pathFile = compressFile.path; | |||||
| currentItems.add(newMedia); | |||||
| addNewFilePaths.add(compressFile.path); | |||||
| } | |||||
| }); | |||||
| if (isExistedFileTooLarge) { | |||||
| Utils.showSnackBarWarning(message: "Tập tin có kích thước lớn đã được loại bỏ."); | |||||
| } | |||||
| BlocProvider.of<MediaHelperBloc>(context)..add(ChangeListMedia(items: currentItems)); | |||||
| widget.onChangeFiles(addNewFilePaths, deleteFilePaths); | |||||
| }); | |||||
| } | |||||
| }), | |||||
| CupertinoDialogAction( | |||||
| child: const Text(label_select_video_from_library), | |||||
| onPressed: () async { | |||||
| Navigator.pop(context, 'Discard'); | |||||
| FilePickerResult result = await FilePicker.platform.pickFiles(type: FileType.video, allowMultiple: true); | |||||
| // CupertinoDialogAction( | |||||
| // child: const Text(label_select_image_from_library), | |||||
| // onPressed: () async { | |||||
| // Navigator.pop(context, 'Discard'); | |||||
| // FilePickerResult? result = await FilePicker.platform.pickFiles(type: FileType.image, allowMultiple: true); | |||||
| // if (result != null) { | |||||
| // var listFuture = <Future<File>>[]; | |||||
| // result.files.forEach((element) { | |||||
| // listFuture.add(UtilAction.compressImage(File(element.path ?? ''))); | |||||
| // }); | |||||
| // Future.wait(listFuture).then((values) { | |||||
| // var isExistedFileTooLarge = false; | |||||
| // values.forEach((compressFile) { | |||||
| // if (compressFile.lengthSync() > ConstCommon.kFileSize) { | |||||
| // isExistedFileTooLarge = true; | |||||
| // } else { | |||||
| // var newMedia = Media() | |||||
| // ..isVideo = false | |||||
| // ..isServerFile = false | |||||
| // ..pathFile = compressFile.path; | |||||
| // currentItems.add(newMedia); | |||||
| // addNewFilePaths.add(compressFile.path); | |||||
| // } | |||||
| // }); | |||||
| // if (isExistedFileTooLarge) { | |||||
| // Utils.showSnackBarWarning(message: "Tập tin có kích thước lớn đã được loại bỏ."); | |||||
| // } | |||||
| // BlocProvider.of<MediaHelperBloc>(context)..add(ChangeListMedia(items: currentItems)); | |||||
| // widget.onChangeFiles(addNewFilePaths, deleteFilePaths); | |||||
| // }); | |||||
| // } | |||||
| // }), | |||||
| // CupertinoDialogAction( | |||||
| // child: const Text(label_select_video_from_library), | |||||
| // onPressed: () async { | |||||
| // Navigator.pop(context, 'Discard'); | |||||
| // FilePickerResult? result = await FilePicker.platform.pickFiles(type: FileType.video, allowMultiple: true); | |||||
| if (result != null) { | |||||
| var isExistedFileTooLarge = false; | |||||
| result.files?.forEach((videoFile) { | |||||
| if (videoFile.size * 1000 > ConstCommon.kFileSize) { | |||||
| isExistedFileTooLarge = true; | |||||
| } else { | |||||
| var newMedia = Media() | |||||
| ..isVideo = true | |||||
| ..isServerFile = false | |||||
| ..pathFile = videoFile.path; | |||||
| currentItems.add(newMedia); | |||||
| addNewFilePaths.add(videoFile.path); | |||||
| } | |||||
| }); | |||||
| if (isExistedFileTooLarge) { | |||||
| Utils.showSnackBarWarning(message: "Tập tin có kích thước lớn đã được loại bỏ."); | |||||
| } | |||||
| BlocProvider.of<MediaHelperBloc>(context)..add(ChangeListMedia(items: currentItems)); | |||||
| widget.onChangeFiles(addNewFilePaths, deleteFilePaths); | |||||
| } | |||||
| }), | |||||
| // if (result != null) { | |||||
| // var isExistedFileTooLarge = false; | |||||
| // result.files?.forEach((videoFile) { | |||||
| // if (videoFile.size * 1000 > ConstCommon.kFileSize) { | |||||
| // isExistedFileTooLarge = true; | |||||
| // } else { | |||||
| // var newMedia = Media() | |||||
| // ..isVideo = true | |||||
| // ..isServerFile = false | |||||
| // ..pathFile = videoFile.path; | |||||
| // currentItems.add(newMedia); | |||||
| // addNewFilePaths.add(videoFile.path ?? ''); | |||||
| // } | |||||
| // }); | |||||
| // if (isExistedFileTooLarge) { | |||||
| // Utils.showSnackBarWarning(message: "Tập tin có kích thước lớn đã được loại bỏ."); | |||||
| // } | |||||
| // BlocProvider.of<MediaHelperBloc>(context)..add(ChangeListMedia(items: currentItems)); | |||||
| // widget.onChangeFiles(addNewFilePaths, deleteFilePaths); | |||||
| // } | |||||
| // }), | |||||
| CupertinoDialogAction( | CupertinoDialogAction( | ||||
| child: const Text(label_cancel), | child: const Text(label_cancel), | ||||
| textStyle: const TextStyle(fontWeight: FontWeight.bold), | textStyle: const TextStyle(fontWeight: FontWeight.bold), |
| _clickSignOut() async { | _clickSignOut() async { | ||||
| context.bloc<AuthenticationBloc>().add(AuthenticationLogoutRequested()); | context.bloc<AuthenticationBloc>().add(AuthenticationLogoutRequested()); | ||||
| try { | |||||
| var pushKey = await pref.getString(DATA_CONST.PUSH_KEY); | |||||
| if (pushKey.isNotEmpty) { | |||||
| _userRepository | |||||
| .deleteFcmToken(pushKey) | |||||
| .then((value) {}) | |||||
| .catchError((err) {}) | |||||
| .whenComplete(() { | |||||
| pref.saveString(DATA_CONST.TOKEN_KEY, ""); | |||||
| pref.saveString(DATA_CONST.PUSH_KEY, ""); | |||||
| pref.saveString(DATA_CONST.CURRENT_FULL_NAME, ""); | |||||
| }); | |||||
| } | |||||
| } catch (e) { | |||||
| pref.saveString(DATA_CONST.CURRENT_FULL_NAME, ""); | |||||
| pref.saveString(DATA_CONST.TOKEN_KEY, ""); | |||||
| pref.saveString(DATA_CONST.PUSH_KEY, ""); | |||||
| } | |||||
| // try { | |||||
| // var pushKey = await pref.getString(DATA_CONST.PUSH_KEY); | |||||
| // if (pushKey.isNotEmpty) { | |||||
| // _userRepository | |||||
| // .deleteFcmToken(pushKey) | |||||
| // .then((value) {}) | |||||
| // .catchError((err) {}) | |||||
| // .whenComplete(() { | |||||
| // pref.saveString(DATA_CONST.TOKEN_KEY, ""); | |||||
| // pref.saveString(DATA_CONST.PUSH_KEY, ""); | |||||
| // pref.saveString(DATA_CONST.CURRENT_FULL_NAME, ""); | |||||
| // }); | |||||
| // } | |||||
| // } catch (e) { | |||||
| // pref.saveString(DATA_CONST.CURRENT_FULL_NAME, ""); | |||||
| // pref.saveString(DATA_CONST.TOKEN_KEY, ""); | |||||
| // pref.saveString(DATA_CONST.PUSH_KEY, ""); | |||||
| // } | |||||
| } | } | ||||
| @override | @override | ||||
| color: Colors.grey[200], | color: Colors.grey[200], | ||||
| ), | ), | ||||
| Container( | Container( | ||||
| padding: | |||||
| const EdgeInsets.only(left: 12, right: 8, top: 14, bottom: 14), | |||||
| padding: const EdgeInsets.only(left: 12, right: 8, top: 14, bottom: 14), | |||||
| child: Row( | child: Row( | ||||
| children: [ | children: [ | ||||
| const Expanded( | const Expanded( | ||||
| child: Text( | child: Text( | ||||
| 'Phiên bản', | 'Phiên bản', | ||||
| style: | |||||
| TextStyle(fontSize: 16, fontWeight: FontWeight.w100), | |||||
| style: TextStyle(fontSize: 16, fontWeight: FontWeight.w100), | |||||
| )), | )), | ||||
| Text("${_packageInfo.version}.${_packageInfo.buildNumber}") | Text("${_packageInfo.version}.${_packageInfo.buildNumber}") | ||||
| ], | ], | ||||
| ), | ), | ||||
| ButtonIconWidget( | ButtonIconWidget( | ||||
| title: 'Đăng xuất', | title: 'Đăng xuất', | ||||
| titleStyle: const TextStyle( | |||||
| fontSize: 16, | |||||
| fontWeight: FontWeight.w100, | |||||
| color: Colors.red), | |||||
| titleStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w100, color: Colors.red), | |||||
| leadingIcon: AppIcons.icLogout, | leadingIcon: AppIcons.icLogout, | ||||
| trailingIcon: AppIcons.icArrowRight, | trailingIcon: AppIcons.icArrowRight, | ||||
| onTap: () { | onTap: () { |
| LoginState state, | LoginState state, | ||||
| ) async* { | ) async* { | ||||
| if (state.status.isValidated) { | if (state.status.isValidated) { | ||||
| yield state.copyWith(status: FormzStatus.submissionInProgress); | |||||
| try { | |||||
| var user = await _authenticationRepository.signInWithCredentials( | |||||
| state.username.value, | |||||
| state.password.value, | |||||
| ); | |||||
| var token = user.idToken; | |||||
| pref.saveString(DATA_CONST.TOKEN_KEY, token ?? ''); | |||||
| var currentTime = DateTime.now().millisecondsSinceEpoch; | |||||
| pref.saveString(DATA_CONST.EXPIRED_TIME, currentTime.toString()); | |||||
| // yield state.copyWith(status: FormzStatus.submissionInProgress); | |||||
| // try { | |||||
| // var user = await _authenticationRepository.signInWithCredentials( | |||||
| // state.username.value, | |||||
| // state.password.value, | |||||
| // ); | |||||
| // var token = user.idToken; | |||||
| // pref.saveString(DATA_CONST.TOKEN_KEY, token ?? ''); | |||||
| // var currentTime = DateTime.now().millisecondsSinceEpoch; | |||||
| // pref.saveString(DATA_CONST.EXPIRED_TIME, currentTime.toString()); | |||||
| yield state.copyWith(status: FormzStatus.submissionSuccess); | |||||
| } on Exception catch (_) { | |||||
| yield state.copyWith(status: FormzStatus.submissionFailure); | |||||
| } | |||||
| // yield state.copyWith(status: FormzStatus.submissionSuccess); | |||||
| // } on Exception catch (_) { | |||||
| // yield state.copyWith(status: FormzStatus.submissionFailure); | |||||
| // } | |||||
| } | |||||
| yield state.copyWith(status: FormzStatus.submissionInProgress); | |||||
| try { | |||||
| var user = await _authenticationRepository.signInWithCredentials( | |||||
| // state.username.value, | |||||
| // state.password.value, | |||||
| 'lecaoanhquoc', | |||||
| '12345678', | |||||
| ); | |||||
| var token = user.idToken; | |||||
| pref.saveString(DATA_CONST.TOKEN_KEY, token ?? ''); | |||||
| var currentTime = DateTime.now().millisecondsSinceEpoch; | |||||
| pref.saveString(DATA_CONST.EXPIRED_TIME, currentTime.toString()); | |||||
| yield state.copyWith(status: FormzStatus.submissionSuccess); | |||||
| } on Exception catch (_) { | |||||
| yield state.copyWith(status: FormzStatus.submissionFailure); | |||||
| } | } | ||||
| } | } | ||||
| } | } |
| textInputAction: TextInputAction.next, | textInputAction: TextInputAction.next, | ||||
| onChanged: (username) => context.bloc<LoginBloc>().add(LoginUsernameChanged(username)), | onChanged: (username) => context.bloc<LoginBloc>().add(LoginUsernameChanged(username)), | ||||
| // autovalidate: true, | // autovalidate: true, | ||||
| validator: (_) { | validator: (_) { | ||||
| return state.username.invalid ? 'Vui lòng nhập tài khoản' : null; | return state.username.invalid ? 'Vui lòng nhập tài khoản' : null; | ||||
| }, | }, | ||||
| height: 55, | height: 55, | ||||
| child: FlatButton( | child: FlatButton( | ||||
| onPressed: () { | onPressed: () { | ||||
| if (state.status.isValidated) { | |||||
| context.bloc<LoginBloc>().add(const LoginSubmitted()); | |||||
| } | |||||
| // if (state.status.isValidated) { | |||||
| // context.bloc<LoginBloc>().add(const LoginSubmitted()); | |||||
| // } | |||||
| context.bloc<LoginBloc>().add(const LoginSubmitted()); | |||||
| }, | }, | ||||
| color: state.status.isValidated ? AppColors.DEFAULT : AppColors.GRAY1_50, | color: state.status.isValidated ? AppColors.DEFAULT : AppColors.GRAY1_50, | ||||
| shape: RoundedRectangleBorder( | shape: RoundedRectangleBorder( |
| child: BlocProvider( | child: BlocProvider( | ||||
| create: (context) { | create: (context) { | ||||
| return LoginBloc( | return LoginBloc( | ||||
| authenticationRepository: | |||||
| RepositoryProvider.of<AuthenticationRepository>(context), | |||||
| authenticationRepository: RepositoryProvider.of<AuthenticationRepository>(context), | |||||
| ); | ); | ||||
| }, | }, | ||||
| child: ListView( | child: ListView( |
| import 'package:flutter_bloc/flutter_bloc.dart'; | import 'package:flutter_bloc/flutter_bloc.dart'; | ||||
| import 'package:farm_tpf/utils/const_string.dart'; | import 'package:farm_tpf/utils/const_string.dart'; | ||||
| import 'package:farm_tpf/utils/formatter.dart'; | import 'package:farm_tpf/utils/formatter.dart'; | ||||
| import 'package:get/get.dart'; | |||||
| import 'bloc/plot_bloc.dart'; | import 'bloc/plot_bloc.dart'; | ||||
| textColor = Colors.black; | textColor = Colors.black; | ||||
| } | } | ||||
| return GestureDetector( | |||||
| return InkWell( | |||||
| child: Container( | child: Container( | ||||
| margin: const EdgeInsets.all(8), | margin: const EdgeInsets.all(8), | ||||
| decoration: BoxDecoration( | decoration: BoxDecoration( | ||||
| ), | ), | ||||
| ), | ), | ||||
| onTap: () { | onTap: () { | ||||
| // Get.to( | |||||
| // () => PlotDetailScreen( | |||||
| // cropId: item.id?.toInt(), | |||||
| // initialIndex: 0, | |||||
| // cropType: item.type?.toInt() ?? -1, | |||||
| // ), | |||||
| // ); | |||||
| Navigator.push( | Navigator.push( | ||||
| context, | |||||
| MaterialPageRoute( | |||||
| builder: (BuildContext context) => PlotDetailScreen( | |||||
| cropId: item.id?.toInt(), | |||||
| initialIndex: 0, | |||||
| cropType: item.type?.toInt() ?? -1, | |||||
| ))); | |||||
| context, | |||||
| MaterialPageRoute( | |||||
| builder: (BuildContext context) => PlotDetailScreen( | |||||
| cropId: item.id?.toInt(), | |||||
| initialIndex: 0, | |||||
| cropType: item.type?.toInt() ?? -1, | |||||
| ), | |||||
| ), | |||||
| ); | |||||
| }); | }); | ||||
| } | } | ||||
| } | } |
| @override | @override | ||||
| Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
| // return Container(); | |||||
| return const Scaffold(body: Center(child: CircularProgressIndicator())); | return const Scaffold(body: Center(child: CircularProgressIndicator())); | ||||
| } | } | ||||
| } | } |
| class _TabbarScreenState extends State<TabbarScreen> { | class _TabbarScreenState extends State<TabbarScreen> { | ||||
| Stream<LocalNotification> _notificationsStream = NotificationsBloc.instance.notificationsStream; | Stream<LocalNotification> _notificationsStream = NotificationsBloc.instance.notificationsStream; | ||||
| UserRepository _userRepository = UserRepository(); | UserRepository _userRepository = UserRepository(); | ||||
| final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); | |||||
| // final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); | |||||
| var pref = LocalPref(); | var pref = LocalPref(); | ||||
| String pushkey = ""; | String pushkey = ""; | ||||
| String currentFullName = ""; | String currentFullName = ""; | ||||
| var options = BaseOptions(baseUrl: ConstCommon.baseUrl); | var options = BaseOptions(baseUrl: ConstCommon.baseUrl); | ||||
| options.headers["Authorization"] = "Bearer $token"; | options.headers["Authorization"] = "Bearer $token"; | ||||
| client = Dio(options); | client = Dio(options); | ||||
| if (Platform.isIOS) { | |||||
| _firebaseMessaging.requestNotificationPermissions(const IosNotificationSettings()); | |||||
| } | |||||
| _firebaseMessaging.configure( | |||||
| onMessage: (Map<String, dynamic> message) async { | |||||
| print("onMessage--tabbar-: $message"); | |||||
| try { | |||||
| final String type = message['tbCropType']; | |||||
| final String contents = message['contents']; | |||||
| final String tbCropId = message['tbCropId']; | |||||
| // if (Platform.isIOS) { | |||||
| // _firebaseMessaging.requestNotificationPermissions(const IosNotificationSettings()); | |||||
| // } | |||||
| // _firebaseMessaging.configure( | |||||
| // onMessage: (Map<String, dynamic> message) async { | |||||
| // print("onMessage--tabbar-: $message"); | |||||
| // try { | |||||
| // final String type = message['tbCropType']; | |||||
| // final String contents = message['contents']; | |||||
| // final String tbCropId = message['tbCropId']; | |||||
| updateCountNotiBloc.getNotifications((data) {}, (err) {}); | |||||
| final notification = LocalNotification(type, contents, tbCropId); | |||||
| NotificationsBloc.instance.newNotification(notification); | |||||
| // updateCountNotiBloc.getNotifications((data) {}, (err) {}); | |||||
| // final notification = LocalNotification(type, contents, tbCropId); | |||||
| // NotificationsBloc.instance.newNotification(notification); | |||||
| if (contents == "ENV_UPDATE") { | |||||
| if (Get.isSnackbarOpen) Get.back(); | |||||
| Get.snackbar(null, 'Thông số môi trường được cập nhật'); | |||||
| } else if (contents == "PIC_UPDATE") { | |||||
| if (Get.isSnackbarOpen) Get.back(); | |||||
| Get.snackbar(null, 'Người phụ trách được cập nhật'); | |||||
| } else { | |||||
| //Go home | |||||
| } | |||||
| } catch (e) { | |||||
| print('error'); | |||||
| print(e); | |||||
| } | |||||
| }, | |||||
| // onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, | |||||
| onLaunch: (Map<String, dynamic> message) async { | |||||
| print("onLaunch: $message"); | |||||
| Future.delayed(const Duration(milliseconds: 500), () { | |||||
| updateCountNotiBloc.getNotifications((data) {}, (err) {}); | |||||
| _notificationNavigateOnFCM(message); | |||||
| }); | |||||
| }, | |||||
| onResume: (Map<String, dynamic> message) async { | |||||
| print("onResume: $message"); | |||||
| updateCountNotiBloc.getNotifications((data) {}, (err) {}); | |||||
| _notificationNavigateOnFCM(message); | |||||
| }, | |||||
| ); | |||||
| _firebaseMessaging.requestNotificationPermissions(const IosNotificationSettings(sound: true, badge: true, alert: true, provisional: true)); | |||||
| _firebaseMessaging.onIosSettingsRegistered.listen((IosNotificationSettings settings) { | |||||
| print("Settings registered: $settings"); | |||||
| }); | |||||
| // if (contents == "ENV_UPDATE") { | |||||
| // if (Get.isSnackbarOpen) Get.back(); | |||||
| // Get.snackbar(null, 'Thông số môi trường được cập nhật'); | |||||
| // } else if (contents == "PIC_UPDATE") { | |||||
| // if (Get.isSnackbarOpen) Get.back(); | |||||
| // Get.snackbar(null, 'Người phụ trách được cập nhật'); | |||||
| // } else { | |||||
| // //Go home | |||||
| // } | |||||
| // } catch (e) { | |||||
| // print('error'); | |||||
| // print(e); | |||||
| // } | |||||
| // }, | |||||
| // // onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, | |||||
| // onLaunch: (Map<String, dynamic> message) async { | |||||
| // print("onLaunch: $message"); | |||||
| // Future.delayed(const Duration(milliseconds: 500), () { | |||||
| // updateCountNotiBloc.getNotifications((data) {}, (err) {}); | |||||
| // _notificationNavigateOnFCM(message); | |||||
| // }); | |||||
| // }, | |||||
| // onResume: (Map<String, dynamic> message) async { | |||||
| // print("onResume: $message"); | |||||
| // updateCountNotiBloc.getNotifications((data) {}, (err) {}); | |||||
| // _notificationNavigateOnFCM(message); | |||||
| // }, | |||||
| // ); | |||||
| // _firebaseMessaging.requestNotificationPermissions(const IosNotificationSettings(sound: true, badge: true, alert: true, provisional: true)); | |||||
| // _firebaseMessaging.onIosSettingsRegistered.listen((IosNotificationSettings settings) { | |||||
| // print("Settings registered: $settings"); | |||||
| // }); | |||||
| if (pushkey?.isEmpty ?? true) { | if (pushkey?.isEmpty ?? true) { | ||||
| _firebaseMessaging.getToken().then((String token) { | |||||
| assert(token != null); | |||||
| print("Push Messaging token: $token"); | |||||
| _userRepository.updateFcmToken(token).then((value) { | |||||
| print("send push key successful"); | |||||
| pref.saveString(DATA_CONST.PUSH_KEY, token); | |||||
| }); | |||||
| // client.put(""); | |||||
| }); | |||||
| // _firebaseMessaging.getToken().then((String token) { | |||||
| // assert(token != null); | |||||
| // print("Push Messaging token: $token"); | |||||
| // _userRepository.updateFcmToken(token).then((value) { | |||||
| // print("send push key successful"); | |||||
| // pref.saveString(DATA_CONST.PUSH_KEY, token); | |||||
| // }); | |||||
| // // client.put(""); | |||||
| // }); | |||||
| } else { | } else { | ||||
| print("Don't need get push key"); | print("Don't need get push key"); | ||||
| } | } |
| class RouteName { | |||||
| static const String splash = '/'; | |||||
| static const String login = '/login'; | |||||
| static const String home = '/home'; | |||||
| static const String forgotPass = '/forgotPass'; | |||||
| static const String changePass = '/changePass'; | |||||
| static const String customerDetail = '/customer-detail'; | |||||
| static const String vehicleDetail = '/vehicle-detail'; | |||||
| static const String anglePhoto = '/angle-photo'; | |||||
| static const String exteriorInspectionA = '/exterior_inspection_a'; | |||||
| static const String exteriorInspectionB = '/exterior_inspection_b'; | |||||
| static const String exteriorInspectionC = '/exterior_inspection_c'; | |||||
| static const String exteriorInspectionD = '/exterior_inspection_d'; | |||||
| static const String outputFinal = '/output_final'; | |||||
| static const String appraisal_listing = '/appraisal_listing'; | |||||
| static const String appraisalDetail = '/appraisal_detail'; | |||||
| static const String recordDeal = '/recordDeal'; | |||||
| static const String postDetail = '/postDetail'; | |||||
| static const String postCategory = '/postCategory'; | |||||
| static const String chooseFrame = '/chooseFrame'; | |||||
| static const String selectImages = '/selectImages'; | |||||
| static const String splashPage = '/splashPage'; | |||||
| static const String selectPostImagesPage = '/selectPostImagesPage'; | |||||
| static const String studentInClass = '/studentInClass'; | |||||
| static const String studentDetail = '/studentDetail'; | |||||
| static const String classCamera = '/classCamera'; | |||||
| static const String myKidInfoPage = '/myKidInfoPage'; | |||||
| static const String previewedPage = '/previewedPage'; | |||||
| } |
| import 'package:farm_tpf/presentation/screens/tabbar/tabbar.dart'; | |||||
| import 'package:flutter/material.dart'; | |||||
| import '../presentation/screens/splash/view/splash_page.dart'; | |||||
| import 'route_name.dart'; | |||||
| class Routes { | |||||
| static Route buildRoutes(RouteSettings settings) { | |||||
| switch (settings.name) { | |||||
| case RouteName.splashPage: | |||||
| return buildRoute(settings, SplashPage()); | |||||
| case RouteName.home: | |||||
| return buildRoute(settings, TabbarScreen()); | |||||
| default: | |||||
| return _errorRoute(); | |||||
| } | |||||
| } | |||||
| static Route homeRoute(RouteSettings settings) { | |||||
| return buildRoutes(settings); | |||||
| } | |||||
| static Route _errorRoute() { | |||||
| return MaterialPageRoute(builder: (_) { | |||||
| return const Scaffold( | |||||
| body: Center( | |||||
| child: Text(''), | |||||
| ), | |||||
| ); | |||||
| }); | |||||
| } | |||||
| static MaterialPageRoute buildRoute(RouteSettings settings, Widget builder) { | |||||
| return MaterialPageRoute( | |||||
| settings: settings, | |||||
| builder: (BuildContext context) => builder, | |||||
| ); | |||||
| } | |||||
| } |
| static int kExpiredTime = 518400000; //6* 24 * 60 * 60 * 1000; 6days | static int kExpiredTime = 518400000; //6* 24 * 60 * 60 * 1000; 6days | ||||
| static int kFileSize = 1000000; //1M = 1000.000 bytes | static int kFileSize = 1000000; //1M = 1000.000 bytes | ||||
| static int kMaxAgeCache = 7; // 7days | static int kMaxAgeCache = 7; // 7days | ||||
| static const String baseUrl = "https://smf.presshome.vn/"; | |||||
| static const String baseImageUrl = "https://smf.presshome.vn/upload/"; | |||||
| static const String baseUrl = "https://tpf.aztrace.vn/"; | |||||
| static const String baseImageUrl = "https://tpf.aztrace.vn/upload/"; | |||||
| static RegExp regExpDecimal = RegExp("[0-9.]"); | static RegExp regExpDecimal = RegExp("[0-9.]"); | ||||
| static const String apiDetailNursery = "api/activity-nursery"; | static const String apiDetailNursery = "api/activity-nursery"; | ||||
| } | } | ||||
| enum CRUDStatus { unknown, add, edit, delete } | enum CRUDStatus { unknown, add, edit, delete } | ||||
| enum LocationType { country, province, district, ward } | enum LocationType { country, province, district, ward } |
| @override | @override | ||||
| Future<String> getString(String key) async { | Future<String> getString(String key) async { | ||||
| final prefs = await SharedPreferences.getInstance(); | final prefs = await SharedPreferences.getInstance(); | ||||
| return prefs.getString(key); | |||||
| return prefs.getString(key) ?? ''; | |||||
| } | } | ||||
| } | } | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "14.0.0" | version: "14.0.0" | ||||
| _flutterfire_internals: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: _flutterfire_internals | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "1.0.17" | |||||
| analyzer: | analyzer: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.41.2" | version: "0.41.2" | ||||
| archive: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: archive | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "2.0.13" | |||||
| args: | args: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: args | name: args | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "2.3.1" | |||||
| version: "1.6.0" | |||||
| async: | async: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.2.0" | version: "1.2.0" | ||||
| barcode_scan: | |||||
| dependency: "direct main" | |||||
| description: | |||||
| name: barcode_scan | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "3.0.1" | |||||
| bloc: | bloc: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "2.1.5" | version: "2.1.5" | ||||
| csslib: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: csslib | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "0.17.2" | |||||
| cupertino_icons: | cupertino_icons: | ||||
| dependency: "direct main" | dependency: "direct main" | ||||
| description: | description: | ||||
| name: ffi | name: ffi | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.2.1" | |||||
| version: "2.0.1" | |||||
| file: | file: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "6.1.4" | version: "6.1.4" | ||||
| file_picker: | |||||
| dependency: "direct main" | |||||
| description: | |||||
| name: file_picker | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "2.1.7" | |||||
| firebase_core: | firebase_core: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: firebase_core | name: firebase_core | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.5.3" | |||||
| version: "2.7.1" | |||||
| firebase_core_platform_interface: | firebase_core_platform_interface: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: firebase_core_platform_interface | name: firebase_core_platform_interface | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "2.1.0" | |||||
| version: "4.5.3" | |||||
| firebase_core_web: | firebase_core_web: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: firebase_core_web | name: firebase_core_web | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.2.1+1" | |||||
| version: "2.2.2" | |||||
| firebase_messaging: | firebase_messaging: | ||||
| dependency: "direct main" | dependency: "direct main" | ||||
| description: | description: | ||||
| name: firebase_messaging | name: firebase_messaging | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "7.0.3" | |||||
| version: "14.2.6" | |||||
| firebase_messaging_platform_interface: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: firebase_messaging_platform_interface | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "4.2.15" | |||||
| firebase_messaging_web: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: firebase_messaging_web | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "3.2.16" | |||||
| fixnum: | fixnum: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: flutter_cache_manager | name: flutter_cache_manager | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.4.2" | |||||
| version: "2.1.2" | |||||
| flutter_datetime_picker: | flutter_datetime_picker: | ||||
| dependency: "direct main" | dependency: "direct main" | ||||
| description: | description: | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.7.0" | version: "0.7.0" | ||||
| flutter_plugin_android_lifecycle: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: flutter_plugin_android_lifecycle | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "1.0.11" | |||||
| flutter_svg: | flutter_svg: | ||||
| dependency: "direct main" | dependency: "direct main" | ||||
| description: | description: | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.2.0" | version: "0.2.0" | ||||
| html: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: html | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "0.15.2" | |||||
| http: | http: | ||||
| dependency: "direct main" | dependency: "direct main" | ||||
| description: | description: | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "3.1.4" | version: "3.1.4" | ||||
| image: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: image | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "2.1.19" | |||||
| intl: | intl: | ||||
| dependency: "direct main" | dependency: "direct main" | ||||
| description: | description: | ||||
| name: intl | name: intl | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.16.1" | |||||
| version: "0.17.0" | |||||
| io: | io: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: path_provider | name: path_provider | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.6.28" | |||||
| path_provider_linux: | |||||
| version: "2.0.13" | |||||
| path_provider_android: | |||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: path_provider_linux | |||||
| name: path_provider_android | |||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.0.1+2" | |||||
| path_provider_macos: | |||||
| version: "2.0.23" | |||||
| path_provider_foundation: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: path_provider_foundation | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "2.1.2" | |||||
| path_provider_linux: | |||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: path_provider_macos | |||||
| name: path_provider_linux | |||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.0.4+8" | |||||
| version: "2.1.9" | |||||
| path_provider_platform_interface: | path_provider_platform_interface: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: path_provider_platform_interface | name: path_provider_platform_interface | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.0.4" | |||||
| version: "2.0.6" | |||||
| path_provider_windows: | path_provider_windows: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: path_provider_windows | name: path_provider_windows | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.0.5" | |||||
| version: "2.1.4" | |||||
| pattern_formatter: | pattern_formatter: | ||||
| dependency: "direct main" | dependency: "direct main" | ||||
| description: | description: | ||||
| name: pattern_formatter | name: pattern_formatter | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.0.2" | |||||
| version: "2.0.0" | |||||
| pedantic: | pedantic: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: plugin_platform_interface | name: plugin_platform_interface | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.0.3" | |||||
| version: "2.1.4" | |||||
| pool: | pool: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "4.2.4" | version: "4.2.4" | ||||
| protobuf: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: protobuf | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "1.1.4" | |||||
| provider: | provider: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: shared_preferences | name: shared_preferences | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.5.12+4" | |||||
| shared_preferences_linux: | |||||
| version: "2.0.18" | |||||
| shared_preferences_android: | |||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: shared_preferences_linux | |||||
| name: shared_preferences_android | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "2.0.16" | |||||
| shared_preferences_foundation: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: shared_preferences_foundation | |||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.0.2+4" | |||||
| shared_preferences_macos: | |||||
| version: "2.1.4" | |||||
| shared_preferences_linux: | |||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: shared_preferences_macos | |||||
| name: shared_preferences_linux | |||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.0.1+11" | |||||
| version: "2.1.4" | |||||
| shared_preferences_platform_interface: | shared_preferences_platform_interface: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: shared_preferences_platform_interface | name: shared_preferences_platform_interface | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.0.4" | |||||
| version: "2.1.1" | |||||
| shared_preferences_web: | shared_preferences_web: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: shared_preferences_web | name: shared_preferences_web | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.1.2+7" | |||||
| version: "2.0.5" | |||||
| shared_preferences_windows: | shared_preferences_windows: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: shared_preferences_windows | name: shared_preferences_windows | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.0.2+3" | |||||
| version: "2.1.4" | |||||
| shelf: | shelf: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: video_player | name: video_player | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.10.12+5" | |||||
| version: "2.5.3" | |||||
| video_player_android: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: video_player_android | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "2.3.11" | |||||
| video_player_avfoundation: | |||||
| dependency: transitive | |||||
| description: | |||||
| name: video_player_avfoundation | |||||
| url: "https://pub.dartlang.org" | |||||
| source: hosted | |||||
| version: "2.3.9" | |||||
| video_player_platform_interface: | video_player_platform_interface: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: video_player_platform_interface | name: video_player_platform_interface | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "2.2.0" | |||||
| version: "6.0.2" | |||||
| video_player_web: | video_player_web: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: video_player_web | name: video_player_web | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.1.4+1" | |||||
| version: "2.0.14" | |||||
| watcher: | watcher: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: win32 | name: win32 | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "2.6.1" | |||||
| version: "3.1.3" | |||||
| xdg_directories: | xdg_directories: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: xdg_directories | name: xdg_directories | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.1.2" | |||||
| version: "1.0.0" | |||||
| xml: | xml: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| version: "3.1.1" | version: "3.1.1" | ||||
| sdks: | sdks: | ||||
| dart: ">=2.17.0 <3.0.0" | dart: ">=2.17.0 <3.0.0" | ||||
| flutter: ">=1.24.0-10.1.pre" | |||||
| flutter: ">=3.0.0" |
| version: 1.0.1+4 | version: 1.0.1+4 | ||||
| environment: | environment: | ||||
| sdk: ">=2.12.0 <3.0.0" | |||||
| sdk: ">=2.17.0 <3.0.0" | |||||
| module: | module: | ||||
| androidX: true | androidX: true | ||||
| cupertino_icons: ^0.1.3 | cupertino_icons: ^0.1.3 | ||||
| meta: ^1.1.8 | meta: ^1.1.8 | ||||
| shared_preferences: ^0.5.8 | |||||
| shared_preferences: any | |||||
| flutter_bloc: ^6.0.1 | flutter_bloc: ^6.0.1 | ||||
| equatable: ^1.2.0 | equatable: ^1.2.0 | ||||
| dio: ^3.0.10 | dio: ^3.0.10 | ||||
| dio_http_cache: ^0.2.9 | dio_http_cache: ^0.2.9 | ||||
| formz: ^0.3.0 | formz: ^0.3.0 | ||||
| keyboard_dismisser: ^1.0.2 | keyboard_dismisser: ^1.0.2 | ||||
| pattern_formatter: ^1.0.2 | |||||
| pattern_formatter: ^2.0.0 | |||||
| rxdart: ^0.23.0 | rxdart: ^0.23.0 | ||||
| barcode_scan: ^3.0.1 | |||||
| # barcode_scan: ^3.0.1 | |||||
| video_player: ^2.5.3 | video_player: ^2.5.3 | ||||
| shimmer: ^1.1.1 | shimmer: ^1.1.1 | ||||
| font_awesome_flutter: ^8.8.1 | font_awesome_flutter: ^8.8.1 | ||||
| package_info: ^0.4.3 | package_info: ^0.4.3 | ||||
| change_app_package_name: ^0.1.2 | change_app_package_name: ^0.1.2 | ||||
| firebase_messaging: ^7.0.0 | |||||
| firebase_messaging: ^14.2.6 | |||||
| get: ^3.8.0 | get: ^3.8.0 | ||||
| intl: ^0.16.1 | |||||
| intl: ^0.17.0 | |||||
| flutter_datetime_picker: ^1.3.8 | flutter_datetime_picker: ^1.3.8 | ||||
| http: ^0.12.2 | http: ^0.12.2 | ||||
| http_parser: ^3.1.4 | http_parser: ^3.1.4 | ||||
| cached_network_image: ^2.3.2+1 | cached_network_image: ^2.3.2+1 | ||||
| camera: ^0.5.8+5 | camera: ^0.5.8+5 | ||||
| path_provider: ^1.6.14 | |||||
| file_picker: ^2.0.7 | |||||
| flutter_cache_manager: ^1.4.2 | |||||
| path_provider: ^2.0.13 | |||||
| # file_picker: ^5.2.5 | |||||
| flutter_cache_manager: any | |||||
| mime: ^0.9.7 | mime: ^0.9.7 | ||||
| flutter_image_compress: ^0.7.0 | flutter_image_compress: ^0.7.0 |