From eec0e9f7d3c218deab287e65c0c1db7f82289898 Mon Sep 17 00:00:00 2001 From: Cxx0822 <1556464090@qq.com> Date: Wed, 16 Jul 2025 19:59:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E8=8F=9C=E8=B0=B1?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/api/recipe.dart | 32 ++++- lib/main.dart | 2 +- lib/models/recipe.dart | 50 ++++---- lib/models/recipe.g.dart | 18 ++- lib/utils/http_util.dart | 10 +- lib/utils/index.dart | 8 ++ lib/utils/log_util.dart | 12 ++ lib/views/login.dart | 84 +++++++----- lib/views/record.dart | 64 +++++++--- lib/widgets/common/index.dart | 24 ++-- lib/widgets/recipe/recipe_card.dart | 191 ++++++++++++++-------------- lib/widgets/recipe/recipe_list.dart | 28 ++-- pubspec.lock | 8 ++ pubspec.yaml | 1 + 14 files changed, 327 insertions(+), 205 deletions(-) create mode 100644 lib/utils/log_util.dart diff --git a/lib/api/recipe.dart b/lib/api/recipe.dart index 77b39bc..ff1bbcd 100644 --- a/lib/api/recipe.dart +++ b/lib/api/recipe.dart @@ -1,5 +1,6 @@ import 'package:food_hub_app/models/recipe.dart'; import 'package:food_hub_app/utils/http_util.dart'; +import 'package:food_hub_app/utils/index.dart'; Future queryRecipeByIdApi(int id) { return HttpUtil().get( @@ -8,9 +9,36 @@ Future queryRecipeByIdApi(int id) { ); } +Future addRecipeApi(Recipe recipe) { + return HttpUtil().post("/food/food/recipe", data: recipe); +} + +Future updateRecipeApi(int id, Recipe recipe) { + return HttpUtil().put("/food/food/recipe/$id", data: recipe); +} + +Future deleteRecipeApi(int id) { + return HttpUtil().delete("/food/food/recipe/$id"); +} + Future> queryRecipeByUserApi(int id) { return HttpUtil().get>( "/food/recipe/user/$id", - converter: (data) => data.map((item) => Recipe.fromJson(item)).toList() + converter: (data) => convertListResponse(data, Recipe.fromJson), ); -} \ No newline at end of file +} + +Future> queryRecipeUserFavouriteApi() { + return HttpUtil().get>( + "/food/recipe/user/favourite", + converter: (data) => convertListResponse(data, Recipe.fromJson), + ); +} + +Future> queryRecipeApi(RecipeQuery recipeQuery) { + return HttpUtil().get>( + "/food/recipe", + queryParameters: recipeQuery.toJson(), + converter: (data) => convertListResponse(data, Recipe.fromJson), + ); +} diff --git a/lib/main.dart b/lib/main.dart index 27f1643..4e89047 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -10,7 +10,7 @@ import 'package:shared_preferences/shared_preferences.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); FormBuilderLocalizations.delegate.load(const Locale('zh', 'CN')); - SPUtil.init(); + await SPUtil.init(); runApp(const MyApp()); } diff --git a/lib/models/recipe.dart b/lib/models/recipe.dart index fa1dd7d..795216f 100644 --- a/lib/models/recipe.dart +++ b/lib/models/recipe.dart @@ -9,11 +9,7 @@ class Material { String name; String amount; - Material({ - required this.type, - required this.name, - required this.amount, - }); + Material({required this.type, required this.name, required this.amount}); factory Material.fromJson(Map json) => _$MaterialFromJson(json); @@ -28,14 +24,9 @@ class Step { String content; String imageUrl; - Step({ - required this.sort, - required this.content, - required this.imageUrl, - }); + Step({required this.sort, required this.content, required this.imageUrl}); - factory Step.fromJson(Map json) => - _$StepFromJson(json); + factory Step.fromJson(Map json) => _$StepFromJson(json); Map toJson() => _$StepToJson(this); } @@ -66,28 +57,40 @@ class Comment { /// 成果信息 @JsonSerializable() class Record { - int id; + int? id; String name; - String? category; + String category; int person; String date; String imageUrl; Record({ - required this.id, + this.id, required this.name, - this.category, + required this.category, required this.person, required this.date, required this.imageUrl, }); - factory Record.fromJson(Map json) => - _$RecordFromJson(json); + factory Record.fromJson(Map json) => _$RecordFromJson(json); Map toJson() => _$RecordToJson(this); } +@JsonSerializable() +class RecipeQuery { + String category; + + RecipeQuery({ + required this.category + }); + + factory RecipeQuery.fromJson(Map json) => _$RecipeQueryFromJson(json); + + Map toJson() => _$RecipeQueryToJson(this); +} + /// 菜谱信息 @JsonSerializable() class Recipe { @@ -100,8 +103,8 @@ class Recipe { int? userId; String? username; String? avatar; - List materialList; - List stepList; + List? materialList; + List? stepList; List recordList; List? likeList; int? likeCount; @@ -120,8 +123,8 @@ class Recipe { this.userId, this.username, this.avatar, - required this.materialList, - required this.stepList, + this.materialList, + this.stepList, required this.recordList, this.likeList, this.likeCount, @@ -131,8 +134,7 @@ class Recipe { this.commentCount, }); - factory Recipe.fromJson(Map json) => - _$RecipeFromJson(json); + factory Recipe.fromJson(Map json) => _$RecipeFromJson(json); Map toJson() => _$RecipeToJson(this); } diff --git a/lib/models/recipe.g.dart b/lib/models/recipe.g.dart index 2ad2e12..21c5fc5 100644 --- a/lib/models/recipe.g.dart +++ b/lib/models/recipe.g.dart @@ -47,9 +47,9 @@ Map _$CommentToJson(Comment instance) => { }; Record _$RecordFromJson(Map json) => Record( - id: (json['id'] as num).toInt(), + id: (json['id'] as num?)?.toInt(), name: json['name'] as String, - category: json['category'] as String?, + category: json['category'] as String, person: (json['person'] as num).toInt(), date: json['date'] as String, imageUrl: json['imageUrl'] as String, @@ -64,6 +64,12 @@ Map _$RecordToJson(Record instance) => { 'imageUrl': instance.imageUrl, }; +RecipeQuery _$RecipeQueryFromJson(Map json) => + RecipeQuery(category: json['category'] as String); + +Map _$RecipeQueryToJson(RecipeQuery instance) => + {'category': instance.category}; + Recipe _$RecipeFromJson(Map json) => Recipe( id: (json['id'] as num?)?.toInt(), name: json['name'] as String, @@ -75,12 +81,12 @@ Recipe _$RecipeFromJson(Map json) => Recipe( username: json['username'] as String?, avatar: json['avatar'] as String?, materialList: - (json['materialList'] as List) - .map((e) => Material.fromJson(e as Map)) + (json['materialList'] as List?) + ?.map((e) => Material.fromJson(e as Map)) .toList(), stepList: - (json['stepList'] as List) - .map((e) => Step.fromJson(e as Map)) + (json['stepList'] as List?) + ?.map((e) => Step.fromJson(e as Map)) .toList(), recordList: (json['recordList'] as List) diff --git a/lib/utils/http_util.dart b/lib/utils/http_util.dart index 7c49fc1..0c7aa0e 100644 --- a/lib/utils/http_util.dart +++ b/lib/utils/http_util.dart @@ -2,6 +2,8 @@ import 'package:dio/dio.dart'; import 'package:food_hub_app/utils/sp_util.dart'; import 'package:food_hub_app/widgets/common/index.dart'; +import 'log_util.dart'; + class HttpUtil { static final HttpUtil _instance = HttpUtil._internal(); @@ -34,9 +36,9 @@ class HttpUtil { _dio.interceptors.add( InterceptorsWrapper( onRequest: (options, handler) { - print("请求URL: ${options.uri}"); + logger.d("请求URL: ${options.uri}"); if (options.data != null) { - print("请求参数: ${options.data}"); + logger.d("请求参数: ${options.data}"); } if (SPUtil.getString('token').isNotEmpty) { @@ -51,8 +53,8 @@ class HttpUtil { _dio.interceptors.add( InterceptorsWrapper( onResponse: (response, handler) { - print("响应状态码: ${response.statusCode}"); - print("响应数据: ${response.data}"); + logger.d("响应状态码: ${response.statusCode}"); + logger.d("响应数据: ${response.data}"); return handler.next(response); }, ), diff --git a/lib/utils/index.dart b/lib/utils/index.dart index 534392d..105c47f 100644 --- a/lib/utils/index.dart +++ b/lib/utils/index.dart @@ -14,4 +14,12 @@ String formatDateTime(DateTime dateTime, [String format = 'yyyy-MM-dd']) { final DateFormat formatter = DateFormat(format); // return formatter.format(dateTime); return Intl.withLocale('zh_CN', () => formatter.format(dateTime)); +} + +/// 通用列表转换函数 +List convertListResponse(dynamic data, T Function(Map) fromJson) { + if (data is List) { + return data.map((item) => fromJson(item as Map)).toList(); + } + throw FormatException('Expected a list of items for conversion, but got ${data.runtimeType}'); } \ No newline at end of file diff --git a/lib/utils/log_util.dart b/lib/utils/log_util.dart new file mode 100644 index 0000000..f571317 --- /dev/null +++ b/lib/utils/log_util.dart @@ -0,0 +1,12 @@ +import 'package:logger/logger.dart'; + +// 全局日志实例,在整个项目中共享 +final Logger logger = Logger( + printer: PrettyPrinter( + methodCount: 1, + colors: true, + dateTimeFormat: DateTimeFormat.dateAndTime, + ), + // 可选:配置输出到文件(需配合文件操作库) + // output: FileOutput(file: File('logs/app.log')), +); \ No newline at end of file diff --git a/lib/views/login.dart b/lib/views/login.dart index 571adad..83f07e4 100644 --- a/lib/views/login.dart +++ b/lib/views/login.dart @@ -1,13 +1,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart'; -import 'package:food_hub_app/api/recipe.dart'; import 'package:food_hub_app/api/session.dart'; -import 'package:food_hub_app/models/recipe.dart'; import 'package:food_hub_app/models/session.dart'; import 'package:food_hub_app/utils/sp_util.dart'; import 'package:food_hub_app/widgets/common/index.dart'; import 'package:form_builder_validators/form_builder_validators.dart'; -import 'package:shared_preferences/shared_preferences.dart'; import 'package:tdesign_flutter/tdesign_flutter.dart'; class LoginPage extends StatefulWidget { @@ -20,7 +17,8 @@ class LoginPage extends StatefulWidget { class _LoginPage extends State { final GlobalKey _formKey = GlobalKey(); - late String _username, _password; + String _username = "", _password = ""; + bool _isRemember = false; bool _isObscure = true; Color _eyeColor = Colors.grey; final List _loginMethod = [ @@ -29,39 +27,51 @@ class _LoginPage extends State { {"title": "wechat", "icon": Icons.wechat}, ]; + @override + void initState() { + super.initState(); + _loadRememberState(); + } + + Future _loadRememberState() async { + bool? isRemember = await SPUtil.getBool('isRemember'); + if (isRemember) { + setState(() { + _isRemember = true; + _username = SPUtil.getString('username'); + _password = SPUtil.getString('password'); + }); + } + } + + void handleRememberState() { + if (_isRemember) { + SPUtil.set('isRemember', true); + SPUtil.set('username', _username); + SPUtil.set('password', _password); + } else { + SPUtil.set('isRemember', false); + SPUtil.remove('username'); + SPUtil.remove('password'); + } + } + + void handleTokenState(String token) { + SPUtil.set('token', token); + } + void loginClick(BuildContext context) async { - SPUtil.clear(); - Session session = await loginApi("Cxx0822", "19940822Cxx"); - SPUtil.set('token', session.saToken.tokenValue); - - Recipe recipe = await queryRecipeByIdApi(614660173221957); - List recipeList = await queryRecipeByUserApi(691110779121733); - // SPUtil.set("token", session?.saToken?.tokenValue); - - // Navigator.pushNamed(context, '/home'); - return; - // 表单校验通过才会继续执行 if ((_formKey.currentState as FormState).validate()) { (_formKey.currentState as FormState).save(); - TDMessage.showMessage( - context: context, - visible: true, - icon: true, - content: "登录成功", - theme: MessageTheme.success, - duration: 3000, - ); + Session session = await loginApi(_username, _password); + showSuccessToast('登录成功'); + + handleRememberState(); + handleTokenState(session.saToken.tokenValue); Navigator.pushNamed(context, '/home'); } else { - TDMessage.showMessage( - context: context, - visible: true, - icon: true, - content: "请先输入信息", - theme: MessageTheme.error, - duration: 3000, - ); + showErrorToast('请先输入信息'); } } @@ -135,6 +145,8 @@ class _LoginPage extends State { const SizedBox(height: 10), FormBuilderTextField( name: 'username', + initialValue: _username, + keyboardType: TextInputType.text, decoration: formInputDecoration( hintText: "请输入账号", prefixIcon: Icons.person, @@ -154,8 +166,9 @@ class _LoginPage extends State { const SizedBox(height: 10), FormBuilderTextField( name: 'password', + initialValue: _password, + keyboardType: TextInputType.visiblePassword, obscureText: _isObscure, - // 是否显示文字 onSaved: (v) => _password = v!, validator: FormBuilderValidators.required(), decoration: InputDecoration( @@ -168,7 +181,6 @@ class _LoginPage extends State { suffixIcon: IconButton( icon: Icon(Icons.remove_red_eye, color: _eyeColor), onPressed: () { - // 修改 state 内部变量, 且需要界面内容更新, 需要使用 setState() setState(() { _isObscure = !_isObscure; _eyeColor = @@ -188,9 +200,11 @@ class _LoginPage extends State { return Row( children: [ Checkbox( - value: false, + value: _isRemember, onChanged: (bool? value) { - print("记住密码: $value"); + setState(() { + _isRemember = value ?? false; + }); }, ), const Text('记住密码', style: TextStyle(color: Colors.grey, fontSize: 14)), diff --git a/lib/views/record.dart b/lib/views/record.dart index 3ef1bc6..ed10441 100644 --- a/lib/views/record.dart +++ b/lib/views/record.dart @@ -1,10 +1,11 @@ import 'package:flutter/material.dart'; +import 'package:food_hub_app/api/recipe.dart'; +import 'package:food_hub_app/models/recipe.dart'; import 'package:food_hub_app/widgets/recipe/recipe_calendar.dart'; import 'package:food_hub_app/widgets/recipe/recipe_list.dart'; import 'package:food_hub_app/widgets/recipe/recipe_timeline.dart'; import 'package:tdesign_flutter/tdesign_flutter.dart'; -import '../models/recipe.dart'; class RecordPage extends StatefulWidget { const RecordPage({super.key}); @@ -15,33 +16,62 @@ class RecordPage extends StatefulWidget { class _RecordPageState extends State with SingleTickerProviderStateMixin { - final List recipeList = []; + List _recipeList = []; - final List recordList = []; + final List _recordList = []; late final TabController _tabController = TabController( length: 3, vsync: this, ); - @override - void initState() { - super.initState(); - } - - @override - void dispose() { - _tabController.dispose(); - super.dispose(); - } - - // 定义标签列表 final List tabs = [ const TDTab(text: '菜谱', icon: Icon(Icons.book)), const TDTab(text: '日历', icon: Icon(Icons.calendar_month)), const TDTab(text: '时间轴', icon: Icon(Icons.timeline)), ]; + @override + void initState() { + super.initState(); + _getRecipeList(); + _tabController.addListener(_handleTabChange); + } + + @override + void dispose() { + _tabController.removeListener(_handleTabChange); + _tabController.dispose(); + super.dispose(); + } + + void _handleTabChange() { + if (_tabController.indexIsChanging) { + return; + } + + // 根据当前选中的索引执行对应接口请求 + switch (_tabController.index) { + case 0: + _getRecipeList(); + break; + case 1: + print("2"); + break; + case 2: + print("3"); + break; + } + } + + Future _getRecipeList() async { + final result = await queryRecipeApi(RecipeQuery(category: "")); + + setState(() { + _recipeList = result; + }); + } + @override Widget build(BuildContext context) { return Padding( @@ -60,9 +90,9 @@ class _RecordPageState extends State child: TabBarView( controller: _tabController, children: [ - RecipeList(recipeList: recipeList), + RecipeList(recipeList: _recipeList), RecipeCalendar(), - RecipeTimeline(recordList: recordList), + RecipeTimeline(recordList: _recordList), ], ), ), diff --git a/lib/widgets/common/index.dart b/lib/widgets/common/index.dart index cf64c3d..a2b84cf 100644 --- a/lib/widgets/common/index.dart +++ b/lib/widgets/common/index.dart @@ -50,18 +50,18 @@ Text buttonText({required String text}) { return Text(text, style: TextStyle(color: Colors.white)); } -// void showSuccessToast(String message) { -// Fluttertoast.showToast( -// msg: message, -// toastLength: Toast.LENGTH_SHORT, -// gravity: ToastGravity.CENTER, -// timeInSecForIosWeb: 1, -// backgroundColor: Colors.green, -// textColor: Colors.white, -// fontSize: 16.0, -// ); -// } -// +void showSuccessToast(String message) { + Fluttertoast.showToast( + msg: message, + toastLength: Toast.LENGTH_SHORT, + gravity: ToastGravity.CENTER, + timeInSecForIosWeb: 1, + backgroundColor: Colors.green, + textColor: Colors.white, + fontSize: 16.0, + ); +} + void showErrorToast(String message) { Fluttertoast.showToast( msg: message, diff --git a/lib/widgets/recipe/recipe_card.dart b/lib/widgets/recipe/recipe_card.dart index 08d2817..0109d90 100644 --- a/lib/widgets/recipe/recipe_card.dart +++ b/lib/widgets/recipe/recipe_card.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:food_hub_app/models/recipe.dart'; @@ -18,7 +17,7 @@ class RecipeCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Image.network( - recipe.recordList[0].imageUrl, + 'http://172.29.101.108:8100/${recipe.recordList[0].imageUrl}', height: 200, width: double.infinity, fit: BoxFit.contain, @@ -38,104 +37,108 @@ class RecipeCard extends StatelessWidget { ), Padding( padding: const EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Text( - recipe.name, - style: const TextStyle( - fontSize: 18, - fontWeight: FontWeight.bold, - ), - maxLines: 1, // 限制单行,避免挤压按钮 - overflow: TextOverflow.ellipsis, - ), - ), - Row( - children: [ - IconButton( - icon: const Icon(Icons.edit, size: 14), - color: Colors.white, - style: ButtonStyle( - backgroundColor: WidgetStateProperty.all( - Colors.green, - ), - shape: WidgetStateProperty.all(CircleBorder()), - minimumSize: WidgetStateProperty.all(Size(20, 20)), - ), - onPressed: () {}, - ), - IconButton( - icon: const Icon(Icons.book, size: 14), - color: Colors.white, - style: ButtonStyle( - backgroundColor: WidgetStateProperty.all( - Colors.green, - ), - shape: WidgetStateProperty.all(CircleBorder()), - minimumSize: WidgetStateProperty.all(Size(20, 20)), - ), - onPressed: () {}, - ), - ], - ), - ], - ), - const SizedBox(height: 5), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Row( - children: [ - _buildIconText( - icon: Icons.food_bank, - text: recipe.category, - color: Colors.green, - ), - const SizedBox(width: 12), - _buildIconText( - icon: Icons.thumb_up_alt_outlined, - text: recipe.likeCount.toString(), - color: Colors.red, - ), - const SizedBox(width: 12), - _buildIconText( - icon: Icons.star_outline, - text: recipe.favouriteCount.toString(), - color: Colors.blue, - ), - const SizedBox(width: 12), - _buildIconText( - icon: Icons.comment_outlined, - text: recipe.commentCount.toString(), - color: Colors.deepOrange, - ), - ], - ), - Row( - children: [ - _buildIconText( - icon: Icons.date_range, - text: recipe.recordList[0].date, - color: Colors.red, - ), - ], - ), - ], - ), - ], - ), + child: _buildRecipeContent(), ), ], ), ); } + Widget _buildRecipeContent() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Text( + recipe.name, + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + ), + maxLines: 1, // 限制单行,避免挤压按钮 + overflow: TextOverflow.ellipsis, + ), + ), + Row( + children: [ + IconButton( + icon: const Icon(Icons.edit, size: 14), + color: Colors.white, + style: ButtonStyle( + backgroundColor: WidgetStateProperty.all( + Colors.green, + ), + shape: WidgetStateProperty.all(CircleBorder()), + minimumSize: WidgetStateProperty.all(Size(20, 20)), + ), + onPressed: () {}, + ), + IconButton( + icon: const Icon(Icons.book, size: 14), + color: Colors.white, + style: ButtonStyle( + backgroundColor: WidgetStateProperty.all( + Colors.green, + ), + shape: WidgetStateProperty.all(CircleBorder()), + minimumSize: WidgetStateProperty.all(Size(20, 20)), + ), + onPressed: () {}, + ), + ], + ), + ], + ), + const SizedBox(height: 5), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + children: [ + _buildIconText( + icon: Icons.food_bank, + text: recipe.category, + color: Colors.green, + ), + const SizedBox(width: 12), + _buildIconText( + icon: Icons.thumb_up_alt_outlined, + text: recipe.likeCount.toString(), + color: Colors.red, + ), + const SizedBox(width: 12), + _buildIconText( + icon: Icons.star_outline, + text: recipe.favouriteCount.toString(), + color: Colors.blue, + ), + const SizedBox(width: 12), + _buildIconText( + icon: Icons.comment_outlined, + text: recipe.commentCount.toString(), + color: Colors.deepOrange, + ), + ], + ), + Row( + children: [ + _buildIconText( + icon: Icons.date_range, + text: recipe.recordList[0].date, + color: Colors.red, + ), + ], + ), + ], + ), + ], + ); + } + // 通用图标文本组件 Widget _buildIconText({ required IconData icon, diff --git a/lib/widgets/recipe/recipe_list.dart b/lib/widgets/recipe/recipe_list.dart index d30c8de..d91e80c 100644 --- a/lib/widgets/recipe/recipe_list.dart +++ b/lib/widgets/recipe/recipe_list.dart @@ -1,6 +1,7 @@ -import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; import 'package:food_hub_app/models/recipe.dart'; import 'package:food_hub_app/widgets/recipe/recipe_card.dart'; +import 'package:tdesign_flutter/tdesign_flutter.dart'; class RecipeList extends StatelessWidget { final List recipeList; @@ -9,14 +10,21 @@ class RecipeList extends StatelessWidget { @override Widget build(BuildContext context) { - return ListView.separated( - itemCount: recipeList.length, - itemBuilder: (context, index) { - return RecipeCard(recipe: recipeList[index]); - }, - separatorBuilder: (context, index) { - return const SizedBox(height: 10); - }, - ); + if (recipeList.isEmpty) { + return const TDEmpty( + type: TDEmptyType.plain, + emptyText: '暂无数据', + ); + } else { + return ListView.separated( + itemCount: recipeList.length, + itemBuilder: (context, index) { + return RecipeCard(recipe: recipeList[index]); + }, + separatorBuilder: (context, index) { + return const SizedBox(height: 10); + }, + ); + } } } diff --git a/pubspec.lock b/pubspec.lock index 7aab282..ddc68c2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -541,6 +541,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "5.1.1" + logger: + dependency: "direct main" + description: + name: logger + sha256: "2621da01aabaf223f8f961e751f2c943dbb374dc3559b982f200ccedadaa6999" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.6.0" logging: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index cfbdd61..9b38884 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -46,6 +46,7 @@ dependencies: json_annotation: ^4.9.0 fluttertoast: ^8.2.0 shared_preferences: ^2.3.0 + logger: ^2.6.0 dependency_overrides: tdesign_flutter_adaptation: 3.16.0