From f05343dbfac66eded02c00c7afccba90bf8cbc21 Mon Sep 17 00:00:00 2001 From: Amos Date: Tue, 15 Oct 2024 18:22:25 +0800 Subject: [PATCH] chore: Flutter 3.24.3, Packages --- CHANGELOG.md | 2 +- README.md | 12 +- android/app/build.gradle | 2 +- android/build.gradle | 6 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/settings.gradle | 11 +- lib/db/database/mood_info.dart | 46 +++++++ lib/db/database/mood_info_category.dart | 30 +++++ lib/db/database/table_mood_info.dart | 44 ------- lib/db/database/table_mood_info_category.dart | 28 ---- lib/db/db.dart | 92 +++++++------- lib/models/config/language_model.dart | 5 +- lib/models/mood/mood_category_model.dart | 5 +- lib/models/mood/mood_model.dart | 69 +++++----- lib/models/statistic/statistic_model.dart | 13 +- lib/services/mood/mood_service.dart | 2 + lib/services/statistic/statistic_service.dart | 2 + lib/views/home/index.dart | 12 +- .../menu_screen/widgets/setting_database.dart | 82 ++++++------ lib/views/mood/index.dart | 118 +++++------------ lib/views/mood/mood_category_select.dart | 12 +- lib/views/mood/mood_content.dart | 6 +- lib/views/statistic/index.dart | 1 - pubspec.lock | 120 +++++++++++------- pubspec.yaml | 18 +-- 25 files changed, 355 insertions(+), 385 deletions(-) create mode 100644 lib/db/database/mood_info.dart create mode 100644 lib/db/database/mood_info_category.dart delete mode 100644 lib/db/database/table_mood_info.dart delete mode 100644 lib/db/database/table_mood_info_category.dart diff --git a/CHANGELOG.md b/CHANGELOG.md index a4fa84d..0d4bcd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # 1.9.10 (Unreleased) -- [升级] Flutter 3.24.0 +- [升级] Flutter 3.24.3 - [升级] Package 升级及适配 - [升级] UniMPSDK 4.15 - [修改] 路由管理 fluro 替换为 go_router diff --git a/README.md b/README.md index e966a1e..f25376d 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@

Mood-Example v1.9.10 - Flutter v3.24.0 - Dart v3.5.0 + Flutter v3.24.3 + Dart v3.5.3 BSD-3-Clause License

