From 16763732557cb3d28cc0b03d4aced585008a64e2 Mon Sep 17 00:00:00 2001 From: januwA Date: Wed, 11 Aug 2021 18:11:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=BC=E8=88=AA=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .flutter-plugins-dependencies | 2 +- lib/pages/dash/dash_page.dart | 102 ++++++++++++++++++--------------- lib/sqflite_db/sqflite_db.dart | 30 +++++----- pubspec.yaml | 2 +- 4 files changed, 73 insertions(+), 63 deletions(-) diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 8188337..881ed4a 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\connectivity-3.0.2\\\\","dependencies":[]},{"name":"flutter_downloader","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\flutter_downloader-1.5.2\\\\","dependencies":[]},{"name":"flutter_screen","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\git\\\\flutter_screen-f2e3fb4bea16c203ea679d9bbb5da526e7630bd9\\\\","dependencies":[]},{"name":"install_plugin","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\install_plugin-2.0.1\\\\","dependencies":[]},{"name":"package_info","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\package_info-2.0.0\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider-2.0.1\\\\","dependencies":[]},{"name":"permission_handler","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\permission_handler-6.1.0\\\\","dependencies":[]},{"name":"sensors","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\sensors-2.0.0\\\\","dependencies":[]},{"name":"shared_preferences","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences-2.0.4\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-2.0.0+2\\\\","dependencies":[]},{"name":"url_launcher","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher-6.0.2\\\\","dependencies":[]},{"name":"video_player","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\video_player-2.0.2\\\\","dependencies":[]},{"name":"webview_flutter","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\git\\\\webview_flutter-2.0.2-002ba6c95ebab9b8b5b7a532b89ec03037259bd2\\\\","dependencies":[]}],"android":[{"name":"connectivity","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\connectivity-3.0.2\\\\","dependencies":[]},{"name":"flutter_ajanuw_android_pip","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\flutter_ajanuw_android_pip-0.1.2\\\\","dependencies":[]},{"name":"flutter_downloader","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\flutter_downloader-1.5.2\\\\","dependencies":[]},{"name":"flutter_screen","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\git\\\\flutter_screen-f2e3fb4bea16c203ea679d9bbb5da526e7630bd9\\\\","dependencies":[]},{"name":"install_plugin","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\install_plugin-2.0.1\\\\","dependencies":[]},{"name":"package_info","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\package_info-2.0.0\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider-2.0.1\\\\","dependencies":[]},{"name":"permission_handler","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\permission_handler-6.1.0\\\\","dependencies":[]},{"name":"sensors","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\sensors-2.0.0\\\\","dependencies":[]},{"name":"shared_preferences","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences-2.0.4\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-2.0.0+2\\\\","dependencies":[]},{"name":"url_launcher","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher-6.0.2\\\\","dependencies":[]},{"name":"video_player","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\video_player-2.0.2\\\\","dependencies":[]},{"name":"webview_flutter","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\git\\\\webview_flutter-2.0.2-002ba6c95ebab9b8b5b7a532b89ec03037259bd2\\\\","dependencies":[]}],"macos":[{"name":"connectivity_macos","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\connectivity_macos-0.2.0\\\\","dependencies":[]},{"name":"package_info","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\package_info-2.0.0\\\\","dependencies":[]},{"name":"path_provider_macos","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_macos-2.0.0\\\\","dependencies":[]},{"name":"shared_preferences_macos","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_macos-2.0.0\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-2.0.0+2\\\\","dependencies":[]},{"name":"url_launcher_macos","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_macos-2.0.0\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_linux-2.0.0\\\\","dependencies":[]},{"name":"shared_preferences_linux","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_linux-2.0.0\\\\","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_linux-2.0.0\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_windows-2.0.0\\\\","dependencies":[]},{"name":"shared_preferences_windows","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_windows-2.0.0\\\\","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_windows-2.0.0\\\\","dependencies":[]}],"web":[{"name":"shared_preferences_web","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_web-2.0.0\\\\","dependencies":[]},{"name":"url_launcher_web","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_web-2.0.0\\\\","dependencies":[]},{"name":"video_player_web","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\video_player_web-2.0.0\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"connectivity","dependencies":["connectivity_macos"]},{"name":"connectivity_macos","dependencies":[]},{"name":"flutter_ajanuw_android_pip","dependencies":[]},{"name":"flutter_downloader","dependencies":[]},{"name":"flutter_screen","dependencies":[]},{"name":"install_plugin","dependencies":[]},{"name":"package_info","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"sensors","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"sqflite","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_linux","url_launcher_macos","url_launcher_windows","url_launcher_web"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"video_player","dependencies":["video_player_web"]},{"name":"video_player_web","dependencies":[]},{"name":"webview_flutter","dependencies":[]}],"date_created":"2021-06-09 11:31:33.025933","version":"2.2.1"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\connectivity-3.0.2\\\\","dependencies":[]},{"name":"flutter_downloader","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\flutter_downloader-1.5.2\\\\","dependencies":[]},{"name":"flutter_screen","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\git\\\\flutter_screen-f2e3fb4bea16c203ea679d9bbb5da526e7630bd9\\\\","dependencies":[]},{"name":"install_plugin","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\install_plugin-2.0.1\\\\","dependencies":[]},{"name":"package_info","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\package_info-2.0.0\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider-2.0.1\\\\","dependencies":[]},{"name":"permission_handler","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\permission_handler-6.1.0\\\\","dependencies":[]},{"name":"sensors","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\sensors-2.0.0\\\\","dependencies":[]},{"name":"shared_preferences","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences-2.0.4\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-2.0.0+2\\\\","dependencies":[]},{"name":"url_launcher","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher-6.0.2\\\\","dependencies":[]},{"name":"video_player","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\video_player-2.0.2\\\\","dependencies":[]},{"name":"webview_flutter","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\git\\\\webview_flutter-2.0.2-002ba6c95ebab9b8b5b7a532b89ec03037259bd2\\\\","dependencies":[]}],"android":[{"name":"connectivity","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\connectivity-3.0.2\\\\","dependencies":[]},{"name":"flutter_ajanuw_android_pip","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\flutter_ajanuw_android_pip-0.1.2\\\\","dependencies":[]},{"name":"flutter_downloader","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\flutter_downloader-1.5.2\\\\","dependencies":[]},{"name":"flutter_screen","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\git\\\\flutter_screen-f2e3fb4bea16c203ea679d9bbb5da526e7630bd9\\\\","dependencies":[]},{"name":"install_plugin","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\install_plugin-2.0.1\\\\","dependencies":[]},{"name":"package_info","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\package_info-2.0.0\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider-2.0.1\\\\","dependencies":[]},{"name":"permission_handler","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\permission_handler-6.1.0\\\\","dependencies":[]},{"name":"sensors","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\sensors-2.0.0\\\\","dependencies":[]},{"name":"shared_preferences","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences-2.0.4\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-2.0.0+2\\\\","dependencies":[]},{"name":"url_launcher","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher-6.0.2\\\\","dependencies":[]},{"name":"video_player","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\video_player-2.0.2\\\\","dependencies":[]},{"name":"webview_flutter","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\git\\\\webview_flutter-2.0.2-002ba6c95ebab9b8b5b7a532b89ec03037259bd2\\\\","dependencies":[]}],"macos":[{"name":"connectivity_macos","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\connectivity_macos-0.2.0\\\\","dependencies":[]},{"name":"package_info","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\package_info-2.0.0\\\\","dependencies":[]},{"name":"path_provider_macos","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_macos-2.0.0\\\\","dependencies":[]},{"name":"shared_preferences_macos","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_macos-2.0.0\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-2.0.0+2\\\\","dependencies":[]},{"name":"url_launcher_macos","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_macos-2.0.0\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_linux-2.0.0\\\\","dependencies":[]},{"name":"shared_preferences_linux","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_linux-2.0.0\\\\","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_linux-2.0.0\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_windows-2.0.0\\\\","dependencies":[]},{"name":"shared_preferences_windows","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_windows-2.0.0\\\\","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_windows-2.0.0\\\\","dependencies":[]}],"web":[{"name":"shared_preferences_web","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_web-2.0.0\\\\","dependencies":[]},{"name":"url_launcher_web","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_web-2.0.0\\\\","dependencies":[]},{"name":"video_player_web","path":"D:\\\\dev\\\\lang\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\video_player_web-2.0.0\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"connectivity","dependencies":["connectivity_macos"]},{"name":"connectivity_macos","dependencies":[]},{"name":"flutter_ajanuw_android_pip","dependencies":[]},{"name":"flutter_downloader","dependencies":[]},{"name":"flutter_screen","dependencies":[]},{"name":"install_plugin","dependencies":[]},{"name":"package_info","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"sensors","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"sqflite","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_linux","url_launcher_macos","url_launcher_windows","url_launcher_web"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"video_player","dependencies":["video_player_web"]},{"name":"video_player_web","dependencies":[]},{"name":"webview_flutter","dependencies":[]}],"date_created":"2021-08-11 18:10:47.719505","version":"2.2.3"} \ No newline at end of file diff --git a/lib/pages/dash/dash_page.dart b/lib/pages/dash/dash_page.dart index ec7378b..aedcd49 100644 --- a/lib/pages/dash/dash_page.dart +++ b/lib/pages/dash/dash_page.dart @@ -42,55 +42,10 @@ class _DashPageState extends State { @override Widget build(BuildContext context) { - List navList = [ - NavItem( - title: AppLocalizations.of(context).dashHome, - icon: Icons.home, - color: Colors.pink, - ), - NavItem( - title: AppLocalizations.of(context).dashRecent, - icon: Icons.fiber_new, - color: Colors.deepPurple), - NavItem( - title: AppLocalizations.of(context).dashRecommend, - icon: Icons.thumb_up, - color: Colors.orange), - NavItem( - title: AppLocalizations.of(context).dashClassification, - icon: Icons.toys, - color: Colors.green), - ]; return WillPopScope( onWillPop: onWillPop, child: Scaffold( - bottomNavigationBar: Observer( - builder: (_) { - var isDark = - MediaQuery.of(context).platformBrightness == Brightness.dark; - return BubbleBottomBar( - opacity: 0.2, - currentIndex: store.index, - onTap: store.controller.jumpToPage, - borderRadius: BorderRadius.circular(16), - backgroundColor: isDark ? Colors.black : Colors.white, - hasNotch: true, - hasInk: true, - items: [ - for (var e in navList) - BubbleBottomBarItem( - backgroundColor: e.color, - icon: Icon(e.icon), - activeIcon: Icon( - e.icon, - color: e.color, - ), - title: Text(e.title), - ), - ], - ); - }, - ), + bottomNavigationBar: _bottomNavigationBar(), body: PageView( controller: store.controller, onPageChanged: store.onPageChanged, @@ -104,4 +59,59 @@ class _DashPageState extends State { ), ); } + + Widget _bottomNavigationBar() { + List navList = [ + NavItem( + title: AppLocalizations.of(context).dashHome, + icon: Icons.home, + color: Colors.pink, + ), + NavItem( + title: AppLocalizations.of(context).dashRecent, + icon: Icons.fiber_new, + color: Colors.deepPurple, + ), + NavItem( + title: AppLocalizations.of(context).dashRecommend, + icon: Icons.thumb_up, + color: Colors.orange, + ), + NavItem( + title: AppLocalizations.of(context).dashClassification, + icon: Icons.toys, + color: Colors.green, + ), + ]; + return Observer( + builder: (_) { + var isDark = + MediaQuery.of(context).platformBrightness == Brightness.dark; + return BubbleBottomBar( + opacity: 0.2, + currentIndex: store.index, + onTap: store.controller.jumpToPage, + borderRadius: BorderRadius.circular(16), + backgroundColor: isDark ? Colors.black : Colors.white, + hasNotch: true, + hasInk: true, + items: [ + for (var e in navList) + BubbleBottomBarItem( + backgroundColor: e.color, + icon: Icon( + e.icon, + color: isDark ? Colors.white60 : Colors.grey[700], + ), + activeIcon: Icon( + e.icon, + color: e.color, + ), + title: Text(e.title), + ), + ], + ); + }, + ); + } } diff --git a/lib/sqflite_db/sqflite_db.dart b/lib/sqflite_db/sqflite_db.dart index a2d3d8a..823ea09 100644 --- a/lib/sqflite_db/sqflite_db.dart +++ b/lib/sqflite_db/sqflite_db.dart @@ -13,8 +13,8 @@ import 'model/history.dart'; class AnimeDB { static AnimeDB _o; - static final String historyTable = 'historys'; - static final String collectionTable = 'collections'; + static final String HISTORY_TABLE = 'historys'; + static final String COLLECTION_TABLE = 'collections'; Future database; @@ -47,7 +47,7 @@ class AnimeDB { // 历史记录表 await db.execute( ''' - CREATE TABLE ${historyTable} ( + CREATE TABLE ${HISTORY_TABLE} ( id INTEGER PRIMARY KEY AUTOINCREMENT, animeId TEXT NOT NULL, cover TEXT NOT NULL, @@ -61,9 +61,9 @@ class AnimeDB { ); ''', ); - // 搜藏表 + // 收藏表 await db.execute(''' - CREATE TABLE ${collectionTable} ( + CREATE TABLE ${COLLECTION_TABLE} ( id INTEGER PRIMARY KEY AUTOINCREMENT, animeId TEXT NOT NULL ); @@ -79,7 +79,7 @@ class AnimeDB { /// 返回所有的收藏记录 Future> getAllCollections() async { final Database db = await database; - final List> datas = await db.query(collectionTable); + final List> datas = await db.query(COLLECTION_TABLE); return List.generate(datas.length, (i) { return Collection.from(datas[i]); }); @@ -89,7 +89,7 @@ class AnimeDB { Future existCollection(String animeId) async { final Database db = await database; var datas = await db - .query(collectionTable, where: "animeId = ?", whereArgs: [animeId]); + .query(COLLECTION_TABLE, where: "animeId = ?", whereArgs: [animeId]); return datas.isNotEmpty; } @@ -97,7 +97,7 @@ class AnimeDB { Future insertCollection(Collection collection) async { final Database db = await database; return await db.insert( - collectionTable, + COLLECTION_TABLE, collection.toMap(), // conflictAlgorithm: ConflictAlgorithm.replace, // 如果存在则替换 ); @@ -107,7 +107,7 @@ class AnimeDB { Future deleteCollection(String animeId) async { final Database db = await database; return await db.delete( - collectionTable, + COLLECTION_TABLE, where: "animeId = ?", whereArgs: [animeId], ); @@ -117,7 +117,7 @@ class AnimeDB { Future> findAllHistorys() async { final Database db = await database; final List> datas = - await db.query(historyTable, orderBy: "time desc"); + await db.query(HISTORY_TABLE, orderBy: "time desc"); return datas.map((e) => History.from(e)).toList(); } @@ -125,7 +125,7 @@ class AnimeDB { Future findOneByAnimeId(String animeId) async { final Database db = await database; var datas = await db.query( - historyTable, + HISTORY_TABLE, where: "animeId = ?", whereArgs: [animeId], ); @@ -136,7 +136,7 @@ class AnimeDB { Future findOneById(int id) async { final Database db = await database; var datas = await db.query( - historyTable, + HISTORY_TABLE, where: "id = ?", whereArgs: [id], ); @@ -146,7 +146,7 @@ class AnimeDB { Future createHistory(History history) async { final Database db = await database; - int id = await db.insert(historyTable, history.toMap()); + int id = await db.insert(HISTORY_TABLE, history.toMap()); if (id != null) return findOneById(id); return null; } @@ -154,7 +154,7 @@ class AnimeDB { Future updateHistory(History history) async { final Database db = await database; return db.update( - historyTable, + HISTORY_TABLE, history.toMap(), where: 'id = ?', whereArgs: [history.id], @@ -164,6 +164,6 @@ class AnimeDB { Future deleteHistory(History history) async { final Database db = await database; - return db.delete(historyTable, where: "id = ?", whereArgs: [history.id]); + return db.delete(HISTORY_TABLE, where: "id = ?", whereArgs: [history.id]); } } diff --git a/pubspec.yaml b/pubspec.yaml index db7359d..e20edf5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: anime_app description: a play anime app publish_to: "none" -version: 0.13.3 +version: 0.13.4 environment: sdk: ">=2.7.0 <3.0.0"