diff --git a/lib/apis/user.dart b/lib/apis/user.dart index f68950b..182fc74 100644 --- a/lib/apis/user.dart +++ b/lib/apis/user.dart @@ -10,3 +10,7 @@ Future queryUserApi(int number) { converter: (data) => User.fromJson(data), ); } + +Future updateUserApi(int id, User user) { + return httpUtil.put("/user/$id", data: user); +} diff --git a/lib/models/recipe.dart b/lib/models/recipe.dart index 6663d2b..4f3ec83 100644 --- a/lib/models/recipe.dart +++ b/lib/models/recipe.dart @@ -126,7 +126,6 @@ class Recipe { bool isShare; int userId; String username; - String avatar; List materialList; List stepList; List recordList; @@ -143,7 +142,6 @@ class Recipe { required this.isShare, required this.userId, required this.username, - required this.avatar, required this.materialList, required this.stepList, required this.recordList, @@ -166,7 +164,6 @@ class Recipe { isShare: true, userId: 0, username: '', - avatar: '', materialList: [], stepList: [], recordList: [], diff --git a/lib/models/recipe.g.dart b/lib/models/recipe.g.dart index 708c04a..f8fee44 100644 --- a/lib/models/recipe.g.dart +++ b/lib/models/recipe.g.dart @@ -89,7 +89,6 @@ Recipe _$RecipeFromJson(Map json) => Recipe( isShare: json['isShare'] as bool, userId: (json['userId'] as num).toInt(), username: json['username'] as String, - avatar: json['avatar'] as String, materialList: (json['materialList'] as List) .map((e) => RecipeMaterial.fromJson(e as Map)) @@ -125,7 +124,6 @@ Map _$RecipeToJson(Recipe instance) => { 'isShare': instance.isShare, 'userId': instance.userId, 'username': instance.username, - 'avatar': instance.avatar, 'materialList': instance.materialList, 'stepList': instance.stepList, 'recordList': instance.recordList, diff --git a/lib/provider/food_provider.dart b/lib/provider/food_provider.dart index 894a6aa..e18d267 100644 --- a/lib/provider/food_provider.dart +++ b/lib/provider/food_provider.dart @@ -384,7 +384,7 @@ class FoodProvider with ChangeNotifier { summaryStats = statsResult; recordStats = recordStatsResult; categoryStats = categoryStatsResult; - rankStats = rankStatsResult; + rankStats = rankStatsResult.take(15).toList(); if (recordStats.isNotEmpty) { double sumValue = recordStats.fold( diff --git a/lib/provider/user_provider.dart b/lib/provider/user_provider.dart index ff4e29c..602a647 100644 --- a/lib/provider/user_provider.dart +++ b/lib/provider/user_provider.dart @@ -7,8 +7,9 @@ import 'package:food_hub_app/models/session.dart'; class UserProvider with ChangeNotifier { late User currentUser = User.getEmpty(); bool isLoading = false; - String error = ''; + String? error = ''; List momentList = []; + late User userFormItem; Future refreshUser(int id) async { if (isLoading) return; @@ -48,4 +49,56 @@ class UserProvider with ChangeNotifier { notifyListeners(); } } + + void initUserForm(User user) { + userFormItem = user; + notifyListeners(); + } + + void updateUserFormItem({ + String? username, + int? gender, + String? phoneNumber, + String? email, + DateTime? birthDate, + String? avatar, + List? area, + String? address, + String? job, + List? tags, + String? description + }) { + if (username != null) userFormItem.username = username; + if (gender != null) userFormItem.gender = gender; + if (phoneNumber != null) userFormItem.phoneNumber = phoneNumber; + if (email != null) userFormItem.email = email; + if (birthDate != null) userFormItem.birthDate = birthDate; + if (avatar != null) userFormItem.avatar = avatar; + if (area != null) userFormItem.area = area; + if (address != null) userFormItem.address = address; + if (job != null) userFormItem.job = job; + if (tags != null) userFormItem.tags = tags; + if (description != null) userFormItem.description = description; + notifyListeners(); + } + + Future handleUser() async { + if (isLoading) return true; + + try { + isLoading = true; + error = null; + notifyListeners(); + + await updateUserApi(userFormItem.id!, userFormItem); + return true; + } catch (e) { + error = '处理数据失败: $e'; + debugPrint('处理数据失败: $e'); + return false; + } finally { + isLoading = false; + notifyListeners(); + } + } } diff --git a/lib/views/login.dart b/lib/views/login.dart index e8660e6..a905cac 100644 --- a/lib/views/login.dart +++ b/lib/views/login.dart @@ -33,17 +33,26 @@ class _LoginPage extends State { @override void initState() { super.initState(); - _loadRememberState(); + _loadRememberState(); } Future _loadRememberState() async { bool? isRemember = SPUtil.getBool('isRemember'); - if (isRemember) { - setState(() { - _isRemember = true; - _username = SPUtil.getString('username'); - _password = SPUtil.getString('password'); - }); + if (isRemember == true) { + final username = SPUtil.getString('username'); + final password = SPUtil.getString('password'); + + if (username.isNotEmpty && password.isNotEmpty) { + setState(() { + _isRemember = true; + _username = username; + _password = password; + }); + + WidgetsBinding.instance.addPostFrameCallback((_) { + loginClick(); + }); + } } } diff --git a/lib/views/moment.dart b/lib/views/moment.dart index 9a63a56..770e91e 100644 --- a/lib/views/moment.dart +++ b/lib/views/moment.dart @@ -80,6 +80,7 @@ class _MomentPageState extends State { Widget _buildMomentList(FoodProvider provider) { return ListView.separated( + padding: const EdgeInsets.only(bottom: 80), controller: _scrollController, itemCount: provider.momentList.length, separatorBuilder: (context, index) => SizedBox(height: 8), diff --git a/lib/views/moment_form.dart b/lib/views/moment_form.dart index 5ec4aa3..41f2be9 100644 --- a/lib/views/moment_form.dart +++ b/lib/views/moment_form.dart @@ -10,8 +10,6 @@ import 'package:food_hub_app/provider/food_provider.dart'; import 'package:food_hub_app/utils/minio_utils.dart'; import 'package:food_hub_app/widgets/common/form.dart'; import 'package:food_hub_app/widgets/common/image.dart'; -import 'package:liquid_glass_widgets/liquid_glass_widgets.dart'; -import 'package:liquid_glass_widgets/widgets/containers/glass_card.dart'; import 'package:provider/provider.dart'; class MomentForm extends StatefulWidget { @@ -152,7 +150,7 @@ class _MomentFormState extends State { // 限制选择数量 final filesToUpload = result.files.take(remainingCount).toList(); LoadingDialog.show(context, message: '上传中'); - + try { final newImageUrls = []; // 逐个上传图片 @@ -215,14 +213,12 @@ class _MomentFormState extends State { Widget build(BuildContext context) { final provider = context.watch(); - return SingleChildScrollView( - child: Padding( - padding: EdgeInsets.all(10), - child: GlassCard( - useOwnLayer: true, - settings: LiquidGlassSettings( - glassColor: Theme.of(context).scaffoldBackgroundColor, - ), + return AnimatedPadding( + duration: const Duration(milliseconds: 200), + padding: MediaQuery.of(context).viewInsets, + child: SingleChildScrollView( + child: Padding( + padding: EdgeInsets.all(16), child: _buildFormBuilder(provider), ), ), diff --git a/lib/views/moment_user.dart b/lib/views/moment_user.dart index d813db0..686cc0d 100644 --- a/lib/views/moment_user.dart +++ b/lib/views/moment_user.dart @@ -33,11 +33,14 @@ class _MomentUserPageState extends State { } return Scaffold( + backgroundColor: Colors.transparent, appBar: AppBar( - title: Text('我的朋友圈', style: const TextStyle(color: Colors.white)), - backgroundColor: Theme.of(context).colorScheme.primary, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + title: Text('我的朋友圈', style: Theme.of(context).textTheme.titleLarge), + centerTitle: true, + automaticallyImplyLeading: false, leading: IconButton( - icon: const Icon(Icons.arrow_back, color: Colors.white), + icon: const Icon(Icons.arrow_back), onPressed: () => Navigator.pop(context), ), ), diff --git a/lib/views/profile.dart b/lib/views/profile.dart index f9806c3..2ca5973 100644 --- a/lib/views/profile.dart +++ b/lib/views/profile.dart @@ -4,6 +4,7 @@ import 'package:flutter_common/widget/common_widget.dart'; import 'package:flutter_common/widget/dialog_widget.dart'; import 'package:food_hub_app/provider/app_provider.dart'; import 'package:food_hub_app/provider/user_provider.dart'; +import 'package:food_hub_app/views/profile_form.dart'; import 'package:food_hub_app/widgets/profile/basic_info.dart'; import 'package:liquid_glass_widgets/liquid_glass_widgets.dart'; import 'package:liquid_glass_widgets/widgets/containers/glass_card.dart'; @@ -42,11 +43,26 @@ class ProfilePageState extends State { ); } + void _onTapInfo(UserProvider provider) { + provider.initUserForm(provider.currentUser); + + showModalBottomSheet( + context: context, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + isScrollControlled: true, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.vertical(top: Radius.circular(16)), + ), + builder: (context) => ProfileForm(), + ); + } + void _onTapMoment() { Navigator.pushNamed(context, '/momentUser'); } Widget _buildFunctionButtons(BuildContext context) { + final provider = context.watch(); final colors = Theme.of(context).colorScheme; return GlassCard( @@ -58,10 +74,7 @@ class ProfilePageState extends State { _buildFunctionButton( icon: Icons.account_circle, text: '基本资料', - onTap: () { - // 跳转到编辑资料页面 - // LogUtils.i('点击编辑资料'); - }, + onTap: () => _onTapInfo(provider), ), const Divider(height: 1, thickness: 0.2), _buildFunctionButton( @@ -155,8 +168,6 @@ class ProfilePageState extends State { children: [ if (provider.isLoading) buildLoadingIndicator() - else if (provider.error.isNotEmpty) - Text(provider.error) else SingleChildScrollView( padding: const EdgeInsets.only(bottom: 90), diff --git a/lib/views/profile_form.dart b/lib/views/profile_form.dart new file mode 100644 index 0000000..7ef1ece --- /dev/null +++ b/lib/views/profile_form.dart @@ -0,0 +1,251 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_common/widget/dialog_widget.dart'; +import 'package:flutter_common/widget/loading_widget.dart'; +import 'package:flutter_form_builder/flutter_form_builder.dart'; +import 'package:flutter_input_chips/flutter_input_chips.dart'; +import 'package:form_builder_validators/form_builder_validators.dart'; +import 'package:food_hub_app/provider/user_provider.dart'; +import 'package:food_hub_app/widgets/common/form.dart'; +import 'package:intl/intl.dart'; + +import 'package:provider/provider.dart'; + +class ProfileForm extends StatefulWidget { + const ProfileForm({super.key}); + + @override + State createState() => _ProfileFormState(); +} + +class _ProfileFormState extends State { + final _formKey = GlobalKey(); + + @override + void initState() { + super.initState(); + } + + Widget _buildFormBuilder(UserProvider provider) { + final double sizeBoxHeight = 8; + + return FormBuilder( + key: _formKey, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + buildFormLabel(context: context, text: '用户名', isRequired: true), + SizedBox(height: sizeBoxHeight), + FormBuilderTextField( + name: 'username', + initialValue: provider.userFormItem.username, + onChanged: (value) { + provider.updateUserFormItem(username: value); + }, + decoration: buildInputDecoration( + context: context, + hintText: '请输入用户名', + ), + validator: FormBuilderValidators.required(errorText: '请输入用户名'), + ), + SizedBox(height: sizeBoxHeight), + + buildFormLabel(context: context, text: '性别', isRequired: true), + SizedBox(height: sizeBoxHeight), + FormBuilderDropdown( + name: 'gender', + initialValue: provider.userFormItem.gender, + decoration: buildInputDecoration( + context: context, + hintText: '请选择性别', + ), + items: const [ + DropdownMenuItem(value: 1, child: Text('男')), + DropdownMenuItem(value: 2, child: Text('女')), + ], + onChanged: (value) { + provider.updateUserFormItem(gender: value); + }, + ), + SizedBox(height: sizeBoxHeight), + + buildFormLabel(context: context, text: '手机号', isRequired: true), + SizedBox(height: sizeBoxHeight), + FormBuilderTextField( + name: 'phoneNumber', + initialValue: provider.userFormItem.phoneNumber, + keyboardType: TextInputType.phone, + decoration: buildInputDecoration( + context: context, + hintText: '请输入手机号', + ), + onChanged: (value) { + provider.updateUserFormItem(phoneNumber: value); + }, + validator: FormBuilderValidators.compose([ + FormBuilderValidators.required(errorText: '请输入手机号'), + FormBuilderValidators.match( + RegExp(r'^1[3-9]\d{9}$'), + errorText: '请输入正确的11位手机号', + ), + ]), + ), + SizedBox(height: sizeBoxHeight), + + buildFormLabel(context: context, text: '邮箱', isRequired: true), + SizedBox(height: sizeBoxHeight), + FormBuilderTextField( + name: 'email', + initialValue: provider.userFormItem.email, + keyboardType: TextInputType.emailAddress, + decoration: buildInputDecoration( + context: context, + hintText: '请输入邮箱', + ), + onChanged: (value) { + provider.updateUserFormItem(email: value); + }, + validator: FormBuilderValidators.compose([ + FormBuilderValidators.email(errorText: '邮箱格式不正确'), + ]), + ), + SizedBox(height: sizeBoxHeight), + + buildFormLabel(context: context, text: '出生日期', isRequired: true), + SizedBox(height: sizeBoxHeight), + FormBuilderDateTimePicker( + name: 'birthDate', + initialValue: provider.userFormItem.birthDate, + inputType: InputType.date, + format: DateFormat('yyyy-MM-dd'), + firstDate: DateTime(1900), + lastDate: DateTime.now(), + decoration: buildInputDecoration( + context: context, + hintText: '请选择出生日期', + ), + onChanged: (value) { + provider.updateUserFormItem(birthDate: value); + }, + ), + SizedBox(height: sizeBoxHeight), + + buildFormLabel(context: context, text: '详细地址', isRequired: false), + SizedBox(height: sizeBoxHeight), + FormBuilderTextField( + name: 'address', + initialValue: provider.userFormItem.address, + decoration: buildInputDecoration( + context: context, + hintText: '请输入详细地址', + ), + onChanged: (value) { + provider.updateUserFormItem(address: value); + }, + ), + SizedBox(height: sizeBoxHeight), + + buildFormLabel(context: context, text: '职业', isRequired: false), + SizedBox(height: sizeBoxHeight), + FormBuilderTextField( + name: 'job', + initialValue: provider.userFormItem.job, + decoration: buildInputDecoration( + context: context, + hintText: '请输入职业', + ), + onChanged: (value) { + provider.updateUserFormItem(job: value); + }, + ), + SizedBox(height: sizeBoxHeight), + + buildFormLabel(context: context, text: '标签', isRequired: false), + SizedBox(height: sizeBoxHeight), + FormBuilderField>( + name: 'tags', + initialValue: provider.userFormItem.tags, + validator: FormBuilderValidators.minLength( + 1, + errorText: '至少添加一个标签', + ), + builder: (FormFieldState> field) { + return FlutterInputChips( + padding: EdgeInsets.all(0), + initialValue: field.value ?? [], + onChanged: (value) { + provider.updateUserFormItem(tags: value); + }, + inputDecoration: buildInputDecoration( + context: context, + hintText: '请输入标签,多个标签用回车键隔开', + ), + ); + }, + ), + SizedBox(height: sizeBoxHeight), + + buildFormLabel(context: context, text: '简介', isRequired: false), + SizedBox(height: sizeBoxHeight), + FormBuilderTextField( + name: 'description', + initialValue: provider.userFormItem.description, + decoration: buildInputDecoration( + context: context, + hintText: '请输入简介', + ), + onChanged: (value) { + provider.updateUserFormItem(description: value); + }, + ), + SizedBox(height: sizeBoxHeight), + + buildFormButtonGroup( + context: context, + isShowDelete: false, + onConfirm: () => _submitForm(provider), + onDelete: () => {}, + ), + ], + ), + ); + } + + /// 提交表单 + void _submitForm(UserProvider provider) async { + if (_formKey.currentState?.saveAndValidate() ?? false) { + LoadingDialog.show(context, message: '提交中'); + + final result = await provider.handleUser(); + if (result == true) { + LoadingDialog.hide(context); + + showSuccessTip(context, '更新信息成功'); + + Future.delayed(Duration(milliseconds: 1500), () { + if (mounted) { + Navigator.pop(context); + } + }); + } else { + LoadingDialog.hide(context); + showErrorTip(context, '更新信息失败'); + } + } + } + + @override + Widget build(BuildContext context) { + final provider = context.watch(); + + return AnimatedPadding( + duration: const Duration(milliseconds: 200), + padding: MediaQuery.of(context).viewInsets, + child: SingleChildScrollView( + child: Padding( + padding: EdgeInsets.all(16), + child: _buildFormBuilder(provider), + ), + ), + ); + } +} diff --git a/lib/views/profile_user.dart b/lib/views/profile_user.dart index d81e5dd..f2df824 100644 --- a/lib/views/profile_user.dart +++ b/lib/views/profile_user.dart @@ -99,8 +99,6 @@ class ProfileUserPageState extends State { children: [ if (provider.isLoading) buildLoadingIndicator() - else if (provider.error.isNotEmpty) - Text(provider.error) else _buildContent(provider), ], diff --git a/lib/views/recipe_form.dart b/lib/views/recipe_form.dart index dd1d971..e5764b1 100644 --- a/lib/views/recipe_form.dart +++ b/lib/views/recipe_form.dart @@ -8,8 +8,6 @@ import 'package:food_hub_app/widgets/common/index.dart'; import 'package:form_builder_validators/form_builder_validators.dart'; import 'package:flutter_common/utils/toast_util.dart'; import 'package:flutter_common/widget/loading_widget.dart'; -import 'package:liquid_glass_widgets/liquid_glass_widgets.dart'; -import 'package:liquid_glass_widgets/widgets/containers/glass_card.dart'; import 'package:provider/provider.dart'; class RecipeForm extends StatefulWidget { @@ -551,14 +549,12 @@ class _RecipeFormState extends State { Widget build(BuildContext context) { final provider = context.watch(); - return SingleChildScrollView( - child: Padding( - padding: EdgeInsets.all(10), - child: GlassCard( - useOwnLayer: true, - settings: LiquidGlassSettings( - glassColor: Theme.of(context).scaffoldBackgroundColor, - ), + return AnimatedPadding( + duration: const Duration(milliseconds: 200), + padding: MediaQuery.of(context).viewInsets, + child: SingleChildScrollView( + child: Padding( + padding: EdgeInsets.all(16), child: Column( children: [ _buildStepIndicator(), diff --git a/lib/views/record.dart b/lib/views/record.dart index c255be9..4d50065 100644 --- a/lib/views/record.dart +++ b/lib/views/record.dart @@ -88,9 +88,6 @@ class _RecordPageState extends State { showModalBottomSheet( context: context, - constraints: BoxConstraints( - minHeight: 600, - ), backgroundColor: Theme.of(context).scaffoldBackgroundColor, isScrollControlled: true, shape: const RoundedRectangleBorder( diff --git a/lib/views/record_form.dart b/lib/views/record_form.dart index 2ab6786..794f024 100644 --- a/lib/views/record_form.dart +++ b/lib/views/record_form.dart @@ -11,7 +11,6 @@ import 'package:food_hub_app/utils/minio_utils.dart'; import 'package:food_hub_app/widgets/common/form.dart'; import 'package:food_hub_app/widgets/common/image.dart'; import 'package:intl/intl.dart'; -import 'package:liquid_glass_widgets/liquid_glass_widgets.dart'; import 'package:provider/provider.dart'; @@ -333,14 +332,12 @@ class _RecordFormState extends State { Widget build(BuildContext context) { final provider = context.watch(); - return SingleChildScrollView( - child: Padding( - padding: EdgeInsets.all(10), - child: GlassCard( - useOwnLayer: true, - settings: LiquidGlassSettings( - glassColor: Theme.of(context).scaffoldBackgroundColor, - ), + return AnimatedPadding( + duration: const Duration(milliseconds: 200), + padding: MediaQuery.of(context).viewInsets, + child: SingleChildScrollView( + child: Padding( + padding: EdgeInsets.all(16), child: _buildFormBuilder(provider), ), ), diff --git a/lib/widgets/common/image.dart b/lib/widgets/common/image.dart index b1b8c8e..2fdec09 100644 --- a/lib/widgets/common/image.dart +++ b/lib/widgets/common/image.dart @@ -201,7 +201,7 @@ Widget buildImageUploadButton({ borderRadius: BorderRadius.circular(8), child: Container( width: double.infinity, - height: 250, + height: 180, decoration: BoxDecoration( color: colors.surface, borderRadius: BorderRadius.circular(8), diff --git a/pubspec.lock b/pubspec.lock index cf4454c..49edd44 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -421,6 +421,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "0.1.5" + flutter_input_chips: + dependency: "direct main" + description: + name: flutter_input_chips + sha256: "4b45df0c8b80a23db86850d8f892144dc796f3f6eb13ebd8bcb2d242ec921e22" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.0" flutter_lints: dependency: "direct dev" description: diff --git a/pubspec.yaml b/pubspec.yaml index b8d6246..7aa8b31 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1 +1 @@ -name: food_hub_app description: "A new Flutter project." # 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 fonts to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.8 liquid_glass_widgets: ^0.16.1 provider: ^6.1.1 timelines_plus: ^1.0.7 table_calendar: ^3.1.3 toggle_switch: ^2.3.0 flutter_form_builder: ^10.0.0 form_builder_validators: ^11.1.2 intl: ^0.20.2 json_annotation: ^4.9.0 logger: ^2.6.0 photo_view: ^0.15.0 flutter_carousel_widget: ^3.1.0 easy_refresh: ^3.4.0 file_picker: ^10.3.3 share_plus: ^11.0.0 path_provider: ^2.1.5 cached_network_image: ^3.4.1 flutter_common: path: ..\flutter_common dependency_overrides: tdesign_flutter_adaptation: 3.16.0 image_picker: 1.0.8 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 # flutter pub run build_runner build build_runner: ^2.4.5 json_serializable: ^6.7.1 # 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 fonts 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 fonts family name, and a "fonts" key with a # list giving the asset and other descriptors for the fonts. 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 fonts: - family: CustomFont fonts: - asset: fonts/custom.ttf \ No newline at end of file +name: food_hub_app description: "A new Flutter project." # 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 fonts to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.8 liquid_glass_widgets: ^0.16.1 provider: ^6.1.1 timelines_plus: ^1.0.7 table_calendar: ^3.1.3 toggle_switch: ^2.3.0 flutter_form_builder: ^10.0.0 form_builder_validators: ^11.1.2 intl: ^0.20.2 json_annotation: ^4.9.0 logger: ^2.6.0 photo_view: ^0.15.0 flutter_carousel_widget: ^3.1.0 easy_refresh: ^3.4.0 file_picker: ^10.3.3 share_plus: ^11.0.0 path_provider: ^2.1.5 cached_network_image: ^3.4.1 flutter_input_chips: ^1.1.0 flutter_common: path: ..\flutter_common dependency_overrides: tdesign_flutter_adaptation: 3.16.0 image_picker: 1.0.8 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 # flutter pub run build_runner build build_runner: ^2.4.5 json_serializable: ^6.7.1 # 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 fonts 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 fonts family name, and a "fonts" key with a # list giving the asset and other descriptors for the fonts. 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 fonts: - family: CustomFont fonts: - asset: fonts/custom.ttf \ No newline at end of file