@@ -100,12 +100,12 @@ Windows: ``` -[√] Flutter (Channel stable, 3.24.0, on Microsoft Windows [版本 10.0.22621.3007], locale zh-CN) +[√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [版本 10.0.22621.3007], locale zh-CN) [√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) -[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.10.5) -[√] Android Studio (version 2024.1) +[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.11.5) +[√] Android Studio (version 2024.2) [√] IntelliJ IDEA Ultimate Edition (version 2024.2) -[√] VS Code (version 1.92.0) +[√] VS Code (version 1.94.2) ``` macOS: diff --git a/android/app/build.gradle b/android/app/build.gradle index c37c8c8..825a296 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -8,7 +8,7 @@ plugins { android { namespace = "com.example.moodexample" compileSdk = flutter.compileSdkVersion - ndkVersion = flutter.ndkVersion + ndkVersion = "25.1.8937393" compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 diff --git a/android/build.gradle b/android/build.gradle index 549140d..d2ffbff 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,9 +1,7 @@ allprojects { repositories { - // google() - // mavenCentral() - maven{ url "https://maven.aliyun.com/repository/public" } - maven{ url "https://maven.aliyun.com/repository/google" } + google() + mavenCentral() } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index e1ca574..559efb4 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip diff --git a/android/settings.gradle b/android/settings.gradle index 3b11d24..91bc9cc 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -10,18 +10,15 @@ pluginManagement { includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") repositories { - // google() - // mavenCentral() - // gradlePluginPortal() - maven{ url "https://maven.aliyun.com/repository/public" } - maven{ url "https://maven.aliyun.com/repository/google" } - maven{ url "https://maven.aliyun.com/repository/gradle-plugin" } + google() + mavenCentral() + gradlePluginPortal() } } plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false + id "com.android.application" version "8.3.2" apply false id "org.jetbrains.kotlin.android" version "1.7.10" apply false } diff --git a/lib/db/database/mood_info.dart b/lib/db/database/mood_info.dart new file mode 100644 index 0000000..4f9b9c8 --- /dev/null +++ b/lib/db/database/mood_info.dart @@ -0,0 +1,46 @@ +/// 心情详细内容表 +class MoodInfo { + const MoodInfo._(); + + /// 表名称 + static const String tableName = 'mood_info'; + + /// 字段名 + + /// 心情ID + static const String mood_id = 'mood_id'; + + /// 图标 + static const String icon = 'icon'; + + /// 心情(标题) + static const String title = 'title'; + + /// 心情程度分数 + static const String score = 'score'; + + /// 心情内容 + static const String content = 'content'; + + /// 创建时间 + static const String create_time = 'create_time'; + + /// 修改时间 + static const String update_time = 'update_time'; + + /// 删除数据库 + static const String dropTable = 'DROP TABLE IF EXISTS $tableName'; + + /// 创建数据库 + static const String createTable = ''' + CREATE TABLE $tableName ( + $mood_id INTEGER PRIMARY KEY, + $icon TEXT NOT NULL, + $title TEXT NOT NULL, + $score INT NOT NULL, + $content TEXT NULL, + $create_time TEXT NOT NULL, + $update_time TEXT NOT NULL + ); + '''; +} diff --git a/lib/db/database/mood_info_category.dart b/lib/db/database/mood_info_category.dart new file mode 100644 index 0000000..20fbf7b --- /dev/null +++ b/lib/db/database/mood_info_category.dart @@ -0,0 +1,30 @@ +/// 心情类别表 +class MoodInfoCategory { + const MoodInfoCategory._(); + + /// 表名称 + static const String tableName = 'mood_info_category'; + + /// 字段名 + + /// 类别ID + static const String category_id = 'category_id'; + + /// 类别图标 + static const String icon = 'icon'; + + /// 类别名称标题 + static const String title = 'title'; + + /// 删除数据库 + static const String dropTable = 'DROP TABLE IF EXISTS $tableName'; + + /// 创建数据库 + static const String createTable = ''' + CREATE TABLE $tableName ( + $category_id INTEGER PRIMARY KEY, + $icon TEXT NOT NULL, + $title TEXT NOT NULL + ); + '''; +} diff --git a/lib/db/database/table_mood_info.dart b/lib/db/database/table_mood_info.dart deleted file mode 100644 index d4db6aa..0000000 --- a/lib/db/database/table_mood_info.dart +++ /dev/null @@ -1,44 +0,0 @@ -/// 心情详细内容表 -class TableMoodInfo { - /// 表名称 - static const String tableName = 'mood_info'; - - /// 字段名 - - /// 心情ID - static const String fieldMoodId = 'moodId'; - - /// 图标 - static const String fieldIcon = 'icon'; - - /// 心情(标题) - static const String fieldTitle = 'title'; - - /// 心情程度分数 - static const String fieldScore = 'score'; - - /// 心情内容 - static const String fieldContent = 'content'; - - /// 创建时间 - static const String fieldCreateTime = 'createTime'; - - /// 修改时间 - static const String fieldUpdateTime = 'updateTime'; - - /// 删除数据库 - final String dropTable = 'DROP TABLE IF EXISTS $tableName'; - - /// 创建数据库 - final String createTable = ''' - CREATE TABLE $tableName ( - $fieldMoodId INTEGER PRIMARY KEY, - $fieldIcon TEXT, - $fieldTitle TEXT, - $fieldScore INT, - $fieldContent TEXT, - $fieldCreateTime VARCHAR(40), - $fieldUpdateTime VARCHAR(40) - ); - '''; -} diff --git a/lib/db/database/table_mood_info_category.dart b/lib/db/database/table_mood_info_category.dart deleted file mode 100644 index 6ce0164..0000000 --- a/lib/db/database/table_mood_info_category.dart +++ /dev/null @@ -1,28 +0,0 @@ -/// 心情类别表 -class TableMoodInfoCategory { - /// 表名称 - static const String tableName = 'mood_info_category'; - - /// 字段名 - - /// 类别ID - static const String fieldCategoryId = 'categoryId'; - - /// 类别图标 - static const String fieldIcon = 'icon'; - - /// 类别名称标题 - static const String fieldTitle = 'title'; - - /// 删除数据库 - final String dropTable = 'DROP TABLE IF EXISTS $tableName'; - - /// 创建数据库 - final String createTable = ''' - CREATE TABLE $tableName ( - $fieldCategoryId INTEGER PRIMARY KEY, - $fieldIcon TEXT, - $fieldTitle TEXT - ); - '''; -} diff --git a/lib/db/db.dart b/lib/db/db.dart index 496c434..213d55d 100644 --- a/lib/db/db.dart +++ b/lib/db/db.dart @@ -4,8 +4,8 @@ import 'package:path/path.dart'; import 'package:moodexample/models/mood/mood_category_model.dart'; import 'package:moodexample/models/mood/mood_model.dart'; -import 'package:moodexample/db/database/table_mood_info.dart'; -import 'package:moodexample/db/database/table_mood_info_category.dart'; +import 'database/mood_info.dart'; +import 'database/mood_info_category.dart'; class DB { DB._(); @@ -40,14 +40,13 @@ class DB { final batch = db.batch(); /// 心情详细内容表 - final tableMoodInfo = TableMoodInfo(); - batch.execute(tableMoodInfo.dropTable); - batch.execute(tableMoodInfo.createTable); + batch.execute(MoodInfo.dropTable); + batch.execute(MoodInfo.createTable); /// 心情分类表 - final tableMoodInfoCategory = TableMoodInfoCategory(); - batch.execute(tableMoodInfoCategory.dropTable); - batch.execute(tableMoodInfoCategory.createTable); + batch.execute(MoodInfoCategory.dropTable); + batch.execute(MoodInfoCategory.createTable); + await batch.commit(); } @@ -67,16 +66,14 @@ class DB { /// 查询心情详情 /// - /// [datetime] 查询日期(2022-01-04) - /// + /// - [datetime] 查询日期(2022-01-04) Future selectMood(String datetime) async { final db = await database; final List list = await db.query( - TableMoodInfo.tableName, - orderBy: - '${TableMoodInfo.fieldCreateTime} asc, ${TableMoodInfo.fieldMoodId} desc', + MoodInfo.tableName, + orderBy: '${MoodInfo.create_time} asc, ${MoodInfo.mood_id} desc', where: ''' - ${TableMoodInfo.fieldCreateTime} like ? + ${MoodInfo.create_time} like ? ''', whereArgs: ['$datetime%'], ); @@ -86,8 +83,7 @@ class DB { /// 新增心情详情 Future insertMood(MoodData moodData) async { final db = await database; - final int result = - await db.insert(TableMoodInfo.tableName, moodData.toJson()); + final int result = await db.insert(MoodInfo.tableName, moodData.toJson()); return result > 0; } @@ -95,10 +91,10 @@ class DB { Future updateMood(MoodData moodData) async { final db = await database; final int result = await db.update( - TableMoodInfo.tableName, + MoodInfo.tableName, moodData.toJson(), - where: '${TableMoodInfo.fieldMoodId} = ?', - whereArgs: [moodData.moodId], + where: '${MoodInfo.mood_id} = ?', + whereArgs: [moodData.mood_id], ); return result > 0; } @@ -107,9 +103,9 @@ class DB { Future deleteMood(MoodData moodData) async { final db = await database; final int result = await db.delete( - TableMoodInfo.tableName, - where: '${TableMoodInfo.fieldMoodId} = ?', - whereArgs: [moodData.moodId], + MoodInfo.tableName, + where: '${MoodInfo.mood_id} = ?', + whereArgs: [moodData.mood_id], ); return result > 0; } @@ -119,10 +115,10 @@ class DB { final db = await database; final List list = await db.rawQuery(''' SELECT - DISTINCT DATE(${TableMoodInfo.fieldCreateTime}) as recordDate, - ${TableMoodInfo.fieldIcon} - FROM ${TableMoodInfo.tableName} - group by recordDate + DISTINCT DATE(${MoodInfo.create_time}) as record_date, + ${MoodInfo.icon} + FROM ${MoodInfo.tableName} + group by record_date '''); return list; } @@ -131,8 +127,8 @@ class DB { Future selectAllMood() async { final db = await database; final List list = await db.query( - TableMoodInfo.tableName, - orderBy: '${TableMoodInfo.fieldCreateTime} desc', + MoodInfo.tableName, + orderBy: '${MoodInfo.create_time} desc', ); return list; } @@ -142,7 +138,7 @@ class DB { /// 查询所有心情类别 Future selectMoodCategoryAll() async { final db = await database; - final List list = await db.query(TableMoodInfoCategory.tableName); + final List list = await db.query(MoodInfoCategory.tableName); return list; } @@ -152,7 +148,7 @@ class DB { ) async { final db = await database; final int result = await db.insert( - TableMoodInfoCategory.tableName, + MoodInfoCategory.tableName, moodCategoryData.toJson(), ); return result > 0; @@ -164,7 +160,7 @@ class DB { Future selectAPPUsageDays() async { final db = await database; final List days = await db.rawQuery( - 'SELECT count(DISTINCT DATE(${TableMoodInfo.fieldCreateTime})) as dayCount FROM ${TableMoodInfo.tableName}', + 'SELECT count(DISTINCT DATE(${MoodInfo.create_time})) as dayCount FROM ${MoodInfo.tableName}', ); return days; } @@ -173,7 +169,7 @@ class DB { Future selectAPPMoodCount() async { final db = await database; final List count = await db.rawQuery( - 'SELECT count(${TableMoodInfo.fieldMoodId}) as moodCount FROM ${TableMoodInfo.tableName}', + 'SELECT count(${MoodInfo.mood_id}) as moodCount FROM ${MoodInfo.tableName}', ); return count; } @@ -183,24 +179,23 @@ class DB { final db = await database; final List count = await db.rawQuery(''' SELECT - (sum(${TableMoodInfo.fieldScore})/count(${TableMoodInfo.fieldMoodId})) as moodScoreAverage - FROM ${TableMoodInfo.tableName} + (sum(${MoodInfo.score})/count(${MoodInfo.mood_id})) as moodScoreAverage + FROM ${MoodInfo.tableName} '''); return count; } /// 统计-按日期获取平均情绪波动 /// - /// [datetime] 日期平均情绪波动 例如 2022-01-01 - /// + /// - [datetime] 日期平均情绪波动 例如 2022-01-01 Future selectDateMoodScoreAverage(String datetime) async { final db = await database; final List score = await db.rawQuery( ''' SELECT - (sum(${TableMoodInfo.fieldScore})/count(${TableMoodInfo.fieldMoodId})) as moodScoreAverage - FROM ${TableMoodInfo.tableName} - WHERE ${TableMoodInfo.fieldCreateTime} like ? + (sum(${MoodInfo.score})/count(${MoodInfo.mood_id})) as moodScoreAverage + FROM ${MoodInfo.tableName} + WHERE ${MoodInfo.create_time} like ? ''', ['$datetime%'], ); @@ -209,21 +204,20 @@ class DB { /// 统计-按日期时间段获取心情数量统计 /// - /// [startTime] 开始时间 例如 2022-01-01 00:00:00 - /// - /// [endTime] 结束时间 例如 2022-01-01 23:59:59 + /// - [startTime] 开始时间 例如 2022-01-01 00:00:00 + /// - [endTime] 结束时间 例如 2022-01-01 23:59:59 Future selectDateMoodCount(String startTime, String endTime) async { final db = await database; final List count = await db.rawQuery( ''' SELECT - ${TableMoodInfo.fieldIcon}, - ${TableMoodInfo.fieldTitle}, - count(${TableMoodInfo.fieldMoodId}) as count - FROM ${TableMoodInfo.tableName} - WHERE ${TableMoodInfo.fieldCreateTime} >= ? and - ${TableMoodInfo.fieldCreateTime} <= ? - group by ${TableMoodInfo.fieldTitle} + ${MoodInfo.icon}, + ${MoodInfo.title}, + count(${MoodInfo.mood_id}) as count + FROM ${MoodInfo.tableName} + WHERE ${MoodInfo.create_time} >= ? and + ${MoodInfo.create_time} <= ? + group by ${MoodInfo.title} order by count asc ''', [startTime, endTime], diff --git a/lib/models/config/language_model.dart b/lib/models/config/language_model.dart index 1dd7768..6dc74a2 100644 --- a/lib/models/config/language_model.dart +++ b/lib/models/config/language_model.dart @@ -8,8 +8,9 @@ class LanguageData { this.locale, ); - // 语言名称 + /// 语言名称 final String language; - // Locale + + /// Locale final Locale locale; } diff --git a/lib/models/mood/mood_category_model.dart b/lib/models/mood/mood_category_model.dart index 336a20a..1905ffa 100644 --- a/lib/models/mood/mood_category_model.dart +++ b/lib/models/mood/mood_category_model.dart @@ -20,9 +20,10 @@ class MoodCategoryData { title: json['title'], ); - // 表情 + /// 表情 final String icon; - // 标题 + + /// 标题 final String title; Map toJson() => { diff --git a/lib/models/mood/mood_model.dart b/lib/models/mood/mood_model.dart index 9f39667..ecdb041 100644 --- a/lib/models/mood/mood_model.dart +++ b/lib/models/mood/mood_model.dart @@ -7,48 +7,54 @@ String moodDataToJson(MoodData data) => json.encode(data.toJson()); /// 心情详细数据 class MoodData { MoodData({ - this.moodId, - this.icon, - this.title, + this.mood_id, + required this.icon, + required this.title, this.score, this.content, - this.createTime, - this.updateTime, + required this.create_time, + required this.update_time, }); factory MoodData.fromJson(Map json) => MoodData( - moodId: json['moodId'], + mood_id: json['mood_id'], icon: json['icon'], title: json['title'], score: json['score'], content: json['content'], - createTime: json['createTime'], - updateTime: json['updateTime'], + create_time: json['create_time'], + update_time: json['update_time'], ); - // ID - late int? moodId; - // 图标 - late String? icon; - // 标题(当前的心情) - late String? title; - // 分数 - late int? score; - // 内容 - late String? content; - // 创建日期 - late String? createTime; - // 修改日期 - late String? updateTime; + /// ID + int? mood_id; + + /// 图标 + String icon; + + /// 标题(当前的心情) + String title; + + /// 分数 + int? score; + + /// 内容 + String? content; + + /// 创建日期 + String create_time; + + /// 修改日期 + String update_time; Map toJson() => { - 'moodId': moodId, + 'mood_id': mood_id, 'icon': icon, 'title': title, 'score': score, 'content': content, - 'createTime': createTime, - 'updateTime': updateTime, + 'create_time': create_time, + 'update_time': update_time, }; } @@ -60,22 +66,23 @@ String moodRecordDataToJson(MoodRecordData data) => json.encode(data.toJson()); @immutable class MoodRecordData { const MoodRecordData({ - required this.recordDate, + required this.record_date, required this.icon, }); factory MoodRecordData.fromJson(Map json) => MoodRecordData( - recordDate: json['recordDate'], + record_date: json['record_date'], icon: json['icon'], ); - // 记录日期 - final String recordDate; - // 图标 + /// 记录日期 + final String record_date; + + /// 图标 final String icon; Map toJson() => { - 'recordDate': recordDate, + 'record_date': record_date, 'icon': icon, }; } diff --git a/lib/models/statistic/statistic_model.dart b/lib/models/statistic/statistic_model.dart index 4c0bfde..577d4bb 100644 --- a/lib/models/statistic/statistic_model.dart +++ b/lib/models/statistic/statistic_model.dart @@ -25,9 +25,10 @@ class StatisticMoodScoreAverageRecentlyData { score: json['score'], ); - // 记录日期 + /// 记录日期 final String datetime; - // 分数 + + /// 分数 final int score; Map toJson() => { @@ -59,11 +60,13 @@ class StatisticDateMoodCountData { count: json['count'], ); - // 图标 + /// 图标 final String icon; - // 心情(标题) + + /// 心情(标题) final String title; - // 数量 + + /// 数量 final int count; Map toJson() => { diff --git a/lib/services/mood/mood_service.dart b/lib/services/mood/mood_service.dart index 717c96e..2e46886 100644 --- a/lib/services/mood/mood_service.dart +++ b/lib/services/mood/mood_service.dart @@ -7,6 +7,8 @@ import 'package:moodexample/models/mood/mood_category_model.dart'; /// 心情相关 class MoodService { + const MoodService._(); + /// 设置心情类别默认值 static Future setCategoryDefault() async { /// 默认值 diff --git a/lib/services/statistic/statistic_service.dart b/lib/services/statistic/statistic_service.dart index 04d340b..27488c0 100644 --- a/lib/services/statistic/statistic_service.dart +++ b/lib/services/statistic/statistic_service.dart @@ -9,6 +9,8 @@ import 'package:moodexample/models/statistic/statistic_model.dart'; /// 统计相关 class StatisticService { + const StatisticService._(); + /// 获取APP累计记录天数 static Future getAPPUsageDays() async { final list = await DB.instance.selectAPPUsageDays(); diff --git a/lib/views/home/index.dart b/lib/views/home/index.dart index 0e1ba06..550a3ce 100644 --- a/lib/views/home/index.dart +++ b/lib/views/home/index.dart @@ -307,11 +307,13 @@ class OptionCard extends StatelessWidget { // 跳转输入内容页 final String nowDateTime = DateTime.now().toString().substring(0, 10); - final MoodData moodData = MoodData(); - moodData.icon = icon; - moodData.title = title; - moodData.createTime = nowDateTime; - moodData.updateTime = nowDateTime; + final MoodData moodData = MoodData( + icon: icon, + title: title, + create_time: nowDateTime, + update_time: nowDateTime, + ); + return MoodContent(moodData: moodData); }, ); diff --git a/lib/views/menu_screen/widgets/setting_database.dart b/lib/views/menu_screen/widgets/setting_database.dart index 3dcf34f..9b527c8 100644 --- a/lib/views/menu_screen/widgets/setting_database.dart +++ b/lib/views/menu_screen/widgets/setting_database.dart @@ -1,5 +1,4 @@ import 'dart:io'; -import 'dart:convert'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -199,7 +198,7 @@ class _ImportDatabaseBodyState extends State { child: Container( width: 64, height: 64, - padding: const EdgeInsets.only(left: 12), + margin: const EdgeInsets.only(left: 12), decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.bottomCenter, @@ -390,7 +389,7 @@ Future importDatabaseTemplate() async { TextCellValue('开心'), TextCellValue('今天很开心'), TextCellValue('55'), - TextCellValue('2000-11-03'), + TextCellValue('2000-01-01'), ]); /// 保存Excel @@ -416,14 +415,14 @@ Future importDatabase(BuildContext context) async { await FilePicker.platform.clearTemporaryFiles(); /// 选择文件 - final FilePickerResult? result = await FilePicker.platform.pickFiles( + final FilePickerResult? pickedFile = await FilePicker.platform.pickFiles( type: FileType.custom, - allowedExtensions: ['xlsx', 'xls'], + allowedExtensions: ['xlsx'], allowMultiple: false, ); - if (result != null) { + if (pickedFile != null) { /// 文件路径、内容 - final file = result.files.single.path ?? ''; + final file = pickedFile.files.single.path ?? ''; final bytes = File(file).readAsBytesSync(); final excel = Excel.decodeBytes(bytes); for (final table in excel.tables.keys) { @@ -454,7 +453,7 @@ Future importDatabase(BuildContext context) async { /// 未选择文件 } } catch (e) { - print('$e'); + print('Error: $e'); } return returnResults; } @@ -467,14 +466,12 @@ Future importDatabaseStart( final moodProvider = context.read(); /// 心情数据 - final Map moodData = { - 'icon': '', - 'title': '', - 'score': 50, - 'content': null, - 'createTime': '', - 'updateTime': '', - }; + final MoodData moodData = MoodData( + icon: '', + title: '', + create_time: '', + update_time: '', + ); int dataIndex = 0; for (final row in database) { for (final data in row) { @@ -482,42 +479,43 @@ Future importDatabaseStart( if (dataIndex < 3) { break; } + final int? colIndex = data?.columnIndex; - final dynamic value = data?.value; + final CellValue? value = data?.value; switch (colIndex) { /// 表情 case 0: - moodData['icon'] = value.toString(); + moodData.icon = value.toString(); /// 心情 case 1: - moodData['title'] = value.toString(); + moodData.title = value.toString(); /// 内容 case 2: - moodData['content'] = value.toString(); + moodData.content = value.toString(); /// 心情程度 case 3: - moodData['score'] = double.parse(value.toString()).toInt(); + moodData.score = double.parse(value.toString()).toInt(); /// 创建日期、修改日期 case 4: - final moodDate = - DateFormat('yyyy-MM-dd').parse(value).toString().substring(0, 10); - moodData['createTime'] = moodDate; - moodData['updateTime'] = moodDate; + final moodDate = DateFormat('yyyy-MM-dd') + .parse(value.toString()) + .toString() + .substring(0, 10); + moodData.create_time = moodDate; + moodData.update_time = moodDate; } /// 导入数据(一组数据完成) if (colIndex == 4) { - print('${moodDataFromJson(json.encode(moodData))}'); + print('$moodData'); /// 是否操作成功 - late bool result = false; - result = await moodProvider.addMoodData( - moodDataFromJson(json.encode(moodData)), - ); + bool result = false; + result = await moodProvider.addMoodData(moodData); print('是否导入成功$result'); } } @@ -630,10 +628,7 @@ Future>> importDatabaseErrorCheck( continue; } for (final data in row) { - final dynamic value = data?.value; - // print(data); - // print(value); - // print(_rowIndex); + final CellValue? value = data?.value; switch (rowIndex) { /// 表情 case 0: @@ -649,12 +644,11 @@ Future>> importDatabaseErrorCheck( /// 内容 case 2: + break; /// 心情程度 case 3: - final tryValue = double.tryParse(value.toString()) == null - ? null - : double.parse(value.toString()).toInt(); + final int? tryValue = int.tryParse(value.toString()); if (tryValue == null) { errorText += '【心情程度只能为0-100整数】 '; } @@ -667,7 +661,7 @@ Future>> importDatabaseErrorCheck( String? tryValue; try { tryValue = DateFormat('yyyy-MM-dd') - .parse(value) + .parse(value.toString()) .toString() .substring(0, 10); } catch (e) { @@ -675,7 +669,7 @@ Future>> importDatabaseErrorCheck( } print(tryValue); if (tryValue == null) { - errorText += '【创建时间只能为文本,如2000-11-03】 '; + errorText += '【创建时间只能为文本,如2000-01-01】 '; } } @@ -879,18 +873,18 @@ Future exportDatabase() async { ..cellStyle = cellStyle; /// 获取所有心情数据并赋值 - moodProvider.loadMoodDataAllList(); + await moodProvider.loadMoodDataAllList(); final moodAllDataList = moodProvider.moodAllDataList; /// 添加Excel数据 moodAllDataList?.forEach((list) { final List dataList = [ - TextCellValue(list.icon ?? ''), - TextCellValue(list.title ?? ''), + TextCellValue(list.icon), + TextCellValue(list.title), TextCellValue(list.content ?? ''), TextCellValue(list.score.toString()), - TextCellValue(list.createTime ?? ''), - TextCellValue(list.updateTime ?? ''), + TextCellValue(list.create_time), + TextCellValue(list.update_time), ]; sheetObject.appendRow(dataList); diff --git a/lib/views/mood/index.dart b/lib/views/mood/index.dart index d00135d..119bbe3 100644 --- a/lib/views/mood/index.dart +++ b/lib/views/mood/index.dart @@ -202,14 +202,8 @@ class MoodBody extends StatelessWidget { final MoodData moodData = moodProvider.moodDataList[index]; return MoodCard( - key: Key(moodData.moodId.toString()), - moodId: moodData.moodId ?? -1, - icon: moodData.icon ?? '', - title: moodData.title ?? '', - datetime: moodData.createTime ?? '', - score: moodData.score ?? 0, - content: moodData.content, - createTime: moodData.createTime ?? '', + key: Key(moodData.mood_id.toString()), + moodData: moodData, ); }, childCount: moodProvider.moodDataList.length, @@ -454,7 +448,7 @@ class _CalendarState extends State { builder: (context) { int recordedIndex = -1; for (int i = 0; i < list.length; i++) { - if (list[i].recordDate == + if (list[i].record_date == DateFormat('yyyy-MM-dd').format(day)) { recordedIndex = i; } @@ -482,35 +476,10 @@ class _CalendarState extends State { class MoodCard extends StatelessWidget { const MoodCard({ super.key, - required this.moodId, - required this.icon, - required this.title, - required this.datetime, - required this.content, - required this.score, - required this.createTime, + required this.moodData, }); - /// moodId - final int moodId; - - /// Icon - final String icon; - - /// 标题 - final String title; - - /// 日期时间 - final String datetime; - - /// 内容 - final String? content; - - /// 分数 - final int score; - - /// 创建日期 - final String createTime; + final MoodData moodData; @override Widget build(BuildContext context) { @@ -553,14 +522,6 @@ class MoodCard extends StatelessWidget { ), closedColor: const Color(0xFFD6F2E2), openBuilder: (_, closeContainer) { - /// 赋值编辑心情详细数据 - final MoodData moodData = MoodData(); - moodData.moodId = moodId; - moodData.icon = icon; - moodData.title = title; - moodData.score = score; - moodData.content = content; - moodData.createTime = createTime; return MoodContent(moodData: moodData); }, ), @@ -605,7 +566,6 @@ class MoodCard extends StatelessWidget { isDestructiveAction: true, onPressed: () async { final moodProvider = context.read(); - final MoodData moodData = MoodData(moodId: moodId); final bool result = await moodProvider.deleteMoodData(moodData); if (result) { @@ -667,7 +627,7 @@ class MoodCard extends StatelessWidget { ), child: ExcludeSemantics( child: Text( - icon, + moodData.icon, style: const TextStyle(fontSize: 20), ), ), @@ -681,7 +641,7 @@ class MoodCard extends StatelessWidget { children: [ ExcludeSemantics( child: Text( - title, + moodData.title, maxLines: 1, overflow: TextOverflow.ellipsis, style: const TextStyle( @@ -693,14 +653,14 @@ class MoodCard extends StatelessWidget { Padding( padding: const EdgeInsets.only(top: 4), child: Text( - datetime, + moodData.create_time, style: const TextStyle( color: AppTheme.subColor, fontSize: 14, fontWeight: FontWeight.normal, ), semanticsLabel: - '${LocaleDatetime.yMMMd(context, datetime)} 心情:$title', + '${LocaleDatetime.yMMMd(context, moodData.create_time)} 心情:${moodData.title}', ), ), ], @@ -723,13 +683,13 @@ class MoodCard extends StatelessWidget { borderRadius: BorderRadius.circular(10), ), child: Text( - score.toString(), + moodData.score.toString(), style: const TextStyle( fontSize: 14, fontWeight: FontWeight.bold, ), semanticsLabel: - '${S.of(context).mood_data_score_title}:$score', + '${S.of(context).mood_data_score_title}:${moodData.score}', ), ), ], @@ -743,18 +703,19 @@ class MoodCard extends StatelessWidget { bottom: 20, ), child: Text( - content ?? S.of(context).mood_data_content_empty, + moodData.content ?? S.of(context).mood_data_content_empty, maxLines: 5, overflow: TextOverflow.ellipsis, softWrap: true, style: TextStyle( - color: content != null + color: moodData.content != null ? Theme.of(context).textTheme.bodyMedium!.color : AppTheme.subColor, fontSize: 14, ), - semanticsLabel: - content != null ? '记录内容:$content' : '没有记录内容', + semanticsLabel: moodData.content != null + ? '记录内容:${moodData.content}' + : '没有记录内容', ), ), ], @@ -762,13 +723,7 @@ class MoodCard extends StatelessWidget { ), onTap: () => showModalBottomDetail( context: context, - child: MoodDetail( - icon: icon, - title: title, - score: score, - content: content, - createTime: createTime, - ), + child: MoodDetail(moodData: moodData), ), ), ), @@ -781,27 +736,10 @@ class MoodCard extends StatelessWidget { class MoodDetail extends StatelessWidget { const MoodDetail({ super.key, - required this.icon, - required this.title, - required this.score, - required this.createTime, - this.content, + required this.moodData, }); - /// 图标 - final String icon; - - /// 标题 - final String title; - - /// 分数 - final int score; - - /// 内容 - final String? content; - - /// 创建日期 - final String createTime; + final MoodData moodData; @override Widget build(BuildContext context) { @@ -813,14 +751,14 @@ class MoodDetail extends StatelessWidget { Align( heightFactor: 2, child: Text( - LocaleDatetime.yMMMd(context, createTime), + LocaleDatetime.yMMMd(context, moodData.create_time), style: const TextStyle( fontSize: 16, fontWeight: FontWeight.bold, color: AppTheme.subColor, ), semanticsLabel: - '${LocaleDatetime.yMMMd(context, createTime)} 心情:$title', + '${LocaleDatetime.yMMMd(context, moodData.create_time)} 心情:${moodData.title}', ), ), Padding( @@ -835,8 +773,8 @@ class MoodDetail extends StatelessWidget { /// 心情卡片 ExcludeSemantics( child: MoodChoiceCard( - icon: icon, - title: title, + icon: moodData.icon, + title: moodData.title, ), ), @@ -853,7 +791,7 @@ class MoodDetail extends StatelessWidget { ), ), Text( - score.toString(), + moodData.score.toString(), style: const TextStyle( fontSize: 24, fontWeight: FontWeight.bold, @@ -881,16 +819,18 @@ class MoodDetail extends StatelessWidget { borderRadius: BorderRadius.circular(32), ), child: Text( - content ?? S.of(context).mood_data_content_empty, + moodData.content ?? S.of(context).mood_data_content_empty, style: TextStyle( - color: content != null + color: moodData.content != null ? isDarkMode(context) ? Colors.white : Colors.black87 : AppTheme.subColor, fontSize: 14, ), - semanticsLabel: content != null ? '记录内容:$content' : '没有记录内容', + semanticsLabel: moodData.content != null + ? '记录内容:${moodData.content}' + : '没有记录内容', ), ), ], diff --git a/lib/views/mood/mood_category_select.dart b/lib/views/mood/mood_category_select.dart index 886477c..4cf78cc 100644 --- a/lib/views/mood/mood_category_select.dart +++ b/lib/views/mood/mood_category_select.dart @@ -230,11 +230,13 @@ class MoodChoiceCard extends StatelessWidget { switch (_moodCategorySelectType) { case MoodCategorySelectType.add: // 关闭当前页并跳转输入内容页 - final MoodData moodData = MoodData(); - moodData.icon = icon; - moodData.title = title; - moodData.createTime = _nowDateTime; - moodData.updateTime = _nowDateTime; + final MoodData moodData = MoodData( + icon: icon, + title: title, + create_time: _nowDateTime, + update_time: _nowDateTime, + ); + // 跳转输入内容页 context.pop(); GoRouter.of(context).pushNamed( diff --git a/lib/views/mood/mood_content.dart b/lib/views/mood/mood_content.dart index c71a16b..e44941b 100644 --- a/lib/views/mood/mood_content.dart +++ b/lib/views/mood/mood_content.dart @@ -58,7 +58,7 @@ class _MoodContentState extends State { shadowColor: Colors.transparent, centerTitle: true, title: Text( - LocaleDatetime.yMMMd(context, _moodData.createTime ?? ''), + LocaleDatetime.yMMMd(context, _moodData.create_time), style: const TextStyle( fontSize: 14, ), @@ -107,10 +107,10 @@ class _MoodContentState extends State { late bool result = false; /// 存在ID的操作(代表修改) - if (_moodData.moodId != null) { + if (_moodData.mood_id != null) { /// 修改心情数据 /// 赋值修改时间 - _moodData.updateTime = + _moodData.update_time = DateTime.now().toString().substring(0, 10); result = await moodProvider.editMoodData(_moodData); } else { diff --git a/lib/views/statistic/index.dart b/lib/views/statistic/index.dart index cef59a8..51bbb7e 100644 --- a/lib/views/statistic/index.dart +++ b/lib/views/statistic/index.dart @@ -520,7 +520,6 @@ class _StatisticWeekMoodState extends State { _ => 14, }; - /// return BarChart( BarChartData( barGroups: List.generate(listData.length, (i) { diff --git a/pubspec.lock b/pubspec.lock index 8303191..067e922 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -45,10 +45,10 @@ packages: dependency: "direct main" description: name: bonfire - sha256: bbd9cfc0bede31da83d683e05e79b1bb20e91a0e121d6b397677ffa74af487f0 + sha256: "006f2038aff41ab4848cbb32ae79cad4348ad6bd479d730f9aaa8b919ba2a34c" url: "https://pub.dev" source: hosted - version: "3.10.2" + version: "3.10.3" boolean_selector: dependency: transitive description: @@ -199,10 +199,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c" + sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "5.0.0" flutter_localizations: dependency: "direct main" description: flutter @@ -212,10 +212,10 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: "9ee02950848f61c4129af3d6ec84a1cfc0e47931abc746b03e7a3bc3e8ff6eda" + sha256: "9b78450b89f059e96c9ebb355fa6b3df1d6b330436e0b885fb49594c41721398" url: "https://pub.dev" source: hosted - version: "2.0.22" + version: "2.0.23" flutter_screen_lock: dependency: "direct main" description: @@ -236,10 +236,10 @@ packages: dependency: "direct main" description: name: flutter_smart_dialog - sha256: de60eec7036cc1d04954ceb8d03ecc3b0759c880e804d82d47be36065e72398e + sha256: "7932ab58440379094c6a568efc329d322c6dd740e5a553080f2d56a71ed53752" url: "https://pub.dev" source: hosted - version: "4.9.8+2" + version: "4.9.8+3" flutter_test: dependency: "direct dev" description: flutter @@ -283,10 +283,10 @@ packages: dependency: "direct main" description: name: go_router - sha256: "2ddb88e9ad56ae15ee144ed10e33886777eb5ca2509a914850a5faa7b52ff459" + sha256: "6f1b756f6e863259a99135ff3c95026c3cdca17d10ebef2bba2261a25ddc8bbc" url: "https://pub.dev" source: hosted - version: "14.2.7" + version: "14.3.0" http: dependency: transitive description: @@ -344,10 +344,10 @@ packages: dependency: transitive description: name: lints - sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235" + sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "5.0.0" local_auth: dependency: "direct main" description: @@ -360,18 +360,18 @@ packages: dependency: "direct main" description: name: local_auth_android - sha256: e9a3c321e94359a552b1bdd0f98f79885f2b3e27234d270f9bef5cd82b29340c + sha256: "6763aaf8965f21822624cb2fd3c03d2a8b3791037b5efb0fe4b13e110f5afc92" url: "https://pub.dev" source: hosted - version: "1.0.44" + version: "1.0.46" local_auth_darwin: dependency: "direct main" description: name: local_auth_darwin - sha256: "7ba5738c874ca2b910d72385d00d2bebad9d4e807612936cf5e32bc01a048c71" + sha256: "6d2950da311d26d492a89aeb247c72b4653ddc93601ea36a84924a396806d49c" url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" local_auth_platform_interface: dependency: transitive description: @@ -424,10 +424,10 @@ packages: dependency: transitive description: name: mime - sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a" + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" url: "https://pub.dev" source: hosted - version: "1.0.6" + version: "2.0.0" nested: dependency: transitive description: @@ -464,10 +464,10 @@ packages: dependency: transitive description: name: path_provider_android - sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7" + sha256: c464428172cb986b758c6d1724c603097febb8fb855aa265aeecc9280c294d4a url: "https://pub.dev" source: hosted - version: "2.2.10" + version: "2.2.12" path_provider_foundation: dependency: transitive description: @@ -568,18 +568,18 @@ packages: dependency: "direct main" description: name: share_plus - sha256: "468c43f285207c84bcabf5737f33b914ceb8eb38398b91e5e3ad1698d1b72a52" + sha256: fec12c3c39f01e4df1ec6ad92b6e85503c5ca64ffd6e28d18c9ffe53fcc4cb11 url: "https://pub.dev" source: hosted - version: "10.0.2" + version: "10.0.3" share_plus_platform_interface: dependency: transitive description: name: share_plus_platform_interface - sha256: "6ababf341050edff57da8b6990f11f4e99eaba837865e2e6defe16d039619db5" + sha256: c57c0bbfec7142e3a0f55633be504b796af72e60e3c791b44d5a017b985f7a48 url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "5.0.1" shared_preferences: dependency: "direct main" description: @@ -592,18 +592,18 @@ packages: dependency: transitive description: name: shared_preferences_android - sha256: "480ba4345773f56acda9abf5f50bd966f581dac5d514e5fc4a18c62976bbba7e" + sha256: "3b9febd815c9ca29c9e3520d50ec32f49157711e143b7a4ca039eb87e8ade5ab" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.3.3" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation - sha256: c4b35f6cb8f63c147312c054ce7c2254c8066745125264f0c88739c417fc9d9f + sha256: "07e050c7cd39bad516f8d64c455f04508d09df104be326d8c02551590a0d513d" url: "https://pub.dev" source: hosted - version: "2.5.2" + version: "2.5.3" shared_preferences_linux: dependency: transitive description: @@ -669,18 +669,42 @@ packages: dependency: "direct main" description: name: sqflite - sha256: a43e5a27235518c03ca238e7b4732cf35eabe863a369ceba6cbefa537a66f16d + sha256: "79a297dc3cc137e758c6a4baf83342b039e5a6d2436fcdf3f96a00adaaf2ad62" url: "https://pub.dev" source: hosted - version: "2.3.3+1" + version: "2.4.0" + sqflite_android: + dependency: transitive + description: + name: sqflite_android + sha256: "78f489aab276260cdd26676d2169446c7ecd3484bbd5fead4ca14f3ed4dd9ee3" + url: "https://pub.dev" + source: hosted + version: "2.4.0" sqflite_common: dependency: transitive description: name: sqflite_common - sha256: "4058172e418eb7e7f2058dcb7657d451a8fc264afa0dea4dbd0f304a57131611" + sha256: "4468b24876d673418a7b7147e5a08a715b4998a7ae69227acafaab762e0e5490" url: "https://pub.dev" source: hosted - version: "2.5.4+3" + version: "2.5.4+5" + sqflite_darwin: + dependency: transitive + description: + name: sqflite_darwin + sha256: "769733dddf94622d5541c73e4ddc6aa7b252d865285914b6fcd54a63c4b4f027" + url: "https://pub.dev" + source: hosted + version: "2.4.1-1" + sqflite_platform_interface: + dependency: transitive + description: + name: sqflite_platform_interface + sha256: "8dd4515c7bdcae0a785b0062859336de775e8c65db81ae33dd5445f35be61920" + url: "https://pub.dev" + source: hosted + version: "2.4.0" stack_trace: dependency: transitive description: @@ -725,10 +749,10 @@ packages: dependency: transitive description: name: synchronized - sha256: "51b08572b9f091f8c3eb4d9d4be253f196ff0075d5ec9b10a884026d5b55d7bc" + sha256: "69fe30f3a8b04a0be0c15ae6490fc859a78ef4c43ae2dd5e8a623d45bfcf9225" url: "https://pub.dev" source: hosted - version: "3.3.0+2" + version: "3.3.0+3" table_calendar: dependency: "direct main" description: @@ -805,10 +829,10 @@ packages: dependency: transitive description: name: uuid - sha256: f33d6bb662f0e4f79dcd7ada2e6170f3b3a2530c28fc41f49a411ddedd576a77 + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff url: "https://pub.dev" source: hosted - version: "4.5.0" + version: "4.5.1" vector_math: dependency: "direct main" description: @@ -829,10 +853,10 @@ packages: dependency: transitive description: name: web - sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062 + sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.1.0" webdriver: dependency: transitive description: @@ -845,18 +869,18 @@ packages: dependency: "direct main" description: name: webview_flutter - sha256: ec81f57aa1611f8ebecf1d2259da4ef052281cb5ad624131c93546c79ccc7736 + sha256: "889a0a678e7c793c308c68739996227c9661590605e70b1f6cf6b9a6634f7aec" url: "https://pub.dev" source: hosted - version: "4.9.0" + version: "4.10.0" webview_flutter_android: dependency: transitive description: name: webview_flutter_android - sha256: "6e64fcb1c19d92024da8f33503aaeeda35825d77142c01d0ea2aa32edc79fdc8" + sha256: "74693a212d990b32e0b7055d27db973a18abf31c53942063948cdfaaef9787ba" url: "https://pub.dev" source: hosted - version: "3.16.7" + version: "4.0.0" webview_flutter_platform_interface: dependency: transitive description: @@ -869,26 +893,26 @@ packages: dependency: transitive description: name: webview_flutter_wkwebview - sha256: "1942a12224ab31e9508cf00c0c6347b931b023b8a4f0811e5dec3b06f94f117d" + sha256: d4034901d96357beb1b6717ebf7d583c88e40cfc6eb85fe76dd1bf0979a9f251 url: "https://pub.dev" source: hosted - version: "3.15.0" + version: "3.16.0" win32: dependency: transitive description: name: win32 - sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a" + sha256: e5c39a90447e7c81cfec14b041cdbd0d0916bd9ebbc7fe02ab69568be703b9bd url: "https://pub.dev" source: hosted - version: "5.5.4" + version: "5.6.0" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.1.0" xml: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 14d42e5..4401dfa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: moodexample description: 管理自己的情绪,记录当下所见所想。 publish_to: 'none' -version: 1.9.10+465 +version: 1.9.10+466 environment: sdk: ^3.5.0 @@ -15,30 +15,30 @@ dependencies: path: ^1.9.0 path_provider: ^2.1.4 # 路径 provider: ^6.1.2 # 状态管理 - sqflite: ^2.3.3+1 # 数据库 + sqflite: ^2.4.0 # 数据库 shared_preferences: ^2.3.2 # 共享存储 - go_router: ^14.2.7 # 路由管理 + go_router: ^14.3.0 # 路由管理 flutter_zoom_drawer: ^3.2.0 # 缩放抽屉 - flutter_smart_dialog: ^4.9.8+2 # Dialog + flutter_smart_dialog: ^4.9.8+3 # Dialog table_calendar: ^3.1.2 # 日历 flutter_slidable: ^3.1.1 # 滑动操作项 card_swiper: ^3.0.1 # 轮播 fl_chart: ^0.69.0 # 图表 excel: ^4.0.6 # Excel - share_plus: ^10.0.2 # 分享 + share_plus: ^10.0.3 # 分享 file_picker: ^8.1.2 # 文件选择 - webview_flutter: ^4.9.0 # WebView + webview_flutter: ^4.10.0 # WebView ditredi: ^2.0.2 # 3D 数据集显示 vector_math: ^2.1.4 awesome_notifications: ^0.9.3+1 # 本地通知 flutter_timezone: ^3.0.1 # 时区 animations: ^2.0.11 # 动画 - bonfire: 3.10.2 # 游戏引擎相关 + bonfire: 3.10.3 # 游戏引擎相关 flame: 1.18.0 # 游戏引擎相关 flutter_screen_lock: ^9.1.0 # 密码锁 local_auth: ^2.3.0 # 本地认证 - local_auth_android: ^1.0.44 # 本地认证 - local_auth_darwin: ^1.4.0 # 本地认证 + local_auth_android: ^1.0.46 # 本地认证 + local_auth_darwin: ^1.4.1 # 本地认证 flutter_tilt: ^3.0.6 # 倾斜视差 remixicon: ^1.2.0 # Remixicon