diff --git a/android/app/build.gradle b/android/app/build.gradle index 4c4bd02..d654325 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -35,11 +35,11 @@ android { checkReleaseBuilds false } - compileSdkVersion 31 + compileSdkVersion 33 defaultConfig { minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion 33 versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true @@ -76,7 +76,7 @@ android { signingConfig signingConfigs.release minifyEnabled true - useProguard false + // useProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } diff --git a/android/build.gradle b/android/build.gradle index 493df9c..92237fa 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -7,8 +7,10 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' - classpath 'com.google.gms:google-services:4.3.8' + classpath 'com.android.tools.build:gradle:7.1.0' + classpath 'com.google.gms:google-services:4.3.10' + // classpath 'com.android.tools.build:gradle:4.1.0' + // classpath 'com.google.gms:google-services:4.3.8' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -26,7 +28,7 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/android/dev-key.keystore b/android/dev-key.keystore new file mode 100644 index 0000000..0bcd453 Binary files /dev/null and b/android/dev-key.keystore differ diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index bc6a58a..cc5527d 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip diff --git a/lib/helpers/api_helper.dart b/lib/helpers/api_helper.dart index 8eacdd2..801162e 100644 --- a/lib/helpers/api_helper.dart +++ b/lib/helpers/api_helper.dart @@ -16,13 +16,8 @@ final log = Logger('requestAPI'); // request makes http request // if token is null -Future requestAPI( - String path, - method, { - dynamic payload, - String? token, - String? url, -}) async { +Future requestAPI(String path, method, + {dynamic payload, String? token, String? url, int? networkTimeout}) async { DevInfo devInfo = await DevInfo.getDevInfo(); String deviceName = "${devInfo.model}(${devInfo.id})"; @@ -33,15 +28,15 @@ Future requestAPI( headers["Token"] = token; } if (devInfo != null && devInfo.deviceID != null && deviceName != null) { - headers["Device"] = devInfo.deviceID??"" + ":" + deviceName; + headers["Device"] = devInfo.deviceID ?? "" + ":" + deviceName; } headers["Project-ID"] = Config.instance.reportProjectID; BaseOptions options = new BaseOptions( method: method, baseUrl: url == null ? Config.instance.apiURL : url, - connectTimeout: 10000, - receiveTimeout: 60000, + connectTimeout: Duration(milliseconds: networkTimeout ?? 50000), + receiveTimeout: Duration(milliseconds: networkTimeout ?? 50000), headers: headers, ); log.info("baseUrl:${options.baseUrl}, path:$path"); diff --git a/lib/pages/carton/carton_editor.dart b/lib/pages/carton/carton_editor.dart index 8579e6c..6cd3f09 100644 --- a/lib/pages/carton/carton_editor.dart +++ b/lib/pages/carton/carton_editor.dart @@ -822,9 +822,9 @@ class _CartonEditorState extends State { return; } - double l = double.parse(_lengthController.text, (s) => 0); - double w = double.parse(_widthController.text, (s) => 0); - double h = double.parse(_heightController.text, (s) => 0); + double l = double.parse(_lengthController.text); + double w = double.parse(_widthController.text); + double h = double.parse(_heightController.text); Carton carton = Carton(); carton.id = _carton!.id; diff --git a/lib/pages/carton/total_weight_edit.dart b/lib/pages/carton/total_weight_edit.dart index 21632f3..da2b242 100644 --- a/lib/pages/carton/total_weight_edit.dart +++ b/lib/pages/carton/total_weight_edit.dart @@ -73,7 +73,7 @@ class _TotalWeightEditState extends State { _loading = true; }); try { - double total = double.parse(totalController.text, (s) => 0); + double total = double.parse(totalController.text); Navigator.pop(context, total); } catch (e) { showMsgDialog(context, "Error", e.toString()); diff --git a/lib/pages/carton_size/carton_size_editor.dart b/lib/pages/carton_size/carton_size_editor.dart index b9a21c1..4e6882b 100644 --- a/lib/pages/carton_size/carton_size_editor.dart +++ b/lib/pages/carton_size/carton_size_editor.dart @@ -100,9 +100,13 @@ class _CartonSizeEditorState extends State { CartonSizeModel cartonSizeModel = Provider.of(context, listen: false); try { - double l = double.parse(_lengthController.text, (s) => 0); - double w = double.parse(_widthController.text, (s) => 0); - double h = double.parse(_heightController.text, (s) => 0); + double l = double.parse( + _lengthController.text, + ); + double w = double.parse( + _widthController.text, + ); + double h = double.parse(_heightController.text); if (_isNew) { CartonSize _cartonSize = CartonSize( @@ -178,9 +182,9 @@ class _CartonSizeEditorState extends State { _widthController.text != "12" || _heightController.text != "12"; } else { - double l = double.parse(_lengthController.text, (s) => 0); - double w = double.parse(_widthController.text, (s) => 0); - double h = double.parse(_heightController.text, (s) => 0); + double l = double.parse(_lengthController.text); + double w = double.parse(_widthController.text); + double h = double.parse(_heightController.text); CartonSize _cartonSize = CartonSize( name: _nameController.text, length: l, width: w, height: h); diff --git a/lib/pages/chat/bubble.dart b/lib/pages/chat/bubble.dart index dabed50..a553549 100644 --- a/lib/pages/chat/bubble.dart +++ b/lib/pages/chat/bubble.dart @@ -70,17 +70,29 @@ class Bubble extends StatelessWidget { ? [ FcsIDIcon(), getMsg(context, icon), - FlatButton( - shape: RoundedRectangleBorder( + TextButton( + style: TextButton.styleFrom( + backgroundColor:Colors.blue[50], + shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10.0), - ), - color: Colors.blue[50], - onPressed: () => _viewDetail(), + )), + onPressed: () {}, child: Text( getLocalString(context, "message.view.detail"), style: TextStyle( color: primaryColor, fontWeight: FontWeight.bold))) + // FlatButton( + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(10.0), + // ), + // color: Colors.blue[50], + // onPressed: () => _viewDetail(), + // child: Text( + // getLocalString(context, "message.view.detail"), + // style: TextStyle( + // color: primaryColor, + // fontWeight: FontWeight.bold))) ] : [ Text(isCustomer ? "FCS Team" : sender ?? "", diff --git a/lib/pages/customer/customer_list.dart b/lib/pages/customer/customer_list.dart index 09c4cba..ac17c52 100644 --- a/lib/pages/customer/customer_list.dart +++ b/lib/pages/customer/customer_list.dart @@ -149,11 +149,15 @@ class _CustomerListState extends State { customer.status == user_invited_status ? Padding( padding: const EdgeInsets.only(right: 8.0), - child: FlatButton( + child: TextButton( onPressed: () => _share(customer), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(18.0), - side: BorderSide(color: primaryColor)), + style: TextButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(18.0), + side: BorderSide(color: primaryColor))), + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(18.0), + // side: BorderSide(color: primaryColor)), child: Row( children: [ Text( diff --git a/lib/pages/delivery/delivery_info.dart b/lib/pages/delivery/delivery_info.dart index fef0d5e..0007a53 100644 --- a/lib/pages/delivery/delivery_info.dart +++ b/lib/pages/delivery/delivery_info.dart @@ -113,9 +113,9 @@ class _DeliveryInfoState extends State { } _calShipmentWeight() { - double l = double.parse(_lengthController.text, (s) => 0); - double w = double.parse(_widthController.text, (s) => 0); - double h = double.parse(_heightController.text, (s) => 0); + double l = double.parse(_lengthController.text); + double w = double.parse(_widthController.text); + double h = double.parse(_heightController.text); setState(() { shipmentWeight = l * w * h / volumetricRatio; }); diff --git a/lib/pages/faq/faq_edit_page.dart b/lib/pages/faq/faq_edit_page.dart index d56471c..29ca285 100644 --- a/lib/pages/faq/faq_edit_page.dart +++ b/lib/pages/faq/faq_edit_page.dart @@ -92,10 +92,10 @@ class _FAQEditorState extends State { color: primaryColor, ), onChanged: (String? newValue) { - if(newValue != null) - setState(() { - _pageLink = newValue; - }); + if (newValue != null) + setState(() { + _pageLink = newValue; + }); }, items: [ info, @@ -197,10 +197,7 @@ class _FAQEditorState extends State { _isLoading = true; }); try { - int sn = int.parse( - _sn.text, - onError: (source) => throw Exception("Invalid number"), - ); + int sn = int.parse(_sn.text); FAQModel faqModel = Provider.of(context, listen: false); FAQ _faq = FAQ( sn: sn, diff --git a/lib/pages/faq/faq_list_page.dart b/lib/pages/faq/faq_list_page.dart index 1e8bc36..077f66a 100644 --- a/lib/pages/faq/faq_list_page.dart +++ b/lib/pages/faq/faq_list_page.dart @@ -143,8 +143,9 @@ class _FAQListPageState extends State : Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - FlatButton( - color: primaryColor, + TextButton( + style: TextButton.styleFrom(backgroundColor: primaryColor), + // color: primaryColor, onPressed: () => _selectLinkPage(linkPage), child: LocalText(context, "", text: text, color: Colors.white), ) diff --git a/lib/pages/invoice/box_addition.dart b/lib/pages/invoice/box_addition.dart index 805979f..f14c26c 100644 --- a/lib/pages/invoice/box_addition.dart +++ b/lib/pages/invoice/box_addition.dart @@ -76,10 +76,15 @@ class _BoxAdditionState extends State { child: Center( child: Container( width: 250, - child: FlatButton( - child: Text('Add box'), - color: primaryColor, - textColor: Colors.white, + child: TextButton( + style: TextButton.styleFrom( + backgroundColor: primaryColor), + child: Text( + 'Add box', + style: TextStyle(color: Colors.white), + ), + // color: primaryColor, + // textColor: Colors.white, onPressed: () { Navigator.pop(context); }, @@ -90,10 +95,13 @@ class _BoxAdditionState extends State { child: Center( child: Container( width: 250, - child: FlatButton( - child: Text('Save box'), - color: primaryColor, - textColor: Colors.white, + child: TextButton( + style: TextButton.styleFrom( + backgroundColor: primaryColor), + child: Text('Save box', + style: TextStyle(color: Colors.white)), + // color: primaryColor, + // textColor: Colors.white, onPressed: () { Navigator.pop(context); }, diff --git a/lib/pages/invoice/invoice_list_row.dart b/lib/pages/invoice/invoice_list_row.dart index 2022362..0cb99ac 100644 --- a/lib/pages/invoice/invoice_list_row.dart +++ b/lib/pages/invoice/invoice_list_row.dart @@ -76,7 +76,7 @@ class InvoiceListRow extends StatelessWidget { ? Padding( padding: const EdgeInsets.only(left: 10.0), child: InkWell( - child: RaisedButton( + child: ElevatedButton( child: Row( children: [ Icon( diff --git a/lib/pages/main/home_page.dart b/lib/pages/main/home_page.dart index 4cade3b..b89b290 100644 --- a/lib/pages/main/home_page.dart +++ b/lib/pages/main/home_page.dart @@ -148,12 +148,12 @@ class _HomePageState extends State { } _initLocalNotifications() { - var initializationSettingsAndroid = - new AndroidInitializationSettings('@mipmap/ic_launcher'); - var initializationSettingsIOS = new IOSInitializationSettings(); - var initializationSettings = new InitializationSettings( - android: initializationSettingsAndroid, iOS: initializationSettingsIOS); - _flutterLocalNotificationsPlugin.initialize(initializationSettings); + // var initializationSettingsAndroid = + // new AndroidInitializationSettings('@mipmap/ic_launcher'); + // var initializationSettingsIOS = new IOSInitializationSettings(); + // var initializationSettings = new InitializationSettings( + // android: initializationSettingsAndroid, iOS: initializationSettingsIOS); + // _flutterLocalNotificationsPlugin.initialize(initializationSettings); } static Future _showNotification(Map message) async { @@ -176,29 +176,29 @@ class _HomePageState extends State { print("AppPushs params pushAction : $action"); // @formatter:off - var platformChannelSpecificsAndroid = new AndroidNotificationDetails( - 'your channel id', 'your channel name', 'your channel description', - playSound: true, - enableVibration: true, - importance: Importance.max, - priority: Priority.high); + // var platformChannelSpecificsAndroid = new AndroidNotificationDetails( + // 'your channel id', 'your channel name', 'your channel description', + // playSound: true, + // enableVibration: true, + // importance: Importance.max, + // priority: Priority.high); // @formatter:on - var platformChannelSpecificsIos = - new IOSNotificationDetails(presentSound: true); - var platformChannelSpecifics = new NotificationDetails( - android: platformChannelSpecificsAndroid, - iOS: platformChannelSpecificsIos); + // var platformChannelSpecificsIos = + // new IOSNotificationDetails(presentSound: true); + // var platformChannelSpecifics = new NotificationDetails( + // android: platformChannelSpecificsAndroid, + // iOS: platformChannelSpecificsIos); - new Future.delayed(Duration.zero, () { - _flutterLocalNotificationsPlugin.show( - 0, - pushTitle, - pushText, - platformChannelSpecifics, - payload: 'No_Sound', - ); - }); + // new Future.delayed(Duration.zero, () { + // _flutterLocalNotificationsPlugin.show( + // 0, + // pushTitle, + // pushText, + // platformChannelSpecifics, + // payload: 'No_Sound', + // ); + // }); } void dispose() { @@ -387,7 +387,7 @@ class _HomePageState extends State { isSelected: languageModel.currentState, selectedBorderColor: Colors.white24, ); - final signinBtn = FlatButton( + final signinBtn = TextButton( onPressed: () { Navigator.of(context) .push(CupertinoPageRoute(builder: (context) => SigninPage())); diff --git a/lib/pages/main/util.dart b/lib/pages/main/util.dart index 5018f59..36044a0 100644 --- a/lib/pages/main/util.dart +++ b/lib/pages/main/util.dart @@ -19,7 +19,7 @@ Future showMsgDialog(BuildContext context, String title, String msg) { title: new Text(title), content: new Text(msg), actions: [ - new FlatButton( + new TextButton( child: new Text("Close"), onPressed: () { Navigator.of(context).pop(); @@ -51,8 +51,10 @@ Future showConfirmDialog( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.center, children: [ - FlatButton( - color: Colors.grey[300], + TextButton( + style: + TextButton.styleFrom(backgroundColor: Colors.grey[300]), + // color: Colors.grey[300], child: Text( AppTranslations.of(context)!.text('btn.cancel'), style: Provider.of(context).isEng @@ -65,8 +67,9 @@ Future showConfirmDialog( SizedBox( width: 0, ), - FlatButton( - color: primaryColor, + TextButton( + style: TextButton.styleFrom(backgroundColor: primaryColor), + // color: primaryColor, child: Text(AppTranslations.of(context)!.text('btn.ok'), style: Provider.of(context).isEng ? TextStyle( @@ -343,7 +346,7 @@ Widget fcsButton(BuildContext context, String text, child: ButtonTheme( minWidth: 900.0, height: 100.0, - child: FlatButton( + child: TextButton( onPressed: callack == null ? null : () => callack(), child: Row( mainAxisAlignment: MainAxisAlignment.center, @@ -371,7 +374,7 @@ String getLocalString(BuildContext context, String key) { } void showToast(GlobalKey key, String text) { - final ScaffoldState scaffold = key.currentState as ScaffoldState; + final ScaffoldMessengerState scaffold = key.currentState as ScaffoldMessengerState; scaffold.showSnackBar( SnackBar( content: Text(text), diff --git a/lib/pages/main/welcome_page.dart b/lib/pages/main/welcome_page.dart index c7ca5e5..00a8b6e 100644 --- a/lib/pages/main/welcome_page.dart +++ b/lib/pages/main/welcome_page.dart @@ -83,7 +83,7 @@ class _WelcomePageState extends State { onPressed: _langChange, isSelected: isSelected, ), - FlatButton( + TextButton( onPressed: () { Navigator.of(context).push(CupertinoPageRoute( builder: (context) => SigninPage())); diff --git a/lib/pages/market/market_editor.dart b/lib/pages/market/market_editor.dart index 9efdd9e..c6c8b23 100644 --- a/lib/pages/market/market_editor.dart +++ b/lib/pages/market/market_editor.dart @@ -166,12 +166,12 @@ class _MarketEditorState extends State { ], ), actions: [ - new FlatButton( + new TextButton( child: LocalText(context, "btn.cancel", color: primaryColor), onPressed: () { Navigator.pop(context); }), - new FlatButton( + new TextButton( child: LocalText( context, "btn.save", diff --git a/lib/pages/payment_methods/payment_method_page.dart b/lib/pages/payment_methods/payment_method_page.dart index 0fb95e2..3f0ce64 100644 --- a/lib/pages/payment_methods/payment_method_page.dart +++ b/lib/pages/payment_methods/payment_method_page.dart @@ -21,7 +21,7 @@ class PaymentMethodPage extends StatefulWidget { } class _PaymentMethodPageState extends State { - GlobalKey key = GlobalKey(); + GlobalKey key = GlobalKey(); bool _isLoading = false; @override Widget build(BuildContext context) { @@ -153,7 +153,8 @@ class _PaymentMethodPageState extends State { } void _showToast(String title) { - final ScaffoldState scaffold = key.currentState as ScaffoldState; + final ScaffoldMessengerState scaffold = + key.currentState as ScaffoldMessengerState; scaffold.showSnackBar( SnackBar( content: Text('copied "$title" data to clipboard'), diff --git a/lib/pages/profile/profile_page.dart b/lib/pages/profile/profile_page.dart index 4fd30a5..64eec41 100644 --- a/lib/pages/profile/profile_page.dart +++ b/lib/pages/profile/profile_page.dart @@ -31,7 +31,7 @@ class Profile extends StatefulWidget { } class _ProfileState extends State { - GlobalKey key = GlobalKey(); + GlobalKey key = GlobalKey(); bool _isLoading = false; String? selectedLanguage; TextEditingController bizNameController = new TextEditingController(); @@ -275,7 +275,8 @@ class _ProfileState extends State { } _showToast(String title) { - final ScaffoldState scaffold = key.currentState as ScaffoldState; + final ScaffoldMessengerState scaffold = + key.currentState as ScaffoldMessengerState; scaffold.showSnackBar( SnackBar( content: Text('copied "$title" data to clipboard'), @@ -302,7 +303,8 @@ class _ProfileState extends State { }); try { await context.read().signout(); - } catch (e) {} finally { + } catch (e) { + } finally { Future.delayed(Duration(seconds: 1), () { if (mounted) { setState(() { diff --git a/lib/pages/rates/shipment_rates_calculate.dart b/lib/pages/rates/shipment_rates_calculate.dart index c722c86..c895f02 100644 --- a/lib/pages/rates/shipment_rates_calculate.dart +++ b/lib/pages/rates/shipment_rates_calculate.dart @@ -53,9 +53,9 @@ class _ShipmentRatesCalState extends State { _calShipmentWeight() { Rate rate = Provider.of(context, listen: false).rate; - double l = double.parse(_lengthController.text, (s) => 0); - double w = double.parse(_widthController.text, (s) => 0); - double h = double.parse(_heightController.text, (s) => 0); + double l = double.parse(_lengthController.text); + double w = double.parse(_widthController.text); + double h = double.parse(_heightController.text); _cargoType.weight = double.tryParse(_actualWeightCtl.text) ?? 0; Carton box = Carton(cargoTypes: [_cargoType], length: l, width: w, height: h); diff --git a/lib/pages/shipment/shipment_box_editor.dart b/lib/pages/shipment/shipment_box_editor.dart index f5b8c91..8270da6 100644 --- a/lib/pages/shipment/shipment_box_editor.dart +++ b/lib/pages/shipment/shipment_box_editor.dart @@ -72,9 +72,9 @@ class _ShipmentBoxEditorState extends State { } _calShipmentWeight() { - double l = double.parse(_lengthCtl.text, (s) => 0); - double w = double.parse(_widthCtl.text, (s) => 0); - double h = double.parse(_heightCtl.text, (s) => 0); + double l = double.parse(_lengthCtl.text); + double w = double.parse(_widthCtl.text); + double h = double.parse(_heightCtl.text); setState(() { shipmentWeight = (l * w * h / volumetricRatio).ceilToDouble(); }); @@ -296,9 +296,9 @@ class _ShipmentBoxEditorState extends State { } _creatCarton() { - double l = double.parse(_lengthCtl.text, (s) => 0); - double w = double.parse(_widthCtl.text, (s) => 0); - double h = double.parse(_heightCtl.text, (s) => 0); + double l = double.parse(_lengthCtl.text); + double w = double.parse(_widthCtl.text); + double h = double.parse(_heightCtl.text); _box!.length = l; _box!.width = w; _box!.height = h; diff --git a/lib/pages/signin/invitation_request_page.dart b/lib/pages/signin/invitation_request_page.dart index 8099283..3fe329b 100644 --- a/lib/pages/signin/invitation_request_page.dart +++ b/lib/pages/signin/invitation_request_page.dart @@ -90,7 +90,7 @@ class _RequestInvitationPageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - RaisedButton( + ElevatedButton( onPressed: _request, child: Text(getLocalString(context, "invite.request")), ) diff --git a/lib/pages/signin/sms_code_page.dart b/lib/pages/signin/sms_code_page.dart index 73ef48e..8fc50c3 100644 --- a/lib/pages/signin/sms_code_page.dart +++ b/lib/pages/signin/sms_code_page.dart @@ -128,19 +128,29 @@ class _SmsCodePageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - RaisedButton( + ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: + canResend ? Colors.white : Colors.grey, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + side: BorderSide( + color: canResend + ? primaryColor + : Colors.grey.shade400))), onPressed: canResend ? _resend : null, - color: canResend ? Colors.white : Colors.grey, + // color: canResend ? Colors.white : Colors.grey, child: LocalText(context, 'sms.resend', fontSize: 16, - color: - canResend ? primaryColor : Colors.grey.shade400), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - side: BorderSide( - color: canResend - ? primaryColor - : Colors.grey.shade400)), + color: canResend + ? primaryColor + : Colors.grey.shade400), + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(10.0), + // side: BorderSide( + // color: canResend + // ? primaryColor + // : Colors.grey.shade400)), ), InkWell( onTap: allNumberEntered ? _verify : null, diff --git a/lib/pages/widgets/dialog_input.dart b/lib/pages/widgets/dialog_input.dart index c1c0a4a..708ee05 100644 --- a/lib/pages/widgets/dialog_input.dart +++ b/lib/pages/widgets/dialog_input.dart @@ -58,7 +58,7 @@ class _DialogInputState extends State { ), ), actions: [ - FlatButton( + TextButton( child: LocalText( context, 'btn.cancel', @@ -68,8 +68,9 @@ class _DialogInputState extends State { _controller.clear(); Navigator.of(context).pop(); }), - FlatButton( - color: primaryColor, + TextButton( + style: TextButton.styleFrom(backgroundColor: primaryColor), + // color: primaryColor, child: LocalText( context, 'btn.ok', diff --git a/lib/pages/widgets/fcs_expansion_tile.dart b/lib/pages/widgets/fcs_expansion_tile.dart index e1d31eb..633e305 100644 --- a/lib/pages/widgets/fcs_expansion_tile.dart +++ b/lib/pages/widgets/fcs_expansion_tile.dart @@ -32,7 +32,9 @@ class _FcsExpansionTileState extends State { Widget build(BuildContext context) { return Theme( data: ThemeData( - accentColor: primaryColor, dividerColor: Colors.transparent), + dividerColor: Colors.transparent, + colorScheme: + ColorScheme.fromSwatch().copyWith(secondary: primaryColor)), child: ExpansionTile( onExpansionChanged: (value) { setState(() { diff --git a/lib/pages/widgets/length_picker.dart b/lib/pages/widgets/length_picker.dart index 79bbd81..8726dfa 100644 --- a/lib/pages/widgets/length_picker.dart +++ b/lib/pages/widgets/length_picker.dart @@ -42,7 +42,7 @@ class _LengthPickerState extends State { } _setText() { - double v = double.parse(widget.controller!.text, (s) => 0); + double v = double.parse(widget.controller!.text); int _v = v.toInt(); int f = (v / 12).floor(); @@ -107,7 +107,7 @@ class _LengthPickerDialogState extends State { _valueFeet = 0; _valueInc = 0; if (widget.controller != null) { - double v = double.parse(widget.controller!.text, (s) => 0); + double v = double.parse(widget.controller!.text); _valueFeet = (v / 12).floor(); _valueInc = widget.displayFeet! ? (v % 12).toInt() : v.toInt(); inchInputController.text = _valueInc.toString(); diff --git a/lib/pages/widgets/local_button.dart b/lib/pages/widgets/local_button.dart index 8c52eb2..f96c25e 100644 --- a/lib/pages/widgets/local_button.dart +++ b/lib/pages/widgets/local_button.dart @@ -32,7 +32,7 @@ class LocalButton extends StatelessWidget { child: ButtonTheme( minWidth: 900.0, height: 100.0, - child: FlatButton( + child: TextButton( onPressed: callBack == null ? null : () => callBack!(), child: Row( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/pages/widgets/multi_img_file.dart b/lib/pages/widgets/multi_img_file.dart index f2e1bb6..55ee1a8 100644 --- a/lib/pages/widgets/multi_img_file.dart +++ b/lib/pages/widgets/multi_img_file.dart @@ -176,7 +176,7 @@ class _MultiImageFileState extends State { } _openImagePicker(bool camera) async { - var selectedFile = await ImagePicker().getImage( + var selectedFile = await ImagePicker().pickImage( source: camera ? ImageSource.camera : ImageSource.gallery, imageQuality: 80, maxWidth: 1000); @@ -213,7 +213,7 @@ class _MultiImageFileState extends State { await _dialog( context, () => camera = true, () => gallery = true); if (camera || gallery) { - var selectedFile = await ImagePicker().getImage( + var selectedFile = await ImagePicker().pickImage( source: camera ? ImageSource.camera : ImageSource.gallery, imageQuality: 80, maxWidth: 1000); diff --git a/lib/pages/widgets/my_data_table.dart b/lib/pages/widgets/my_data_table.dart index f198e21..f44e089 100644 --- a/lib/pages/widgets/my_data_table.dart +++ b/lib/pages/widgets/my_data_table.dart @@ -773,20 +773,20 @@ class TableRowInkWell extends InkResponse { RectCallback getRectCallback(RenderBox referenceBox) { return () { RenderObject cell = referenceBox; - AbstractNode? table = cell.parent; + RenderObject? table = cell.parent; final Matrix4 transform = Matrix4.identity(); while (table is RenderObject && table is! RenderTable) { - final RenderObject parentBox = table as RenderObject; + final RenderObject parentBox = table; parentBox.applyPaintTransform(cell, transform); assert(table == cell.parent); cell = parentBox; - table = table.parent; + table = table?.parent; } if (table is RenderTable) { final TableCellParentData cellParentData = cell.parentData as TableCellParentData; assert(cellParentData.y != null); - final Rect rect = table.getRowBox(cellParentData.y!); + final Rect rect = table .getRowBox(cellParentData.y!); // The rect is in the table's coordinate space. We need to change it to the // TableRowInkWell's coordinate space. table.applyPaintTransform(cell, transform); diff --git a/pubspec.yaml b/pubspec.yaml index 4211a6e..b246aed 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,46 +13,47 @@ dependencies: sdk: flutter cupertino_icons: ^1.0.3 - firebase_core: ^1.6.0 - cloud_firestore: ^2.5.2 - firebase_storage: ^10.0.3 - firebase_auth: ^3.1.1 - firebase_messaging: ^10.0.7 + + firebase_core: ^2.17.0 + firebase_auth: ^4.10.1 + cloud_firestore: ^4.9.3 + firebase_storage: ^11.5.6 + firebase_messaging: ^14.6.9 provider: ^6.0.0 - image_picker: ^0.8.3+3 + image_picker: ^1.0.6 shared_preferences: ^2.0.7 progress: path: ../mokkon-flutter/packages/progress flutter_datetime_picker: ^1.5.1 - dio: ^4.0.0 + dio: ^5.4.0 package_info: ^2.0.2 - google_api_availability: ^3.0.1 - intl: ^0.17.0 - font_awesome_flutter: ^9.1.0 - photo_view: ^0.12.0 - uuid: ^3.0.4 + google_api_availability: ^5.0.0 + intl: ^0.18.1 + font_awesome_flutter: ^10.6.0 + photo_view: ^0.14.0 + uuid: ^4.2.2 zefyrka: ^1.0.10 path_provider: ^2.0.2 - camera: ^0.9.0 + camera: ^0.10.5+8 url_launcher: ^6.0.9 device_info: ^2.0.2 connectivity: ^3.0.6 logging: ^1.0.1 - permission_handler: ^8.1.4+2 - country_code_picker: ^2.0.2 + permission_handler: ^11.1.0 + country_code_picker: ^3.0.0 pin_input_text_field: ^4.1.0 flutter_icons_null_safety: ^1.1.0 country_icons: ^2.0.2 timeline_list: ^0.0.5 barcode_scan2: ^4.1.4 flutter_pdfview: ^1.2.1 - flutter_local_notifications: ^8.2.0 + flutter_local_notifications: ^16.3.0 share: ^2.0.4 cached_network_image: ^3.1.0 flutter_cache_manager: ^3.1.2 - flutter_vector_icons: ^1.0.0 + flutter_vector_icons: ^2.0.0 dev_dependencies: flutter_test: