Browse Source

更新依赖

boyrobot 8 months ago
parent
commit
5110a6fbfa

+ 0 - 1
lib/pages/home_page.dart

@@ -1,6 +1,5 @@
 import 'package:flutter/material.dart';
 import 'package:flutter_habit/common/BaseArchitectural.dart';
-import 'package:flutter_habit/common/I18N.dart';
 import 'package:flutter_habit/provider/UserProvider.dart';
 import 'package:flutter_habit/view/context/ExerciseInfoContext.dart';
 import 'package:flutter_habit/view/context/LifeInfoContext.dart';

+ 1 - 1
lib/view/context/LifeInfoContext.dart

@@ -131,7 +131,7 @@ class LifeInfoContextService extends BaseProvider {
 class _LifeInfoContextView extends StatelessWidget {
   @override
   Widget build(BuildContext context) {
-    LifeInfoContextService service =
+    // LifeInfoContextService service =
         Provider.of<LifeInfoContextService>(context, listen: false);
     return ListView(
       children: <Widget>[

+ 29 - 29
lib/view/context/widget/DateTimeMultiLineChart.dart

@@ -23,9 +23,9 @@ class DateTimeMultiLineChart extends StatelessWidget {
         // 圆滑
         isCurved: size > 7,
         // 线条颜色
-        colors: [
+        color: 
           Provider.of<ThemeProvider>(context, listen: false).otherColors[i]
-        ],
+        ,
         // 线条宽度
         barWidth: 3,
         // 起点和终点是否圆滑
@@ -33,15 +33,15 @@ class DateTimeMultiLineChart extends StatelessWidget {
         // 点配置
         dotData: FlDotData(
           show: size < 30,
-          getDotColor: (spot, percent, barData) =>
-              Provider.of<ThemeProvider>(context, listen: false).otherColors[i],
-          dotSize: 3,
+          // getDotColor: (spot, percent, barData) =>
+          //     Provider.of<ThemeProvider>(context, listen: false).otherColors[i],
+          // dotSize: 3,
         ),
         belowBarData: BarAreaData(
           show: false,
-          colors: [
+          color: 
             Theme.of(context).colorScheme.secondary.withOpacity(0.1 / (i + 1))
-          ],
+          ,
         ),
       );
       i = (i + 1) % (themeColors.length - 1);
@@ -129,7 +129,7 @@ class DateTimeMultiLineChart extends StatelessWidget {
                 padding: EdgeInsets.only(top: 20, left: 10, right: 20),
                 child: LineChart(
                   LineChartData(
-                    clipToBorder: true,
+                    // clipToBorder: true,
                     // 边框信息
                     borderData: FlBorderData(
                       show: true,
@@ -179,37 +179,37 @@ class DateTimeMultiLineChart extends StatelessWidget {
                     titlesData: FlTitlesData(
                       show: true,
                       // 下方文字
-                      bottomTitles: SideTitles(
+                      bottomTitles: AxisTitles(
                         // 每隔几个显示一个底部标签
-                        interval: xInterval,
-                        showTitles: true,
+                        // inte、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、rval: xInterval,
+                        // showTitles: true,
                         // 文字与图表上边界距离
 //          margin: 8,
                         // 文字预留空间
 //          reservedSize: 22,
-                        textStyle: Theme.of(context).textTheme.bodyMedium,
-                        getTitles: (value) {
-                          DateTime dateTime =
-                              ConvertUtils.dateTimeOfLocalDaysSinceEpoch(value);
-                          return "${dateTime.month}-${dateTime.day}";
-                        },
+                        // textStyle: Theme.of(context).textTheme.bodyMedium,
+                        // getTitles: (value) {
+                        //   DateTime dateTime =
+                        //       ConvertUtils.dateTimeOfLocalDaysSinceEpoch(value);
+                        //   return "${dateTime.month}-${dateTime.day}";
+                        // },
                       ),
-                      leftTitles: SideTitles(
+                      leftTitles: AxisTitles(
                         // 每隔几个显示一个左侧标签
-                        interval: yInterval,
-                        showTitles: true,
+                        // interval: yInterval,
+                        // showTitles: true,
                         // 文字与图表左边界距离
 //          margin: 8,
                         // 文字预留空间
-                        reservedSize: 30,
-                        textStyle: Theme.of(context).textTheme.bodyMedium,
-                        getTitles: (value) {
-                          int hour = 24 - value.floor();
-                          if (hour < 10) {
-                            return "0$hour:00";
-                          }
-                          return "$hour:00";
-                        },
+                        // reservedSize: 30,
+                        // textStyle: Theme.of(context).textTheme.bodyMedium,
+                        // getTitles: (value) {
+                        //   int hour = 24 - value.floor();
+                        //   if (hour < 10) {
+                        //     return "0$hour:00";
+                        //   }
+                        //   return "$hour:00";
+                        // },
                       ),
                     ),
                     // 各轴显示的最值 (不设置则缩放)

+ 25 - 25
lib/view/context/widget/DateValueMultiLineChart.dart

@@ -23,9 +23,9 @@ class DateValueMultiLineChart extends StatelessWidget {
         // 圆滑
         isCurved: size > 7,
         // 线条颜色
-        colors: [
+        color: 
           Provider.of<ThemeProvider>(context, listen: false).otherColors[i]
-        ],
+        ,
         // 线条宽度
         barWidth: 3,
         // 起点和终点是否圆滑
@@ -33,15 +33,15 @@ class DateValueMultiLineChart extends StatelessWidget {
         // 点配置
         dotData: FlDotData(
           show: size < 30,
-          getDotColor: (spot, percent, barData) =>
-              Provider.of<ThemeProvider>(context, listen: false).otherColors[i],
-          dotSize: 3,
+          // getDotColor: (spot, percent, barData) =>
+          //     Provider.of<ThemeProvider>(context, listen: false).otherColors[i],
+          // dotSize: 3,
         ),
         belowBarData: BarAreaData(
           show: false,
-          colors: [
+          color: 
             Theme.of(context).colorScheme.secondary.withOpacity(0.1 / (i + 1))
-          ],
+          ,
         ),
       );
       i = (i + 1) % (themeColors.length - 1);
@@ -141,7 +141,7 @@ class DateValueMultiLineChart extends StatelessWidget {
                 padding: EdgeInsets.only(top: 20, left: 10, right: 20),
                 child: LineChart(
                   LineChartData(
-                    clipToBorder: true,
+                    // clipToBorder: true,
                     // 边框信息
                     borderData: FlBorderData(
                       show: true,
@@ -191,33 +191,33 @@ class DateValueMultiLineChart extends StatelessWidget {
                     titlesData: FlTitlesData(
                       show: true,
                       // 下方文字
-                      bottomTitles: SideTitles(
+                      bottomTitles: AxisTitles(
                         // 每隔几个显示一个底部标签
-                        interval: xInterval,
-                        showTitles: true,
+                        // interval: xInterval,
+                        // showTitles: true,
                         // 文字与图表上边界距离
 //          margin: 8,
                         // 文字预留空间
 //          reservedSize: 22,
-                        textStyle: Theme.of(context).textTheme.bodyMedium,
-                        getTitles: (value) {
-                          DateTime dateTime =
-                              ConvertUtils.dateTimeOfLocalDaysSinceEpoch(value);
-                          return "${dateTime.month}-${dateTime.day}";
-                        },
+                        // textStyle: Theme.of(context).textTheme.bodyMedium,
+                        // getTitles: (value) {
+                        //   DateTime dateTime =
+                        //       ConvertUtils.dateTimeOfLocalDaysSinceEpoch(value);
+                        //   return "${dateTime.month}-${dateTime.day}";
+                        // },
                       ),
-                      leftTitles: SideTitles(
+                      leftTitles: AxisTitles(
                         // 每隔几个显示一个左侧标签
-                        interval: yInterval,
-                        showTitles: true,
+                        // interval: yInterval,
+                        // showTitles: true,
                         // 文字与图表左边界距离
 //          margin: 8,
                         // 文字预留空间
-                        reservedSize: ConvertUtils.fixedDouble(maxY, 1).toString().length * 6.5,
-                        textStyle: Theme.of(context).textTheme.bodyMedium,
-                        getTitles: (value) {
-                          return ConvertUtils.fixedDouble(value, 1).toString();
-                        },
+                        // reservedSize: ConvertUtils.fixedDouble(maxY, 1).toString().length * 6.5,
+                        // textStyle: Theme.of(context).textTheme.bodyMedium,
+                        // getTitles: (value) {
+                        //   return ConvertUtils.fixedDouble(value, 1).toString();
+                        // },
                       ),
                     ),
                     // 各轴显示的最值 (不设置则缩放)

+ 28 - 28
lib/view/context/widget/DateValueSingleLineChart.dart

@@ -95,7 +95,7 @@ class DateValueSingleLineChart extends StatelessWidget {
                 padding: EdgeInsets.only(top: 20, left: 10, right: 20),
                 child: LineChart(
                   LineChartData(
-                    clipToBorder: true,
+                    // clipToBorder: true,
                     // 边框信息
                     borderData: FlBorderData(
                       show: true,
@@ -140,37 +140,37 @@ class DateValueSingleLineChart extends StatelessWidget {
                     titlesData: FlTitlesData(
                       show: true,
                       // 下方文字
-                      bottomTitles: SideTitles(
+                      bottomTitles: AxisTitles(
                         // 每隔几个显示一个底部标签
-                        interval: xInterval,
-                        showTitles: true,
+                        // interval: xInterval,
+                        // showTitles: true,
                         // 文字与图表上边界距离
-                        margin: 8,
+                        // margin: 8,
                         // 文字预留空间
 //          reservedSize: 22,
-                        textStyle: Theme.of(context).textTheme.bodyMedium,
-                        getTitles: (value) {
-                          DateTime dateTime =
-                              ConvertUtils.dateTimeOfLocalDaysSinceEpoch(value);
-                          return "${dateTime.month}-${dateTime.day}";
-                        },
+                        // textStyle: Theme.of(context).textTheme.bodyMedium,
+                        // getTitles: (value) {
+                        //   DateTime dateTime =
+                        //       ConvertUtils.dateTimeOfLocalDaysSinceEpoch(value);
+                        //   return "${dateTime.month}-${dateTime.day}";
+                        // },
                       ),
-                      leftTitles: SideTitles(
+                      leftTitles: AxisTitles(
                         // 每隔几个显示一个左侧标签
-                        interval: yInterval,
-                        showTitles: true,
+                        // interval: yInterval,
+                        // showTitles: true,
                         // 文字与图表左边界距离
 //          margin: 8,
                         // 文字预留空间
-                        reservedSize: ConvertUtils.fixedDouble(maxY, 1)
-                                .toString()
-                                .length *
-                            6.5,
+                        // reservedSize: ConvertUtils.fixedDouble(maxY, 1)
+                        //         .toString()
+                        //         .length *
+                        //     6.5,
 //                        rotateAngle: -20,
-                        textStyle: Theme.of(context).textTheme.bodyMedium,
-                        getTitles: (value) {
-                          return ConvertUtils.fixedDouble(value, 1).toString();
-                        },
+                        // textStyle: Theme.of(context).textTheme.bodyMedium,
+                        // getTitles: (value) {
+                        //   return ConvertUtils.fixedDouble(value, 1).toString();
+                        // },
                       ),
                     ),
                     // 各轴显示的最值 (不设置则缩放)
@@ -186,7 +186,7 @@ class DateValueSingleLineChart extends StatelessWidget {
                         // 圆滑
                         isCurved: size > 7,
                         // 线条颜色
-                        colors: [Theme.of(context).colorScheme.secondary],
+                        color: Theme.of(context).colorScheme.secondary,
                         // 线条宽度
                         barWidth: 3,
                         // 起点和终点是否圆滑
@@ -194,19 +194,19 @@ class DateValueSingleLineChart extends StatelessWidget {
                         // 点配置
                         dotData: FlDotData(
                           show: size < 30,
-                          getDotColor: (spot, percent, barData) =>
-                              Theme.of(context).colorScheme.secondary,
-                          dotSize: 3,
+                          // getDotColor: (spot, percent, barData) =>
+                          //     Theme.of(context).colorScheme.secondary,
+                          // dotSize: 3,
                         ),
                         // 线下方填充
                         belowBarData: BarAreaData(
                           show: true,
-                          colors: [
+                          color: 
                             Theme.of(context)
                                 .colorScheme
                                 .secondary
                                 .withOpacity(0.3)
-                          ],
+                          ,
                         ),
                       ),
                     ],

+ 8 - 9
lib/view/drawer/user/setting/UserSettingPage.dart

@@ -36,7 +36,6 @@ class UserSettingPageModel extends BaseModel {
 
   @override
   void init(BuildContext context) {
-    
     super.init(context);
     isRequesting = false;
   }
@@ -128,10 +127,10 @@ class UserSettingPageService extends BaseProvider {
   }
 
   Future<List<int>> takePhoto(BuildContext context) async {
-    File file = await ImagePicker.pickImage(source: ImageSource.camera);
-    if (file != null) {
-      List<int> res = await Navigator.of(context)
-          .push(MaterialPageRoute(builder: (_) => CropImagePage(file)));
+    XFile xfile = await ImagePicker().pickImage(source: ImageSource.camera);
+    if (xfile != null) {
+      List<int> res = await Navigator.of(context).push(
+          MaterialPageRoute(builder: (_) => CropImagePage(File(xfile.path))));
       if (res != null && res.isNotEmpty) {
         return res;
       }
@@ -140,10 +139,10 @@ class UserSettingPageService extends BaseProvider {
   }
 
   Future<List<int>> pickPhoto(BuildContext context) async {
-    File file = await ImagePicker.pickImage(source: ImageSource.gallery);
-    if (file != null) {
-      List<int> res = await Navigator.of(context)
-          .push(MaterialPageRoute(builder: (_) => CropImagePage(file)));
+    XFile xfile = await ImagePicker().pickImage(source: ImageSource.gallery);
+    if (xfile != null) {
+      List<int> res = await Navigator.of(context).push(
+          MaterialPageRoute(builder: (_) => CropImagePage(File(xfile.path))));
       if (res != null && res.isNotEmpty) {
         return res;
       }

+ 114 - 26
pubspec.lock

@@ -85,10 +85,10 @@ packages:
     dependency: transitive
     description:
       name: equatable
-      sha256: "8007a033720c056066dd1dc20bc2934cac91e271f0408c578aa26c7731618a03"
+      sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2
       url: "https://pub.dev"
     source: hosted
-    version: "1.2.6"
+    version: "2.0.5"
   fake_async:
     dependency: transitive
     description:
@@ -113,14 +113,46 @@ packages:
       url: "https://pub.dev"
     source: hosted
     version: "6.1.4"
+  file_selector_linux:
+    dependency: transitive
+    description:
+      name: file_selector_linux
+      sha256: "770eb1ab057b5ae4326d1c24cc57710758b9a46026349d021d6311bd27580046"
+      url: "https://pub.dev"
+    source: hosted
+    version: "0.9.2"
+  file_selector_macos:
+    dependency: transitive
+    description:
+      name: file_selector_macos
+      sha256: "4ada532862917bf16e3adb3891fe3a5917a58bae03293e497082203a80909412"
+      url: "https://pub.dev"
+    source: hosted
+    version: "0.9.3+1"
+  file_selector_platform_interface:
+    dependency: transitive
+    description:
+      name: file_selector_platform_interface
+      sha256: "412705a646a0ae90f33f37acfae6a0f7cbc02222d6cd34e479421c3e74d3853c"
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.6.0"
+  file_selector_windows:
+    dependency: transitive
+    description:
+      name: file_selector_windows
+      sha256: "1372760c6b389842b77156203308940558a2817360154084368608413835fc26"
+      url: "https://pub.dev"
+    source: hosted
+    version: "0.9.3"
   fl_chart:
     dependency: "direct main"
     description:
       name: fl_chart
-      sha256: "06546ca1befe340be717b03a5a5497b072d88c6c6609e12b0e36d20bd7e5151a"
+      sha256: "48a1b69be9544e2b03d9a8e843affd89e43f3194c9248776222efcb4206bb1ec"
       url: "https://pub.dev"
     source: hosted
-    version: "0.9.4"
+    version: "0.62.0"
   flutter:
     dependency: "direct main"
     description: flutter
@@ -194,10 +226,10 @@ packages:
     dependency: transitive
     description:
       name: flutter_plugin_android_lifecycle
-      sha256: f64fc84e913a3c225588724c811f5f6600562d17fc6f6cea7fda264fc93361ae
+      sha256: "950e77c2bbe1692bc0874fc7fb491b96a4dc340457f4ea1641443d0a6c1ea360"
       url: "https://pub.dev"
     source: hosted
-    version: "1.0.11"
+    version: "2.0.15"
   flutter_test:
     dependency: "direct dev"
     description: flutter
@@ -208,6 +240,14 @@ packages:
     description: flutter
     source: sdk
     version: "0.0.0"
+  http:
+    dependency: transitive
+    description:
+      name: http
+      sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2"
+      url: "https://pub.dev"
+    source: hosted
+    version: "0.13.6"
   http_parser:
     dependency: transitive
     description:
@@ -228,10 +268,66 @@ packages:
     dependency: "direct main"
     description:
       name: image_picker
-      sha256: be333e667b7aa5606a7f0a22a8c7cc2286b0a8bf6ac977f7b8a48d650282e201
+      sha256: "841837258e0b42c80946c43443054fc726f5e8aa84a97f363eb9ef0d45b33c14"
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.0.2"
+  image_picker_android:
+    dependency: transitive
+    description:
+      name: image_picker_android
+      sha256: "8179b54039b50eee561676232304f487602e2950ffb3e8995ed9034d6505ca34"
+      url: "https://pub.dev"
+    source: hosted
+    version: "0.8.7+4"
+  image_picker_for_web:
+    dependency: transitive
+    description:
+      name: image_picker_for_web
+      sha256: "8b6c160cdbe572199103a091c783685b236110e4a0fd7a4947f32ff5b7da8765"
+      url: "https://pub.dev"
+    source: hosted
+    version: "3.0.0"
+  image_picker_ios:
+    dependency: transitive
+    description:
+      name: image_picker_ios
+      sha256: b3e2f21feb28b24dd73a35d7ad6e83f568337c70afab5eabac876e23803f264b
+      url: "https://pub.dev"
+    source: hosted
+    version: "0.8.8"
+  image_picker_linux:
+    dependency: transitive
+    description:
+      name: image_picker_linux
+      sha256: "02cbc21fe1706b97942b575966e5fbbeaac535e76deef70d3a242e4afb857831"
+      url: "https://pub.dev"
+    source: hosted
+    version: "0.2.1"
+  image_picker_macos:
+    dependency: transitive
+    description:
+      name: image_picker_macos
+      sha256: cee2aa86c56780c13af2c77b5f2f72973464db204569e1ba2dd744459a065af4
+      url: "https://pub.dev"
+    source: hosted
+    version: "0.2.1"
+  image_picker_platform_interface:
+    dependency: transitive
+    description:
+      name: image_picker_platform_interface
+      sha256: c1134543ae2187e85299996d21c526b2f403854994026d575ae4cf30d7bb2a32
       url: "https://pub.dev"
     source: hosted
-    version: "0.6.5+3"
+    version: "2.9.0"
+  image_picker_windows:
+    dependency: transitive
+    description:
+      name: image_picker_windows
+      sha256: c3066601ea42113922232c7b7b3330a2d86f029f685bba99d82c30e799914952
+      url: "https://pub.dev"
+    source: hosted
+    version: "0.2.1"
   js:
     dependency: transitive
     description:
@@ -272,6 +368,14 @@ packages:
       url: "https://pub.dev"
     source: hosted
     version: "1.8.0"
+  mime:
+    dependency: transitive
+    description:
+      name: mime
+      sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.0.4"
   nested:
     dependency: transitive
     description:
@@ -288,22 +392,6 @@ packages:
       url: "https://pub.dev"
     source: hosted
     version: "1.8.2"
-  path_drawing:
-    dependency: transitive
-    description:
-      name: path_drawing
-      sha256: b3dd74e2210b2b71be3d3098b956dbab853ee43a86918b4bc20c9b9bd49f03f3
-      url: "https://pub.dev"
-    source: hosted
-    version: "0.4.1+1"
-  path_parsing:
-    dependency: transitive
-    description:
-      name: path_parsing
-      sha256: "4e613c811d25f1533c0d05eb2755e21410247b8a13ac7f6cd23c0cecb2ff683d"
-      url: "https://pub.dev"
-    source: hosted
-    version: "0.1.4"
   path_provider_linux:
     dependency: transitive
     description:
@@ -356,10 +444,10 @@ packages:
     dependency: "direct main"
     description:
       name: provider
-      sha256: af58e866ea76fa7d156ea5e6ffa1c28b52dabff5c87fbdf265f7c6adaa7a741d
+      sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f
       url: "https://pub.dev"
     source: hosted
-    version: "4.3.3"
+    version: "6.0.5"
   shared_preferences:
     dependency: "direct main"
     description:

+ 3 - 3
pubspec.yaml

@@ -13,11 +13,11 @@ dependencies:
   flutter_local_notifications: ^15.1.0+1 # 本地消息推送
   shared_preferences: ^2.2.0 # 键值对存储
   dio: ^5.3.0 # 请求
-  fl_chart: ^0.9.4 # 图表
-  image_picker: ^0.6.3+4 # 相机、相册
+  fl_chart: ^0.62.0 # 图表
+  image_picker: ^1.0.2 # 相机、相册
   image_crop: ^0.4.1 # 图片裁剪
   flutter_image_compress: ^2.0.4 # 图片压缩
-  provider: ^4.0.4 # 状态管理
+  provider: ^6.0.5 # 状态管理
   flutter_markdown: ^0.6.15 # markdown
 
   cupertino_icons: ^1.0.5

+ 3 - 0
windows/flutter/generated_plugin_registrant.cc

@@ -6,6 +6,9 @@
 
 #include "generated_plugin_registrant.h"
 
+#include <file_selector_windows/file_selector_windows.h>
 
 void RegisterPlugins(flutter::PluginRegistry* registry) {
+  FileSelectorWindowsRegisterWithRegistrar(
+      registry->GetRegistrarForPlugin("FileSelectorWindows"));
 }

+ 1 - 0
windows/flutter/generated_plugins.cmake

@@ -3,6 +3,7 @@
 #
 
 list(APPEND FLUTTER_PLUGIN_LIST
+  file_selector_windows
 )
 
 list(APPEND FLUTTER_FFI_PLUGIN_LIST