From 398c49bb9991667df36af61fd17984e1fbeaed98 Mon Sep 17 00:00:00 2001 From: Junyuan Feng Date: Sat, 5 Nov 2022 23:08:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20`Hive=20Object`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/core/persistant_store.dart | 2 +- lib/data/model/server/private_key_info.dart | 8 + lib/data/model/server/private_key_info.g.dart | 47 ++++ .../model/server/server_private_info.dart | 13 + .../model/server/server_private_info.g.dart | 56 ++++ lib/data/model/server/snippet.dart | 7 + lib/data/model/server/snippet.g.dart | 44 ++++ lib/data/provider/private_key.dart | 2 +- lib/data/provider/snippet.dart | 2 +- lib/data/res/build_data.dart | 6 +- lib/data/store/private_key.dart | 34 +-- lib/data/store/server.dart | 35 ++- lib/data/store/setting.dart | 3 + lib/data/store/snippet.dart | 30 +-- lib/main.dart | 33 ++- lib/view/page/convert.dart | 12 +- lib/view/page/server/detail.dart | 8 +- lib/view/page/server/tab.dart | 16 +- pubspec.lock | 243 +++++++++++++++++- pubspec.yaml | 5 +- 20 files changed, 504 insertions(+), 102 deletions(-) create mode 100644 lib/data/model/server/private_key_info.g.dart create mode 100644 lib/data/model/server/server_private_info.g.dart create mode 100644 lib/data/model/server/snippet.g.dart diff --git a/lib/core/persistant_store.dart b/lib/core/persistant_store.dart index 5b12eeb2..95b91f04 100644 --- a/lib/core/persistant_store.dart +++ b/lib/core/persistant_store.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'package:flutter/foundation.dart'; -import 'package:hive/hive.dart'; +import 'package:hive_flutter/hive_flutter.dart'; class PersistentStore { late Box box; diff --git a/lib/data/model/server/private_key_info.dart b/lib/data/model/server/private_key_info.dart index fdf49aa8..1edfb0bc 100644 --- a/lib/data/model/server/private_key_info.dart +++ b/lib/data/model/server/private_key_info.dart @@ -1,8 +1,13 @@ import 'dart:convert'; +import 'package:hive_flutter/hive_flutter.dart'; + +part 'private_key_info.g.dart'; + /// /// Code generated by jsonToDartModel https://ashamp.github.io/jsonToDartModel/ /// +@HiveType(typeId: 1) class PrivateKeyInfo { /* { @@ -12,8 +17,11 @@ class PrivateKeyInfo { } */ + @HiveField(0) late String id; + @HiveField(1) late String privateKey; + @HiveField(2) late String password; PrivateKeyInfo( diff --git a/lib/data/model/server/private_key_info.g.dart b/lib/data/model/server/private_key_info.g.dart new file mode 100644 index 00000000..dc996803 --- /dev/null +++ b/lib/data/model/server/private_key_info.g.dart @@ -0,0 +1,47 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'private_key_info.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class PrivateKeyInfoAdapter extends TypeAdapter { + @override + final int typeId = 1; + + @override + PrivateKeyInfo read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return PrivateKeyInfo( + fields[0] as String, + fields[1] as String, + fields[2] as String, + ); + } + + @override + void write(BinaryWriter writer, PrivateKeyInfo obj) { + writer + ..writeByte(3) + ..writeByte(0) + ..write(obj.id) + ..writeByte(1) + ..write(obj.privateKey) + ..writeByte(2) + ..write(obj.password); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PrivateKeyInfoAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/lib/data/model/server/server_private_info.dart b/lib/data/model/server/server_private_info.dart index 4eddeb7f..f574dbc6 100644 --- a/lib/data/model/server/server_private_info.dart +++ b/lib/data/model/server/server_private_info.dart @@ -1,8 +1,13 @@ import 'dart:convert'; +import 'package:hive_flutter/hive_flutter.dart'; + +part 'server_private_info.g.dart'; + /// /// Code generated by jsonToDartModel https://ashamp.github.io/jsonToDartModel/ /// +@HiveType(typeId: 3) class ServerPrivateInfo { /* { @@ -13,13 +18,21 @@ class ServerPrivateInfo { } */ + @HiveField(0) late String name; + @HiveField(1) late String ip; + @HiveField(2) late int port; + @HiveField(3) late String user; + @HiveField(4) late String pwd; + @HiveField(5) String? pubKeyId; + String get id => '$user@$ip:$port'; + ServerPrivateInfo( {required this.name, required this.ip, diff --git a/lib/data/model/server/server_private_info.g.dart b/lib/data/model/server/server_private_info.g.dart new file mode 100644 index 00000000..c25fa678 --- /dev/null +++ b/lib/data/model/server/server_private_info.g.dart @@ -0,0 +1,56 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'server_private_info.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class ServerPrivateInfoAdapter extends TypeAdapter { + @override + final int typeId = 3; + + @override + ServerPrivateInfo read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return ServerPrivateInfo( + name: fields[0] as String, + ip: fields[1] as String, + port: fields[2] as int, + user: fields[3] as String, + pwd: fields[4] as String, + pubKeyId: fields[5] as String?, + ); + } + + @override + void write(BinaryWriter writer, ServerPrivateInfo obj) { + writer + ..writeByte(6) + ..writeByte(0) + ..write(obj.name) + ..writeByte(1) + ..write(obj.ip) + ..writeByte(2) + ..write(obj.port) + ..writeByte(3) + ..write(obj.user) + ..writeByte(4) + ..write(obj.pwd) + ..writeByte(5) + ..write(obj.pubKeyId); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ServerPrivateInfoAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/lib/data/model/server/snippet.dart b/lib/data/model/server/snippet.dart index f97b31eb..7f8af986 100644 --- a/lib/data/model/server/snippet.dart +++ b/lib/data/model/server/snippet.dart @@ -1,7 +1,14 @@ import 'dart:convert'; +import 'package:hive_flutter/hive_flutter.dart'; + +part 'snippet.g.dart'; + +@HiveType(typeId: 2) class Snippet { + @HiveField(0) late String name; + @HiveField(1) late String script; Snippet(this.name, this.script); diff --git a/lib/data/model/server/snippet.g.dart b/lib/data/model/server/snippet.g.dart new file mode 100644 index 00000000..acef2f9a --- /dev/null +++ b/lib/data/model/server/snippet.g.dart @@ -0,0 +1,44 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'snippet.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class SnippetAdapter extends TypeAdapter { + @override + final int typeId = 2; + + @override + Snippet read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Snippet( + fields[0] as String, + fields[1] as String, + ); + } + + @override + void write(BinaryWriter writer, Snippet obj) { + writer + ..writeByte(2) + ..writeByte(0) + ..write(obj.name) + ..writeByte(1) + ..write(obj.script); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SnippetAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/lib/data/provider/private_key.dart b/lib/data/provider/private_key.dart index 4fd8f902..eb792edd 100644 --- a/lib/data/provider/private_key.dart +++ b/lib/data/provider/private_key.dart @@ -26,7 +26,7 @@ class PrivateKeyProvider extends BusyProvider { void updateInfo(PrivateKeyInfo old, PrivateKeyInfo newInfo) { final idx = _infos.indexWhere((e) => e.id == old.id); _infos[idx] = newInfo; - locator().update(old, newInfo); + locator().put(newInfo); notifyListeners(); } } diff --git a/lib/data/provider/snippet.dart b/lib/data/provider/snippet.dart index 7538bce2..248a9a6d 100644 --- a/lib/data/provider/snippet.dart +++ b/lib/data/provider/snippet.dart @@ -38,7 +38,7 @@ class SnippetProvider extends BusyProvider { void update(Snippet old, Snippet newOne) { if (!have(old)) return; _snippets[index(old)] = newOne; - locator().update(old, newOne); + locator().put(newOne); notifyListeners(); } diff --git a/lib/data/res/build_data.dart b/lib/data/res/build_data.dart index e191bb17..ff913059 100644 --- a/lib/data/res/build_data.dart +++ b/lib/data/res/build_data.dart @@ -2,9 +2,9 @@ class BuildData { static const String name = "ServerBox"; - static const int build = 155; + static const int build = 156; static const String engine = "Flutter 3.3.4 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision eb6d86ee27 (4 weeks ago) • 2022-10-04 22:31:45 -0700\nEngine • revision c08d7d5efc\nTools • Dart 2.18.2 • DevTools 2.15.0\n"; - static const String buildAt = "2022-11-05 21:49:47.105329"; - static const int modifications = 0; + static const String buildAt = "2022-11-05 23:02:53.614616"; + static const int modifications = 20; } diff --git a/lib/data/store/private_key.dart b/lib/data/store/private_key.dart index 40e1a4e9..d28b532e 100644 --- a/lib/data/store/private_key.dart +++ b/lib/data/store/private_key.dart @@ -1,38 +1,28 @@ -import 'dart:convert'; - import 'package:toolbox/core/persistant_store.dart'; import 'package:toolbox/data/model/server/private_key_info.dart'; class PrivateKeyStore extends PersistentStore { void put(PrivateKeyInfo info) { - final ss = fetch(); - if (!have(info)) ss.add(info); - box.put('key', json.encode(ss)); + box.put(info.id, info); } List fetch() { - return getPrivateKeyInfoList( - json.decode(box.get('key', defaultValue: '[]')!)); + final keys = box.keys; + final ps = []; + for (final key in keys) { + final s = box.get(key); + if (s != null) { + ps.add(s); + } + } + return ps; } PrivateKeyInfo get(String id) { - final ss = fetch(); - return ss.firstWhere((e) => e.id == id); + return box.get(id); } void delete(PrivateKeyInfo s) { - final ss = fetch(); - ss.removeAt(index(s)); - box.put('key', json.encode(ss)); + box.delete(s.id); } - - void update(PrivateKeyInfo old, PrivateKeyInfo newInfo) { - final ss = fetch(); - ss[index(old)] = newInfo; - box.put('key', json.encode(ss)); - } - - int index(PrivateKeyInfo s) => fetch().indexWhere((e) => e.id == s.id); - - bool have(PrivateKeyInfo s) => index(s) != -1; } diff --git a/lib/data/store/server.dart b/lib/data/store/server.dart index 0fa21e35..5e39bc3f 100644 --- a/lib/data/store/server.dart +++ b/lib/data/store/server.dart @@ -1,38 +1,33 @@ -import 'dart:convert'; - import 'package:toolbox/core/persistant_store.dart'; import 'package:toolbox/data/model/server/server_private_info.dart'; class ServerStore extends PersistentStore { void put(ServerPrivateInfo info) { - final ss = fetch(); - if (!have(info)) ss.add(info); - box.put('servers', json.encode(ss)); + box.put(info.id, info); } List fetch() { - return getServerInfoList( - json.decode(box.get('servers', defaultValue: '[]')!)); + final ids = box.keys; + final List ss = []; + for (final id in ids) { + final s = box.get(id); + if (s != null) { + ss.add(s); + } + } + return ss; } void delete(ServerPrivateInfo s) { - final ss = fetch(); - ss.removeAt(index(s)); - box.put('servers', json.encode(ss)); + box.delete(s.id); } void update(ServerPrivateInfo old, ServerPrivateInfo newInfo) { - final ss = fetch(); - final idx = index(old); - if (idx < 0) { - throw RangeError.index(idx, ss); + if (!have(old)) { + throw Exception('Old ServerPrivateInfo not found'); } - ss[idx] = newInfo; - box.put('servers', json.encode(ss)); + put(newInfo); } - int index(ServerPrivateInfo s) => fetch() - .indexWhere((e) => e.ip == s.ip && e.port == s.port && e.user == e.user); - - bool have(ServerPrivateInfo s) => index(s) != -1; + bool have(ServerPrivateInfo s) => box.get(s.id) != null; } diff --git a/lib/data/store/setting.dart b/lib/data/store/setting.dart index afbb0022..3e0426ba 100644 --- a/lib/data/store/setting.dart +++ b/lib/data/store/setting.dart @@ -7,4 +7,7 @@ class SettingStore extends PersistentStore { StoreProperty get serverStatusUpdateInterval => property('serverStatusUpdateInterval', defaultValue: 2); StoreProperty get launchPage => property('launchPage', defaultValue: 0); + + StoreProperty get storeVersion => + property('storeVersion', defaultValue: 0); } diff --git a/lib/data/store/snippet.dart b/lib/data/store/snippet.dart index 88cb1c4f..4d1702a9 100644 --- a/lib/data/store/snippet.dart +++ b/lib/data/store/snippet.dart @@ -1,32 +1,24 @@ -import 'dart:convert'; - import 'package:toolbox/core/persistant_store.dart'; import 'package:toolbox/data/model/server/snippet.dart'; class SnippetStore extends PersistentStore { void put(Snippet snippet) { - final ss = fetch(); - if (!have(snippet)) ss.add(snippet); - box.put('snippet', json.encode(ss)); + box.put(snippet.name, snippet); } List fetch() { - return getSnippetList(json.decode(box.get('snippet', defaultValue: '[]')!)); + final keys = box.keys; + final ss = []; + for (final key in keys) { + final s = box.get(key); + if (s != null) { + ss.add(s); + } + } + return ss; } void delete(Snippet s) { - final ss = fetch(); - ss.removeAt(index(s)); - box.put('snippet', json.encode(ss)); + box.delete(s.name); } - - void update(Snippet old, Snippet newInfo) { - final ss = fetch(); - ss[index(old)] = newInfo; - box.put('snippet', json.encode(ss)); - } - - int index(Snippet s) => fetch().indexWhere((e) => e.name == s.name); - - bool have(Snippet s) => index(s) != -1; } diff --git a/lib/main.dart b/lib/main.dart index 2c7dd0e5..45ff8e0e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,6 +6,10 @@ import 'package:logging/logging.dart'; import 'package:provider/provider.dart'; import 'package:toolbox/app.dart'; import 'package:toolbox/core/analysis.dart'; +import 'package:toolbox/core/persistant_store.dart'; +import 'package:toolbox/data/model/server/private_key_info.dart'; +import 'package:toolbox/data/model/server/server_private_info.dart'; +import 'package:toolbox/data/model/server/snippet.dart'; import 'package:toolbox/data/provider/app.dart'; import 'package:toolbox/data/provider/apt.dart'; import 'package:toolbox/data/provider/debug.dart'; @@ -14,11 +18,17 @@ import 'package:toolbox/data/provider/private_key.dart'; import 'package:toolbox/data/provider/server.dart'; import 'package:toolbox/data/provider/sftp_download.dart'; import 'package:toolbox/data/provider/snippet.dart'; +import 'package:toolbox/data/store/private_key.dart'; +import 'package:toolbox/data/store/server.dart'; +import 'package:toolbox/data/store/setting.dart'; +import 'package:toolbox/data/store/snippet.dart'; import 'package:toolbox/locator.dart'; Future initApp() async { - await Hive.initFlutter(); + await initHive(); await setupLocator(); + await upgradeStore(); + locator().loadData(); locator().loadData(); @@ -30,6 +40,27 @@ Future initApp() async { }); } +Future initHive() async { + await Hive.initFlutter(); + Hive.registerAdapter(SnippetAdapter()); + Hive.registerAdapter(PrivateKeyInfoAdapter()); + Hive.registerAdapter(ServerPrivateInfoAdapter()); +} + +Future upgradeStore() async { + final setting = locator(); + final version = setting.storeVersion.fetch(); + if (version == 0) { + final snippet = locator(); + final key = locator(); + final spi = locator(); + for (final s in [snippet, key, spi]) { + await s.box.deleteAll(s.box.keys); + } + setting.storeVersion.put(1); + } +} + void runInZone(dynamic Function() body) { final zoneSpec = ZoneSpecification( print: (Zone self, ZoneDelegate parent, Zone zone, String line) { diff --git a/lib/view/page/convert.dart b/lib/view/page/convert.dart index ce5e5ca1..a8fd1cef 100644 --- a/lib/view/page/convert.dart +++ b/lib/view/page/convert.dart @@ -1,7 +1,7 @@ import 'dart:convert'; -import 'package:clipboard/clipboard.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:toolbox/core/utils.dart'; import 'package:toolbox/data/res/color.dart'; import 'package:toolbox/generated/l10n.dart'; @@ -123,10 +123,12 @@ class _ConvertPageState extends State style: ButtonStyle( foregroundColor: MaterialStateProperty.all(primaryColor)), child: Icon(Icons.copy, semanticLabel: s.copy), - onPressed: () => FlutterClipboard.copy( - _textEditingControllerResult.text == '' - ? ' ' - : _textEditingControllerResult.text), + onPressed: () => Clipboard.setData( + ClipboardData( + text: _textEditingControllerResult.text == '' + ? ' ' + : _textEditingControllerResult.text), + ), ) ], ), diff --git a/lib/view/page/server/detail.dart b/lib/view/page/server/detail.dart index c7d04435..1e38067c 100644 --- a/lib/view/page/server/detail.dart +++ b/lib/view/page/server/detail.dart @@ -68,8 +68,12 @@ class _ServerDetailPageState extends State Widget _buildLinuxIcon(String sysVer) { final iconPath = linuxIcons.search(sysVer); if (iconPath == null) return const SizedBox(); - return SizedBox( - height: _media.size.height * 0.15, child: Image.asset(iconPath)); + return ConstrainedBox( + constraints: BoxConstraints( + maxHeight: _media.size.height * 0.12, + maxWidth: _media.size.width * 0.6), + child: Image.asset(iconPath), + ); } Widget _buildCPUView(ServerStatus ss) { diff --git a/lib/view/page/server/tab.dart b/lib/view/page/server/tab.dart index 8db7d8b5..d0202996 100644 --- a/lib/view/page/server/tab.dart +++ b/lib/view/page/server/tab.dart @@ -4,7 +4,6 @@ import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:flutter/material.dart'; import 'package:get_it/get_it.dart'; import 'package:provider/provider.dart'; -import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:toolbox/core/route.dart'; import 'package:toolbox/core/utils.dart'; import 'package:toolbox/data/model/app/menu_item.dart'; @@ -36,16 +35,17 @@ class _ServerPageState extends State late MediaQueryData _media; late ThemeData _theme; late Color _primaryColor; - late RefreshController _refreshController; late ServerProvider _serverProvider; late S s; + late bool autoUpdate; @override void initState() { super.initState(); _serverProvider = locator(); - _refreshController = RefreshController(); + autoUpdate = + locator().serverStatusUpdateInterval.fetch() != 0; } @override @@ -60,8 +60,6 @@ class _ServerPageState extends State @override Widget build(BuildContext context) { super.build(context); - final autoUpdate = - locator().serverStatusUpdateInterval.fetch() != 0; final child = Consumer(builder: (_, pro, __) { if (pro.servers.isEmpty) { return Center( @@ -89,13 +87,9 @@ class _ServerPageState extends State return Scaffold( body: autoUpdate ? child - : SmartRefresher( - controller: _refreshController, + : RefreshIndicator( child: child, - onRefresh: () async { - await _serverProvider.refreshData(); - _refreshController.refreshCompleted(); - }, + onRefresh: () async => _serverProvider.refreshData(), ), floatingActionButton: FloatingActionButton( onPressed: () => diff --git a/pubspec.lock b/pubspec.lock index b3c5f549..cfe56dd4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,13 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "50.0.0" after_layout: dependency: "direct main" description: @@ -8,6 +15,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "5.2.0" archive: dependency: transitive description: @@ -43,6 +57,62 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + build: + dependency: transitive + description: + name: build + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.1" + build_config: + dependency: transitive + description: + name: build_config + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.1" + build_daemon: + dependency: transitive + description: + name: build_daemon + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + build_runner: + dependency: "direct dev" + description: + name: build_runner + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.2" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + url: "https://pub.dartlang.org" + source: hosted + version: "7.2.7" + built_collection: + dependency: transitive + description: + name: built_collection + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + url: "https://pub.dartlang.org" + source: hosted + version: "8.4.2" characters: dependency: transitive description: @@ -50,6 +120,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.1" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" circle_chart: dependency: "direct main" description: @@ -59,13 +136,6 @@ packages: url: "https://github.com/LollipopKit/circle_chart" source: git version: "0.0.3" - clipboard: - dependency: "direct main" - description: - name: clipboard - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.3" clock: dependency: transitive description: @@ -73,6 +143,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.1" + code_builder: + dependency: transitive + description: + name: code_builder + url: "https://pub.dartlang.org" + source: hosted + version: "4.3.0" collection: dependency: transitive description: @@ -110,6 +187,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.0" + dart_style: + dependency: transitive + description: + name: dart_style + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.4" dartssh2: dependency: "direct main" description: @@ -173,6 +257,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "6.1.2" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" flutter: dependency: "direct main" description: flutter @@ -228,6 +319,13 @@ packages: description: flutter source: sdk version: "0.0.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" get_it: dependency: "direct main" description: @@ -235,8 +333,22 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "7.2.0" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + graphs: + dependency: transitive + description: + name: graphs + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" hive: - dependency: "direct main" + dependency: transitive description: name: hive url: "https://pub.dartlang.org" @@ -249,6 +361,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0" + hive_generator: + dependency: "direct dev" + description: + name: hive_generator + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" http: dependency: transitive description: @@ -263,6 +382,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.2" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "3.2.1" http_parser: dependency: transitive description: @@ -284,6 +410,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.17.0" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" js: dependency: transitive description: @@ -291,6 +424,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.6.4" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "4.7.0" lint: dependency: transitive description: @@ -347,6 +487,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.0" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" path: dependency: transitive description: @@ -445,6 +592,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.6.0" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.1" process: dependency: transitive description: @@ -459,13 +613,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "6.0.3" - pull_to_refresh: - dependency: "direct main" + pub_semver: + dependency: transitive description: - name: pull_to_refresh + name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.2" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.1" r_upgrade: dependency: "direct main" description: @@ -515,11 +676,39 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.0.0" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.0" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.99" + source_gen: + dependency: transitive + description: + name: source_gen + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.6" + source_helper: + dependency: transitive + description: + name: source_helper + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.3" source_span: dependency: transitive description: @@ -541,6 +730,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + stream_transform: + dependency: transitive + description: + name: stream_transform + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" string_scanner: dependency: transitive description: @@ -562,6 +758,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.4.12" + timing: + dependency: transitive + description: + name: timing + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" typed_data: dependency: transitive description: @@ -639,6 +842,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.2" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" win32: dependency: transitive description: @@ -668,5 +885,5 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=2.17.0 <3.0.0" + dart: ">=2.18.0 <3.0.0" flutter: ">=3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 9e1e6aaa..55678967 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -33,7 +33,6 @@ dependencies: sdk: flutter provider: ^6.0.0 get_it: ^7.2.0 - hive: ^2.0.0 hive_flutter: ^1.0.0 dio: ^4.0.0 after_layout: ^1.1.0 @@ -51,9 +50,7 @@ dependencies: url: https://github.com/LollipopKit/circle_chart ref: main # path: ../circle_chart - clipboard: ^0.1.3 r_upgrade: ^0.3.6 - pull_to_refresh: ^2.0.0 dropdown_button2: ^1.1.1 flutter_advanced_drawer: ^1.3.0 path_provider: ^2.0.9 @@ -63,6 +60,8 @@ dependencies: dev_dependencies: flutter_native_splash: ^2.1.6 + hive_generator: ^2.0.0 + build_runner: ^2.3.2 flutter_test: sdk: flutter