From 00e65bc5bed1e0a62f0758a5ce83aa43ce25b266 Mon Sep 17 00:00:00 2001 From: Cxx0822 <1556464090@qq.com> Date: Fri, 7 Nov 2025 17:21:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0hive=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main.dart | 18 +- lib/models/todo.dart | 81 ++-- lib/models/todo.g.dart | 61 +++ lib/pages/todo_page.dart | 43 ++- lib/provider/todo_provider.dart | 8 +- lib/service/todo_service.dart | 24 ++ lib/utils/todo_utils.dart | 2 +- lib/widgets/todo_form.dart | 2 +- lib/widgets/todo_widget.dart | 14 +- macos/Flutter/GeneratedPluginRegistrant.swift | 2 + pubspec.lock | 365 ++++++++++++++++++ pubspec.yaml | 2 +- 12 files changed, 579 insertions(+), 43 deletions(-) create mode 100644 lib/models/todo.g.dart create mode 100644 lib/service/todo_service.dart diff --git a/lib/main.dart b/lib/main.dart index 39eff1a..53853ee 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,12 +1,28 @@ import 'package:flisp_app/provider/app_provider.dart'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:hive_flutter/adapters.dart'; +import 'package:path_provider/path_provider.dart'; import 'package:provider/provider.dart'; import 'layout/main_screen.dart'; +import 'models/todo.dart'; import 'provider/todo_provider.dart'; -void main() { +void main() async{ + WidgetsFlutterBinding.ensureInitialized(); + // 初始化Hive + await Hive.initFlutter(); + + // 注册适配器 + Hive.registerAdapter(TodoAdapter()); + + // 打开Box + await Hive.openBox('todos'); + + final appDir = await getApplicationDocumentsDirectory(); + print('📁 Hive数据库路径: ${appDir.path}'); + runApp(const MyApp()); } diff --git a/lib/models/todo.dart b/lib/models/todo.dart index 1debf25..ce812da 100644 --- a/lib/models/todo.dart +++ b/lib/models/todo.dart @@ -1,48 +1,81 @@ import 'package:flutter/material.dart'; +import 'package:hive/hive.dart'; -class TodoItem { - num id; - String title; - String content; - bool isCompleted; - DateTime? dueDate; - TodoPriority priority; +part 'todo.g.dart'; - TodoItem({ - required this.id, +@HiveType(typeId: 0) +class Todo extends HiveObject { + @HiveField(0) + late int id; + + @HiveField(1) + late String title; + + @HiveField(2) + late String content; + + @HiveField(3) + late bool isCompleted; + + @HiveField(4) + late DateTime? dueDate; + + @HiveField(5) + late int priorityIndex; + + @HiveField(6) + late DateTime createTime; + + @HiveField(7) + late DateTime updateTime; + + TodoPriority get priority => TodoPriority.values[priorityIndex]; + set priority(TodoPriority value) => priorityIndex = value.index; + + Todo({ + int? id, required this.title, - required this.content, + this.content = '', this.isCompleted = false, this.dueDate, - this.priority = TodoPriority.medium, - }); + TodoPriority priority = TodoPriority.medium, + DateTime? createTime, + DateTime? updateTime, + }) { + // 简单时间戳ID + this.id = id ?? DateTime.now().millisecondsSinceEpoch; + this.priorityIndex = priority.index; + this.createTime = createTime ?? DateTime.now(); + this.updateTime = updateTime ?? DateTime.now(); + } - TodoItem copyWith({ - num? id, + Todo copyWith({ String? title, String? content, bool? isCompleted, DateTime? dueDate, TodoPriority? priority, }) { - return TodoItem( - id: id ?? this.id, + return Todo( + id: id, title: title ?? this.title, content: content ?? this.content, isCompleted: isCompleted ?? this.isCompleted, dueDate: dueDate ?? this.dueDate, priority: priority ?? this.priority, + createTime: createTime, + updateTime: DateTime.now(), ); } - static TodoItem getEmpty() { - return TodoItem( - id: 0, - title: '', - content: '', - isCompleted: false, - dueDate: null, - priority: TodoPriority.medium, + static Todo getEmpty() { + return Todo( + id: 0, + title: '', + content: '', + isCompleted: false, + dueDate: null, + priority: TodoPriority.medium, ); } } diff --git a/lib/models/todo.g.dart b/lib/models/todo.g.dart new file mode 100644 index 0000000..426a7cd --- /dev/null +++ b/lib/models/todo.g.dart @@ -0,0 +1,61 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'todo.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class TodoAdapter extends TypeAdapter { + @override + final int typeId = 0; + + @override + Todo read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Todo( + id: fields[0] as int?, + title: fields[1] as String, + content: fields[2] as String, + isCompleted: fields[3] as bool, + dueDate: fields[4] as DateTime?, + createTime: fields[6] as DateTime?, + updateTime: fields[7] as DateTime?, + )..priorityIndex = fields[5] as int; + } + + @override + void write(BinaryWriter writer, Todo obj) { + writer + ..writeByte(8) + ..writeByte(0) + ..write(obj.id) + ..writeByte(1) + ..write(obj.title) + ..writeByte(2) + ..write(obj.content) + ..writeByte(3) + ..write(obj.isCompleted) + ..writeByte(4) + ..write(obj.dueDate) + ..writeByte(5) + ..write(obj.priorityIndex) + ..writeByte(6) + ..write(obj.createTime) + ..writeByte(7) + ..write(obj.updateTime); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TodoAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/lib/pages/todo_page.dart b/lib/pages/todo_page.dart index 45ca191..c21751c 100644 --- a/lib/pages/todo_page.dart +++ b/lib/pages/todo_page.dart @@ -1,4 +1,5 @@ import 'package:flisp_app/provider/todo_provider.dart'; +import 'package:flisp_app/service/todo_service.dart'; import 'package:flisp_app/widgets/awesome_dialog.dart'; import 'package:flisp_app/widgets/todo_widget.dart'; import 'package:flutter/material.dart'; @@ -19,13 +20,15 @@ class TodoPage extends StatefulWidget { } class TodoPageState extends State { + final TodoService todoService = TodoService(); + // 待办事项列表 - final List _todos = []; + late List _todos = []; TodoTab _currentTab = TodoTab.all; // 获取过滤后的待办事项 - List get _activeTodos { + List get _activeTodos { return getActiveTodos(_currentTab, _todos); } @@ -34,6 +37,38 @@ class TodoPageState extends State { _showTodoDialog(false, null); } + @override + void initState() { + super.initState(); + + // _testAddTodo(); + _testQueryTodos(); + } + + void _testQueryTodos() { + try { + _todos = todoService.getAllTodos(); + } catch (e) { + print("失败"); + print(e); + } + } + + Future _testAddTodo() async { + try { + // final newTodo = await todoService.addTodo( + // title: '测试待办事项', + // content: '这是一个测试内容', + // priority: TodoPriority.high, + // dueDate: DateTime.now().add(Duration(days: 3)), + // ); + print("成功"); + } catch (e) { + print("失败"); + print(e); + } + } + @override Widget build(BuildContext context) { return buildBody( @@ -86,7 +121,7 @@ class TodoPageState extends State { } // 显示对话框 - void _showTodoDialog(bool isEditing, TodoItem? todo) { + void _showTodoDialog(bool isEditing, Todo? todo) { final todoProvider = Provider.of(context, listen: false); if (isEditing) { @@ -113,7 +148,7 @@ class TodoPageState extends State { } // 保存待办事项 - void _saveTodo(bool isEditing, TodoItem todo) { + void _saveTodo(bool isEditing, Todo todo) { final store = Provider.of(context, listen: false); setState(() { diff --git a/lib/provider/todo_provider.dart b/lib/provider/todo_provider.dart index 7528959..5e8edbd 100644 --- a/lib/provider/todo_provider.dart +++ b/lib/provider/todo_provider.dart @@ -2,16 +2,16 @@ import 'package:flutter/material.dart'; import 'package:flisp_app/models/todo.dart'; class TodoProvider with ChangeNotifier { - TodoItem _formItem = TodoItem.getEmpty(); + Todo _formItem = Todo.getEmpty(); - TodoItem get formItem => _formItem; + Todo get formItem => _formItem; void resetForm() { - _formItem = TodoItem.getEmpty(); + _formItem = Todo.getEmpty(); notifyListeners(); } - void initForm(TodoItem todo) { + void initForm(Todo todo) { _formItem.title = todo.title; _formItem.content = todo.content ?? ''; _formItem.dueDate = todo.dueDate; diff --git a/lib/service/todo_service.dart b/lib/service/todo_service.dart new file mode 100644 index 0000000..2223c72 --- /dev/null +++ b/lib/service/todo_service.dart @@ -0,0 +1,24 @@ +import 'package:flisp_app/models/todo.dart'; +import 'package:hive_flutter/hive_flutter.dart'; + +class TodoService { + static const String boxName = 'todos'; + + Box get box => Hive.box(boxName); + + Future addTodo(Todo todo) async { + await box.add(todo); + } + + List getAllTodos() { + return box.values.toList(); + } + + Future updateTodo(Todo todo) async { + await todo.save(); + } + + Future deleteTodo(Todo todo) async { + await todo.delete(); + } +} diff --git a/lib/utils/todo_utils.dart b/lib/utils/todo_utils.dart index 49d8d86..6137ea0 100644 --- a/lib/utils/todo_utils.dart +++ b/lib/utils/todo_utils.dart @@ -1,6 +1,6 @@ import 'package:flisp_app/models/todo.dart'; -List getActiveTodos(TodoTab currentTab, List todos) { +List getActiveTodos(TodoTab currentTab, List todos) { switch (currentTab) { case TodoTab.active: return todos.where((todo) => !todo.isCompleted).toList(); diff --git a/lib/widgets/todo_form.dart b/lib/widgets/todo_form.dart index 6205b62..e2830d8 100644 --- a/lib/widgets/todo_form.dart +++ b/lib/widgets/todo_form.dart @@ -8,7 +8,7 @@ import 'package:flisp_app/utils/date_utils.dart'; class TodoForm extends StatefulWidget { final GlobalKey formKey; final bool isEditing; - final TodoItem? initialTodo; + final Todo? initialTodo; const TodoForm({ super.key, diff --git a/lib/widgets/todo_widget.dart b/lib/widgets/todo_widget.dart index 3821be2..174fb40 100644 --- a/lib/widgets/todo_widget.dart +++ b/lib/widgets/todo_widget.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; import 'package:toggle_switch/toggle_switch.dart'; // 统计卡片 -Widget buildStatsCard(List todos) { +Widget buildStatsCard(List todos) { int totalCount = todos.length; int activeCount = todos.where((todo) => !todo.isCompleted).length; @@ -70,9 +70,9 @@ Widget buildTabs({ } Widget buildTodoList({ - required List todos, + required List todos, required ValueChanged onToggleTodo, - required ValueChanged onEditTodo, + required ValueChanged onEditTodo, }) { return ListView.separated( itemCount: todos.length, @@ -89,9 +89,9 @@ Widget buildTodoList({ } Widget _buildTodoItem({ - required TodoItem todo, + required Todo todo, required ValueChanged onToggle, - required ValueChanged onEdit, + required ValueChanged onEdit, }) { return buildCard( child: ListTile( @@ -113,7 +113,7 @@ Widget _buildTodoItem({ ); } -Widget _buildTodoTitle(TodoItem todo) { +Widget _buildTodoTitle(Todo todo) { return Text( todo.title, style: TextStyle( @@ -125,7 +125,7 @@ Widget _buildTodoTitle(TodoItem todo) { } // 构建待办事项副标题 -Widget? _buildTodoSubtitle(TodoItem todo) { +Widget? _buildTodoSubtitle(Todo todo) { final isOverdue = todo.dueDate != null && todo.dueDate!.isBefore(DateTime.now()) && diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 092fa1a..37b91af 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,10 +5,12 @@ import FlutterMacOS import Foundation +import path_provider_foundation import rive_native import shared_preferences_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) RiveNativePlugin.register(with: registry.registrar(forPlugin: "RiveNativePlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) } diff --git a/pubspec.lock b/pubspec.lock index edf85b7..00c75f5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,27 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" + url: "https://pub.flutter-io.cn" + source: hosted + version: "76.0.0" + _macros: + dependency: transitive + description: dart + source: sdk + version: "0.3.3" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.11.0" args: dependency: transitive description: @@ -33,6 +54,70 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.1.2" + build: + dependency: transitive + description: + name: build + sha256: "51dc711996cbf609b90cbe5b335bbce83143875a9d58e4b5c6d3c4f684d3dda7" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.5.4" + build_config: + dependency: transitive + description: + name: build_config + sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.2" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "409002f1adeea601018715d613115cfaf0e31f512cb80ae4534c79867ae2363d" + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.1.0" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: ee4257b3f20c0c90e72ed2b57ad637f694ccba48839a821e87db762548c22a62 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.5.4" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "382a4d649addbfb7ba71a3631df0ec6a45d5ab9b098638144faf27f02778eb53" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.5.4" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: "85fbbb1036d576d966332a3f5ce83f2ce66a40bea1a94ad2d5fc29a19a0d3792" + url: "https://pub.flutter-io.cn" + source: hosted + version: "9.1.2" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: a30f0a0e38671e89a492c44d005b5545b830a961575bbd8336d42869ff71066d + url: "https://pub.flutter-io.cn" + source: hosted + version: "8.12.0" characters: dependency: transitive description: @@ -41,6 +126,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.4.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.3" clock: dependency: transitive description: @@ -49,6 +142,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.1.2" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "11654819532ba94c34de52ff5feb52bd81cba1de00ef2ed622fd50295f9d4243" + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.11.0" collection: dependency: transitive description: @@ -57,6 +158,22 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.19.1" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.2" + crypto: + dependency: transitive + description: + name: crypto + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.7" cupertino_icons: dependency: "direct main" description: @@ -65,6 +182,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.0.8" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "7306ab8a2359a48d22310ad823521d723acfed60ee1f7e37388e8986853b6820" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.3.8" fake_async: dependency: transitive description: @@ -89,6 +214,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "7.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.1" flutter: dependency: "direct main" description: flutter @@ -141,6 +274,22 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "10.0.1" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.3" graphs: dependency: transitive description: @@ -149,6 +298,30 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.3.2" + hive: + dependency: "direct main" + description: + name: hive + sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.3" + hive_flutter: + dependency: "direct main" + description: + name: hive_flutter + sha256: dca1da446b1d808a51689fb5d0c6c9510c0a2ba01e22805d492c73b68e33eecc + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.0" + hive_generator: + dependency: "direct dev" + description: + name: hive_generator + sha256: "06cb8f58ace74de61f63500564931f9505368f45f98958bd7a6c35ba24159db4" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.1" http: dependency: transitive description: @@ -157,6 +330,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.5.0" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.2.2" http_parser: dependency: transitive description: @@ -173,6 +354,30 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "0.19.0" + io: + dependency: transitive + description: + name: io + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.5" + js: + dependency: transitive + description: + name: js + sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.7.2" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.9.0" leak_tracker: dependency: transitive description: @@ -205,6 +410,22 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "5.1.1" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.3.0" + macros: + dependency: transitive + description: + name: macros + sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.1.3-main.0" matcher: dependency: transitive description: @@ -229,6 +450,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.16.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.0" nested: dependency: transitive description: @@ -237,6 +466,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.0" path: dependency: transitive description: @@ -245,6 +482,30 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.9.1" + path_provider: + dependency: "direct main" + description: + name: path_provider + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.5" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: "3b4c1fc3aa55ddc9cd4aa6759984330d5c8e66aa7702a6223c61540dc6380c37" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.19" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "16eef174aacb07e09c351502740fa6254c165757638eba1e9116b0a781201bbd" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.2" path_provider_linux: dependency: transitive description: @@ -285,6 +546,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.1.8" + pool: + dependency: transitive + description: + name: pool + sha256: "978783255c543aa3586a1b3c21f6e9d720eb315376a915872c61ef8b5c20177d" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.5.2" provider: dependency: "direct main" description: @@ -293,6 +562,22 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "6.1.5+1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.5.0" rive: dependency: transitive description: @@ -365,11 +650,43 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.4.1" + shelf: + dependency: transitive + description: + name: shelf + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.4.2" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.0" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.0" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.5.0" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.3.5" source_span: dependency: transitive description: @@ -394,6 +711,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.1.4" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.1" string_scanner: dependency: transitive description: @@ -418,6 +743,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "0.7.4" + timing: + dependency: transitive + description: + name: timing + sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.2" toggle_switch: dependency: "direct main" description: @@ -450,6 +783,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "14.3.1" + watcher: + dependency: transitive + description: + name: watcher + sha256: "592ab6e2892f67760543fb712ff0177f4ec76c031f02f5b4ff8d3fc5eb9fb61a" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.4" web: dependency: transitive description: @@ -458,6 +799,22 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.3" xdg_directories: dependency: transitive description: @@ -466,6 +823,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.3" sdks: dart: ">=3.7.0 <4.0.0" flutter: ">=3.29.0" diff --git a/pubspec.yaml b/pubspec.yaml index 9b9e695..c5fc025 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1 +1 @@ -name: flisp_app description: "闪灵" # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 # followed by an optional build number separated by a +. # Both the version and the builder number may be overridden in flutter # build by specifying --build-name and --build-number, respectively. # In Android, build-name is used as versionName while build-number used as versionCode. # Read more about Android versioning at https://developer.android.com/studio/publish/versioning # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. version: 1.0.0+1 environment: sdk: ^3.7.0 # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions # consider running `flutter pub upgrade --major-versions`. Alternatively, # dependencies can be manually updated by changing the version numbers below to # the latest version available on pub.dev. To see which dependencies have newer # versions available, run `flutter pub outdated`. dependencies: flutter: sdk: flutter flutter_localizations: sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.8 provider: ^6.1.1 # 状态管理 shared_preferences: ^2.2.2 # 本地存储 awesome_dialog: ^3.3.0 toggle_switch: ^2.3.0 fluttertoast: ^8.2.2 flutter_form_builder: ^10.0.0 form_builder_validators: ^10.0.0 intl: ^0.19.0 dev_dependencies: flutter_test: sdk: flutter # The "flutter_lints" package below contains a set of recommended lints to # encourage good coding practices. The lint set provided by the package is # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. flutter_lints: ^5.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter packages. flutter: # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. uses-material-design: true # To add assets to your application, add an assets section, like this: # assets: # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/to/resolution-aware-images # For details regarding adding assets from package dependencies, see # https://flutter.dev/to/asset-from-package # To add custom fonts to your application, add a fonts section here, # in this "flutter" section. Each entry in this list should have a # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: # fonts: # - family: Schyler # fonts: # - asset: fonts/Schyler-Regular.ttf # - asset: fonts/Schyler-Italic.ttf # style: italic # - family: Trajan Pro # fonts: # - asset: fonts/TrajanPro.ttf # - asset: fonts/TrajanPro_Bold.ttf # weight: 700 # # For details regarding fonts from package dependencies, # see https://flutter.dev/to/font-from-package \ No newline at end of file +name: flisp_app description: "闪灵" # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 # followed by an optional build number separated by a +. # Both the version and the builder number may be overridden in flutter # build by specifying --build-name and --build-number, respectively. # In Android, build-name is used as versionName while build-number used as versionCode. # Read more about Android versioning at https://developer.android.com/studio/publish/versioning # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. version: 1.0.0+1 environment: sdk: ^3.7.0 # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions # consider running `flutter pub upgrade --major-versions`. Alternatively, # dependencies can be manually updated by changing the version numbers below to # the latest version available on pub.dev. To see which dependencies have newer # versions available, run `flutter pub outdated`. dependencies: flutter: sdk: flutter flutter_localizations: sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.8 provider: ^6.1.1 # 状态管理 shared_preferences: ^2.2.2 # 本地存储 awesome_dialog: ^3.3.0 toggle_switch: ^2.3.0 fluttertoast: ^8.2.2 flutter_form_builder: ^10.0.0 form_builder_validators: ^10.0.0 intl: ^0.19.0 hive: ^2.2.3 hive_flutter: ^1.1.0 path_provider: ^2.1.1 dev_dependencies: flutter_test: sdk: flutter hive_generator: ^2.0.1 build_runner: ^2.4.6 # The "flutter_lints" package below contains a set of recommended lints to # encourage good coding practices. The lint set provided by the package is # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. flutter_lints: ^5.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter packages. flutter: # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. uses-material-design: true # To add assets to your application, add an assets section, like this: # assets: # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/to/resolution-aware-images # For details regarding adding assets from package dependencies, see # https://flutter.dev/to/asset-from-package # To add custom fonts to your application, add a fonts section here, # in this "flutter" section. Each entry in this list should have a # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: # fonts: # - family: Schyler # fonts: # - asset: fonts/Schyler-Regular.ttf # - asset: fonts/Schyler-Italic.ttf # style: italic # - family: Trajan Pro # fonts: # - asset: fonts/TrajanPro.ttf # - asset: fonts/TrajanPro_Bold.ttf # weight: 700 # # For details regarding fonts from package dependencies, # see https://flutter.dev/to/font-from-package \ No newline at end of file