diff --git a/assets/icons/clock_circle.png b/assets/icons/clock_circle.png new file mode 100644 index 00000000..9d94ffc1 Binary files /dev/null and b/assets/icons/clock_circle.png differ diff --git a/assets/icons/edit.png b/assets/icons/edit.png new file mode 100644 index 00000000..1cf9ef63 Binary files /dev/null and b/assets/icons/edit.png differ diff --git a/assets/icons/environment.png b/assets/icons/environment.png new file mode 100644 index 00000000..2aa9b711 Binary files /dev/null and b/assets/icons/environment.png differ diff --git a/assets/icons/phone_circle.png b/assets/icons/phone_circle.png new file mode 100644 index 00000000..462dae87 Binary files /dev/null and b/assets/icons/phone_circle.png differ diff --git a/assets/icons/reward.png b/assets/icons/reward.png new file mode 100644 index 00000000..2683a0d1 Binary files /dev/null and b/assets/icons/reward.png differ diff --git a/assets/icons/tag.png b/assets/icons/tag.png new file mode 100644 index 00000000..a74bdeff Binary files /dev/null and b/assets/icons/tag.png differ diff --git a/lib/constants/api.dart b/lib/constants/api.dart index c80aeef6..75282743 100644 --- a/lib/constants/api.dart +++ b/lib/constants/api.dart @@ -153,8 +153,32 @@ class _Search { String get homeSearch => "/user/search/search"; } +class _Task { + ///查询所有的任务发布信息 + String get hallList => '/user/taskRelease/list'; + + ///查询我的任务发布信息 + String get myTask => '/user/taskRelease/myList'; + + ///查询我的任务接单信息 + String get myTakeTask => '/user/taskRelease/myOrder'; + + ///发布任务 + String get publish => '/user/taskRelease/insert'; + + ///取消任务 + String get cancel => '/user/taskRelease/cancel'; + + ///接取任务 + String get take => '/user/taskRelease/access'; + + ///完成任务 + String get finish => '/user/taskRelease/finish'; +} + class _Manager { _Facility facility = _Facility(); + _Task task = _Task(); ///获取业委会列表 String get commiteeStaff => '/ownersCommittee/findAll'; diff --git a/lib/constants/application_objects.dart b/lib/constants/application_objects.dart index dcc86411..74b1b3d0 100644 --- a/lib/constants/application_objects.dart +++ b/lib/constants/application_objects.dart @@ -31,6 +31,7 @@ import 'package:aku_new_community/ui/manager/questionnaire/questionnaire_page.da import 'package:aku_new_community/ui/profile/car/car_manage_page.dart'; import 'package:aku_new_community/ui/profile/car_parking/car_parking_page.dart'; import 'package:aku_new_community/ui/profile/house/house_owners_page.dart'; +import 'package:aku_new_community/ui/service/task_page.dart'; import 'package:flutter/material.dart'; ///应用对象 @@ -99,7 +100,7 @@ List appObjects = [ AO('住房说明', R.ASSETS_ICONS_FUNC_ZFSM_PNG, () => HouseIntroducePage()), AO('智慧养老', Assets.icons.provideAged.path, () => OldAgeSupportPageSimple()), AO('周边服务', Assets.icons.nearbyService.path, null), - AO('小蜜蜂任务', Assets.icons.beeTask.path, null), + AO('小蜜蜂任务', Assets.icons.beeTask.path, () => TaskPage()), AO('自营商城', Assets.icons.shoppingMall.path, null), AO('邻家宠物', Assets.icons.nearbyPet.path, null), AO('共享停车', Assets.icons.sharePark.path, null), diff --git a/lib/extensions/color_ext.dart b/lib/extensions/color_ext.dart new file mode 100644 index 00000000..71ed41b3 --- /dev/null +++ b/lib/extensions/color_ext.dart @@ -0,0 +1,11 @@ +import 'package:flutter/material.dart'; + +extension ColorExt on Color { + ///获得此颜色的互补色 + Color get complementary { + var r = ~this.red; + var g = ~this.green; + var b = ~this.blue; + return Color.fromARGB(this.alpha, r, g, b); + } +} diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart index 829708ee..f8d801c1 100644 --- a/lib/gen/assets.gen.dart +++ b/lib/gen/assets.gen.dart @@ -190,6 +190,10 @@ class $AssetsIconsGen { /// File path: assets/icons/change.png AssetGenImage get change => const AssetGenImage('assets/icons/change.png'); + /// File path: assets/icons/clock_circle.png + AssetGenImage get clockCircle => + const AssetGenImage('assets/icons/clock_circle.png'); + /// File path: assets/icons/clock_success.png AssetGenImage get clockSuccess => const AssetGenImage('assets/icons/clock_success.png'); @@ -246,6 +250,13 @@ class $AssetsIconsGen { AssetGenImage get deviceAlarm => const AssetGenImage('assets/icons/device_alarm.png'); + /// File path: assets/icons/edit.png + AssetGenImage get edit => const AssetGenImage('assets/icons/edit.png'); + + /// File path: assets/icons/environment.png + AssetGenImage get environment => + const AssetGenImage('assets/icons/environment.png'); + /// File path: assets/icons/examine.png AssetGenImage get examine => const AssetGenImage('assets/icons/examine.png'); @@ -670,6 +681,10 @@ class $AssetsIconsGen { /// File path: assets/icons/phone.png AssetGenImage get phone => const AssetGenImage('assets/icons/phone.png'); + /// File path: assets/icons/phone_circle.png + AssetGenImage get phoneCircle => + const AssetGenImage('assets/icons/phone_circle.png'); + /// File path: assets/icons/projection_screen.png AssetGenImage get projectionScreen => const AssetGenImage('assets/icons/projection_screen.png'); @@ -695,6 +710,9 @@ class $AssetsIconsGen { /// File path: assets/icons/report.png AssetGenImage get report => const AssetGenImage('assets/icons/report.png'); + /// File path: assets/icons/reward.png + AssetGenImage get reward => const AssetGenImage('assets/icons/reward.png'); + /// File path: assets/icons/second_hand.png AssetGenImage get secondHand => const AssetGenImage('assets/icons/second_hand.png'); @@ -804,6 +822,9 @@ class $AssetsIconsGen { AssetGenImage get tabbarUserNo => const AssetGenImage('assets/icons/tabbar_user_no.png'); + /// File path: assets/icons/tag.png + AssetGenImage get tag => const AssetGenImage('assets/icons/tag.png'); + /// File path: assets/icons/test_kingcion.png AssetGenImage get testKingcion => const AssetGenImage('assets/icons/test_kingcion.png'); diff --git a/lib/generated_plugin_registrant.dart b/lib/generated_plugin_registrant.dart index 7d207a3c..5541704d 100644 --- a/lib/generated_plugin_registrant.dart +++ b/lib/generated_plugin_registrant.dart @@ -8,7 +8,6 @@ import 'package:device_info_plus_web/device_info_plus_web.dart'; import 'package:image_picker_for_web/image_picker_for_web.dart'; import 'package:package_info_plus_web/package_info_plus_web.dart'; -import 'package:shared_preferences_web/shared_preferences_web.dart'; import 'package:url_launcher_web/url_launcher_web.dart'; import 'package:flutter_web_plugins/flutter_web_plugins.dart'; @@ -18,7 +17,6 @@ void registerPlugins(Registrar registrar) { DeviceInfoPlusPlugin.registerWith(registrar); ImagePickerPlugin.registerWith(registrar); PackageInfoPlugin.registerWith(registrar); - SharedPreferencesPlugin.registerWith(registrar); UrlLauncherPlugin.registerWith(registrar); registrar.registerMessageHandler(); } diff --git a/lib/main.dart b/lib/main.dart index fb1af376..e4c18ec6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -51,31 +51,37 @@ class _MyAppState extends State { FocusManager.instance.primaryFocus!.unfocus(); } }, - child: ScreenUtilInit( - designSize: Size(750, 1334), - builder: () => GetMaterialApp( - onGenerateTitle: (context) => S.of(context)!.appName, - debugShowCheckedModeBanner: false, - theme: AppTheme.theme, - home: SplashPage(), - //国际化支持 - localizationsDelegates: [ - S.delegate, - GlobalMaterialLocalizations.delegate, - GlobalWidgetsLocalizations.delegate, - GlobalCupertinoLocalizations.delegate, - ], - supportedLocales: [const Locale('zh')], - locale: Locale('zh'), - //builder: BotToastInit(), - builder: (context, child) { - return MediaQuery( - //设置文字大小不随系统设置改变 - data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0), - child: BotToastInit().call(context, child), - ); - }, - navigatorObservers: [BotToastNavigatorObserver()], + child: MediaQuery( + data: MediaQueryData.fromWindow(WidgetsBinding.instance!.window), + child: ScreenUtilInit( + designSize: Size(750, 1334), + // minTextAdapt: true, + // splitScreenMode: true, + builder: () => GetMaterialApp( + onGenerateTitle: (context) => S.of(context)!.appName, + debugShowCheckedModeBanner: false, + theme: AppTheme.theme, + home: SplashPage(), + //国际化支持 + localizationsDelegates: [ + S.delegate, + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + ], + supportedLocales: [const Locale('zh')], + locale: Locale('zh'), + //builder: BotToastInit(), + builder: (context, child) { + ScreenUtil.setContext(context); + return MediaQuery( + //设置文字大小不随系统设置改变 + data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0), + child: BotToastInit().call(context, child), + ); + }, + navigatorObservers: [BotToastNavigatorObserver()], + ), ), ), ), diff --git a/lib/model/community/activity_detail_model.dart b/lib/model/community/activity_detail_model.dart index 00773439..d522cc98 100644 --- a/lib/model/community/activity_detail_model.dart +++ b/lib/model/community/activity_detail_model.dart @@ -1,5 +1,5 @@ import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; class ActivityDetailModel { int? id; diff --git a/lib/model/community/activity_item_model.dart b/lib/model/community/activity_item_model.dart index 88dd52dd..4163aca2 100644 --- a/lib/model/community/activity_item_model.dart +++ b/lib/model/community/activity_item_model.dart @@ -1,6 +1,6 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; class ActivityItemModel { diff --git a/lib/model/community/board_model.dart b/lib/model/community/board_model.dart index 3f60a779..5f3ab635 100644 --- a/lib/model/community/board_model.dart +++ b/lib/model/community/board_model.dart @@ -1,5 +1,5 @@ import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; class BoardItemModel { int? id; diff --git a/lib/model/community/event_item_model.dart b/lib/model/community/event_item_model.dart index 412ee678..623a4b87 100644 --- a/lib/model/community/event_item_model.dart +++ b/lib/model/community/event_item_model.dart @@ -1,5 +1,5 @@ import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; class EventItemModel { int? id; @@ -30,10 +30,12 @@ class EventItemModel { this.gambitTitle, this.createDate, this.likeNames, - this.likeNamesNum, + this.likeNamesNum, this.imgUrls, this.headSculptureImgUrl, - this.gambitThemeCommentVoList,this.gambitThemeCommentNum,this.views}); + this.gambitThemeCommentVoList, + this.gambitThemeCommentNum, + this.views}); EventItemModel.fromJson(Map json) { id = json['id']; diff --git a/lib/model/community/my_event_item_model.dart b/lib/model/community/my_event_item_model.dart index adb3d6ec..b28a52d2 100644 --- a/lib/model/community/my_event_item_model.dart +++ b/lib/model/community/my_event_item_model.dart @@ -1,5 +1,5 @@ import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; class MyEventItemModel { int? id; diff --git a/lib/model/manager/advice_detail_model.dart b/lib/model/manager/advice_detail_model.dart index 07751543..62b828b7 100644 --- a/lib/model/manager/advice_detail_model.dart +++ b/lib/model/manager/advice_detail_model.dart @@ -1,5 +1,5 @@ import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; class AdviceDetailModel { AppAdviceDetailVo? appAdviceDetailVo; diff --git a/lib/model/manager/suggestion_or_complain_model.dart b/lib/model/manager/suggestion_or_complain_model.dart index 16a1b040..b66ee463 100644 --- a/lib/model/manager/suggestion_or_complain_model.dart +++ b/lib/model/manager/suggestion_or_complain_model.dart @@ -1,5 +1,5 @@ import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; class SuggestionOrComplainModel { int? id; diff --git a/lib/model/manager/visitor_list_item_model.dart b/lib/model/manager/visitor_list_item_model.dart index bb00c497..5f6e12fc 100644 --- a/lib/model/manager/visitor_list_item_model.dart +++ b/lib/model/manager/visitor_list_item_model.dart @@ -1,4 +1,4 @@ -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; class VisitorListItemModel { int? id; diff --git a/lib/model/user/car_parking_model.dart b/lib/model/user/car_parking_model.dart index cbcc3a47..21933df9 100644 --- a/lib/model/user/car_parking_model.dart +++ b/lib/model/user/car_parking_model.dart @@ -1,4 +1,4 @@ -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/model/user/house_model.dart b/lib/model/user/house_model.dart index 2b51c0ea..a58283c2 100644 --- a/lib/model/user/house_model.dart +++ b/lib/model/user/house_model.dart @@ -1,4 +1,4 @@ -// import 'package:flustars/flustars.dart'; +// import 'package:common_utils/common_utils.dart'; // import 'package:flutter/material.dart'; // // class HouseModel { diff --git a/lib/models/express_package/express_package_list_model.dart b/lib/models/express_package/express_package_list_model.dart index 998f2083..3e9e205a 100644 --- a/lib/models/express_package/express_package_list_model.dart +++ b/lib/models/express_package/express_package_list_model.dart @@ -1,5 +1,5 @@ +import 'package:common_utils/common_utils.dart'; import 'package:equatable/equatable.dart'; -import 'package:flustars/flustars.dart'; import 'package:json_annotation/json_annotation.dart'; part 'express_package_list_model.g.dart'; diff --git a/lib/models/facility/facility_appointment_model.dart b/lib/models/facility/facility_appointment_model.dart index 1ebbd4d1..af03ed2a 100644 --- a/lib/models/facility/facility_appointment_model.dart +++ b/lib/models/facility/facility_appointment_model.dart @@ -1,5 +1,5 @@ import 'package:aku_new_community/base/base_style.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; diff --git a/lib/models/facility/facility_order_date_list_model.dart b/lib/models/facility/facility_order_date_list_model.dart index d4d92bda..982c11de 100644 --- a/lib/models/facility/facility_order_date_list_model.dart +++ b/lib/models/facility/facility_order_date_list_model.dart @@ -1,5 +1,5 @@ +import 'package:common_utils/common_utils.dart'; import 'package:equatable/equatable.dart'; -import 'package:flustars/flustars.dart'; import 'package:json_annotation/json_annotation.dart'; part 'facility_order_date_list_model.g.dart'; diff --git a/lib/models/geographic_information/geographic_information_model.dart b/lib/models/geographic_information/geographic_information_model.dart index a08f2295..9119f9fb 100644 --- a/lib/models/geographic_information/geographic_information_model.dart +++ b/lib/models/geographic_information/geographic_information_model.dart @@ -1,5 +1,5 @@ import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; class GeographicInformationModel { int? id; diff --git a/lib/models/house/lease_fee_list_model.dart b/lib/models/house/lease_fee_list_model.dart index 973f2b3a..7ff04c80 100644 --- a/lib/models/house/lease_fee_list_model.dart +++ b/lib/models/house/lease_fee_list_model.dart @@ -1,5 +1,5 @@ +import 'package:common_utils/common_utils.dart'; import 'package:equatable/equatable.dart'; -import 'package:flustars/flustars.dart'; import 'package:json_annotation/json_annotation.dart'; part 'lease_fee_list_model.g.dart'; diff --git a/lib/models/house_introduce/house_introduce_model.dart b/lib/models/house_introduce/house_introduce_model.dart index 4e25c03f..d66e7e50 100644 --- a/lib/models/house_introduce/house_introduce_model.dart +++ b/lib/models/house_introduce/house_introduce_model.dart @@ -1,5 +1,5 @@ import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; class HouseIntroduceModel { int? id; diff --git a/lib/models/market/good_detail_model.dart b/lib/models/market/good_detail_model.dart index d853e697..b0534efd 100644 --- a/lib/models/market/good_detail_model.dart +++ b/lib/models/market/good_detail_model.dart @@ -6,14 +6,14 @@ part 'good_detail_model.g.dart'; @JsonSerializable() class GoodDetailModel { final int id; - final List jcookImageVoList; + final List? jcookImageVoList; final num sellPrice; final num discountPrice; - final String skuName; + final String? skuName; final int status; final int shopStatus; - final int sellNum; - final int kind; + final int? sellNum; + final int? kind; final String defaultLocation; final String defaultAddressDetail; final int stockStatus; @@ -25,8 +25,7 @@ class GoodDetailModel { factory GoodDetailModel.fromJson(Map json) => _$GoodDetailModelFromJson(json); - GoodStatus get goodStatus => - ShopCarFunc.getGoodsStatus(status ?? 1, shopStatus ?? 1); + GoodStatus get goodStatus => ShopCarFunc.getGoodsStatus(status, shopStatus); static GoodDetailModel fail() => GoodDetailModel( id: 0, @@ -102,8 +101,8 @@ class JcookSpecificationVoList { @JsonSerializable() class Attribute { - final String name; - final String value; + final String? name; + final String? value; factory Attribute.fromJson(Map json) => _$AttributeFromJson(json); diff --git a/lib/models/market/market_all_category_model.dart b/lib/models/market/market_all_category_model.dart index cb8698c9..0d8788ef 100644 --- a/lib/models/market/market_all_category_model.dart +++ b/lib/models/market/market_all_category_model.dart @@ -5,7 +5,7 @@ part 'market_all_category_model.g.dart'; @JsonSerializable() class MarketAllCategoryModel { final int id; - final String name; + final String? name; final List imgUrls; final List categoryList; factory MarketAllCategoryModel.fromJson(Map json) => diff --git a/lib/models/market/market_category_model.dart b/lib/models/market/market_category_model.dart index 4305179f..c83b46f1 100644 --- a/lib/models/market/market_category_model.dart +++ b/lib/models/market/market_category_model.dart @@ -6,7 +6,7 @@ part 'market_category_model.g.dart'; @JsonSerializable() class MarketCategoryModel extends Equatable { final int id; - final String name; + final String? name; final List imgUrls; @override diff --git a/lib/models/market/order/my_order_list_model.dart b/lib/models/market/order/my_order_list_model.dart index c8bf9992..63cb4f21 100644 --- a/lib/models/market/order/my_order_list_model.dart +++ b/lib/models/market/order/my_order_list_model.dart @@ -1,6 +1,6 @@ import 'package:aku_new_community/model/common/img_model.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:equatable/equatable.dart'; -import 'package:flustars/flustars.dart'; import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; diff --git a/lib/models/message/announce_list_model.dart b/lib/models/message/announce_list_model.dart index 4ac6e0d8..3f2e2f4a 100644 --- a/lib/models/message/announce_list_model.dart +++ b/lib/models/message/announce_list_model.dart @@ -1,4 +1,4 @@ -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:json_annotation/json_annotation.dart'; part 'announce_list_model.g.dart'; diff --git a/lib/models/new_renovation/new_renovation_list_model.dart b/lib/models/new_renovation/new_renovation_list_model.dart index a8d3be7c..96346d13 100644 --- a/lib/models/new_renovation/new_renovation_list_model.dart +++ b/lib/models/new_renovation/new_renovation_list_model.dart @@ -1,6 +1,6 @@ import 'package:aku_new_community/base/base_style.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:equatable/equatable.dart'; -import 'package:flustars/flustars.dart'; import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; diff --git a/lib/models/news/news_item_model.dart b/lib/models/news/news_item_model.dart index f35934a3..fed9ce67 100644 --- a/lib/models/news/news_item_model.dart +++ b/lib/models/news/news_item_model.dart @@ -1,5 +1,5 @@ import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:json_annotation/json_annotation.dart'; part 'news_item_model.g.dart'; diff --git a/lib/models/surrounding_enterprises/surrounding_enterprises_model.dart b/lib/models/surrounding_enterprises/surrounding_enterprises_model.dart index eb78b870..0e3de459 100644 --- a/lib/models/surrounding_enterprises/surrounding_enterprises_model.dart +++ b/lib/models/surrounding_enterprises/surrounding_enterprises_model.dart @@ -1,5 +1,5 @@ import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; class SurroundingEnterprisesModel { int? id; diff --git a/lib/models/task/hall_list_model.dart b/lib/models/task/hall_list_model.dart new file mode 100644 index 00000000..f9a0dade --- /dev/null +++ b/lib/models/task/hall_list_model.dart @@ -0,0 +1,40 @@ +import 'package:json_annotation/json_annotation.dart'; + +part 'hall_list_model.g.dart'; + +@JsonSerializable() +class HallListModel { + final int id; + final String title; + final int status; + final int type; + final int sex; + final int serviceObject; + final String content; + final String appointmentDate; + final String appointmentAddress; + final int rewardType; + final int reward; + final int createType; + final String? createName; + final String createDate; + factory HallListModel.fromJson(Map json) => + _$HallListModelFromJson(json); + + const HallListModel({ + required this.id, + required this.title, + required this.status, + required this.type, + required this.sex, + required this.serviceObject, + required this.content, + required this.appointmentDate, + required this.appointmentAddress, + required this.rewardType, + required this.reward, + required this.createType, + this.createName, + required this.createDate, + }); +} diff --git a/lib/models/task/hall_list_model.g.dart b/lib/models/task/hall_list_model.g.dart new file mode 100644 index 00000000..2681aa43 --- /dev/null +++ b/lib/models/task/hall_list_model.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'hall_list_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +HallListModel _$HallListModelFromJson(Map json) => + HallListModel( + id: json['id'] as int, + title: json['title'] as String, + status: json['status'] as int, + type: json['type'] as int, + sex: json['sex'] as int, + serviceObject: json['serviceObject'] as int, + content: json['content'] as String, + appointmentDate: json['appointmentDate'] as String, + appointmentAddress: json['appointmentAddress'] as String, + rewardType: json['rewardType'] as int, + reward: json['reward'] as int, + createType: json['createType'] as int, + createName: json['createName'] as String?, + createDate: json['createDate'] as String, + ); diff --git a/lib/models/task/my_take_task_list_model.dart b/lib/models/task/my_take_task_list_model.dart new file mode 100644 index 00000000..db0f61d2 --- /dev/null +++ b/lib/models/task/my_take_task_list_model.dart @@ -0,0 +1,41 @@ +import 'package:json_annotation/json_annotation.dart'; + +part 'my_take_task_list_model.g.dart'; + +@JsonSerializable() +class MyTakeTaskListModel { + final int id; + final String title; + final int status; + final int type; + final int sex; + final int serviceObject; + final String content; + final String appointmentDate; + final String appointmentAddress; + final int rewardType; + final int reward; + final int createType; + final String? createName; + final String createDate; + + factory MyTakeTaskListModel.fromJson(Map json) => + _$MyTakeTaskListModelFromJson(json); + + const MyTakeTaskListModel({ + required this.id, + required this.title, + required this.status, + required this.type, + required this.sex, + required this.serviceObject, + required this.content, + required this.appointmentDate, + required this.appointmentAddress, + required this.rewardType, + required this.reward, + required this.createType, + this.createName, + required this.createDate, + }); +} diff --git a/lib/models/task/my_take_task_list_model.g.dart b/lib/models/task/my_take_task_list_model.g.dart new file mode 100644 index 00000000..e49a1b7e --- /dev/null +++ b/lib/models/task/my_take_task_list_model.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'my_take_task_list_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +MyTakeTaskListModel _$MyTakeTaskListModelFromJson(Map json) => + MyTakeTaskListModel( + id: json['id'] as int, + title: json['title'] as String, + status: json['status'] as int, + type: json['type'] as int, + sex: json['sex'] as int, + serviceObject: json['serviceObject'] as int, + content: json['content'] as String, + appointmentDate: json['appointmentDate'] as String, + appointmentAddress: json['appointmentAddress'] as String, + rewardType: json['rewardType'] as int, + reward: json['reward'] as int, + createType: json['createType'] as int, + createName: json['createName'] as String?, + createDate: json['createDate'] as String, + ); diff --git a/lib/models/task/my_task_list_model.dart b/lib/models/task/my_task_list_model.dart new file mode 100644 index 00000000..86e9af60 --- /dev/null +++ b/lib/models/task/my_task_list_model.dart @@ -0,0 +1,40 @@ +import 'package:json_annotation/json_annotation.dart'; + +part 'my_task_list_model.g.dart'; + +@JsonSerializable() +class MyTaskListModel { + final int id; + final String title; + final int status; + final int type; + final int sex; + final int serviceObject; + final String content; + final String appointmentDate; + final String appointmentAddress; + final int rewardType; + final int reward; + final int createType; + final String? createName; + final String createDate; + factory MyTaskListModel.fromJson(Map json) => + _$MyTaskListModelFromJson(json); + + const MyTaskListModel({ + required this.id, + required this.title, + required this.status, + required this.type, + required this.sex, + required this.serviceObject, + required this.content, + required this.appointmentDate, + required this.appointmentAddress, + required this.rewardType, + required this.reward, + required this.createType, + this.createName, + required this.createDate, + }); +} diff --git a/lib/models/task/my_task_list_model.g.dart b/lib/models/task/my_task_list_model.g.dart new file mode 100644 index 00000000..9c1b1af3 --- /dev/null +++ b/lib/models/task/my_task_list_model.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'my_task_list_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +MyTaskListModel _$MyTaskListModelFromJson(Map json) => + MyTaskListModel( + id: json['id'] as int, + title: json['title'] as String, + status: json['status'] as int, + type: json['type'] as int, + sex: json['sex'] as int, + serviceObject: json['serviceObject'] as int, + content: json['content'] as String, + appointmentDate: json['appointmentDate'] as String, + appointmentAddress: json['appointmentAddress'] as String, + rewardType: json['rewardType'] as int, + reward: json['reward'] as int, + createType: json['createType'] as int, + createName: json['createName'] as String?, + createDate: json['createDate'] as String, + ); diff --git a/lib/models/user/passed_house_list_model.dart b/lib/models/user/passed_house_list_model.dart index 9e31ec41..66f45139 100644 --- a/lib/models/user/passed_house_list_model.dart +++ b/lib/models/user/passed_house_list_model.dart @@ -1,5 +1,5 @@ +import 'package:common_utils/common_utils.dart'; import 'package:equatable/equatable.dart'; -import 'package:flustars/flustars.dart'; import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; diff --git a/lib/pages/electronic_commerc/electronic_commerc_card.dart b/lib/pages/electronic_commerc/electronic_commerc_card.dart index 15ffe3f9..ccacd1fe 100644 --- a/lib/pages/electronic_commerc/electronic_commerc_card.dart +++ b/lib/pages/electronic_commerc/electronic_commerc_card.dart @@ -4,7 +4,7 @@ import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/models/electronic_commerc/electronic_commerc_list_model.dart'; import 'package:aku_new_community/pages/electronic_commerc/electronic_commerc_detail_page.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; diff --git a/lib/pages/electronic_commerc/electronic_commerc_detail_page.dart b/lib/pages/electronic_commerc/electronic_commerc_detail_page.dart index 43638eba..460b2fe2 100644 --- a/lib/pages/electronic_commerc/electronic_commerc_detail_page.dart +++ b/lib/pages/electronic_commerc/electronic_commerc_detail_page.dart @@ -5,7 +5,7 @@ import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/pages/goods_deto_page/deto_code_page/deto_code_page.dart b/lib/pages/goods_deto_page/deto_code_page/deto_code_page.dart index 9b5da89e..f7672625 100644 --- a/lib/pages/goods_deto_page/deto_code_page/deto_code_page.dart +++ b/lib/pages/goods_deto_page/deto_code_page/deto_code_page.dart @@ -3,7 +3,6 @@ import 'package:aku_new_community/provider/app_provider.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/dotted_line.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:get/get.dart'; diff --git a/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart b/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart index eb957d8c..02466671 100644 --- a/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart +++ b/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart @@ -3,7 +3,6 @@ import 'dart:io'; import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/app_theme.dart'; import 'package:aku_new_community/pages/goods_deto_page/select_move_company_page.dart'; @@ -22,7 +21,7 @@ import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/picker/bee_date_picker.dart'; import 'package:aku_new_community/widget/picker/grid_image_picker.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; diff --git a/lib/pages/goods_deto_page/goods_deto_page.dart b/lib/pages/goods_deto_page/goods_deto_page.dart index fe0fbd66..7f07a475 100644 --- a/lib/pages/goods_deto_page/goods_deto_page.dart +++ b/lib/pages/goods_deto_page/goods_deto_page.dart @@ -10,12 +10,10 @@ import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/buttons/radio_button.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; -import 'package:velocity_x/velocity_x.dart'; import 'widget/goods_info_card.dart'; diff --git a/lib/pages/goods_deto_page/widget/goods_info_card.dart b/lib/pages/goods_deto_page/widget/goods_info_card.dart index 3acc6e72..bf8b36fd 100644 --- a/lib/pages/goods_deto_page/widget/goods_info_card.dart +++ b/lib/pages/goods_deto_page/widget/goods_info_card.dart @@ -3,7 +3,6 @@ import 'package:aku_new_community/model/manager/goods_out_model.dart'; import 'package:aku_new_community/utils/bee_map.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/views/horizontal_image_view.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'goods_info_card_button.dart'; diff --git a/lib/pages/goods_manage_page/goods_manage_page.dart b/lib/pages/goods_manage_page/goods_manage_page.dart index b863d88d..fb4f90e5 100644 --- a/lib/pages/goods_manage_page/goods_manage_page.dart +++ b/lib/pages/goods_manage_page/goods_manage_page.dart @@ -1,4 +1,3 @@ -import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/manager/article_borrow_model.dart'; @@ -9,11 +8,9 @@ import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class GoodsManagePage extends StatefulWidget { final bool isBorrow; diff --git a/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart b/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart index c97ffb82..00ab0cf3 100644 --- a/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart +++ b/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart @@ -8,7 +8,6 @@ import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index d0fa1f40..34ac4752 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -1,13 +1,12 @@ // Dart imports: -import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/application_objects.dart'; +import 'package:aku_new_community/extensions/color_ext.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/community/activity_item_model.dart'; import 'package:aku_new_community/model/community/board_model.dart'; import 'package:aku_new_community/model/community/swiper_model.dart'; -import 'package:aku_new_community/pages/home/widget/animate_app_bar.dart'; import 'package:aku_new_community/pages/message_center_page/message_center_page.dart'; import 'package:aku_new_community/pages/one_alarm/widget/alarm_page.dart'; import 'package:aku_new_community/pages/visitor_access_page/visitor_access_page.dart'; @@ -27,18 +26,16 @@ import 'package:aku_new_community/widget/others/rectIndicator.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:badges/badges.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:card_swiper/card_swiper.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_swiper_null_safety/flutter_swiper_null_safety.dart'; import 'package:get/get.dart'; import 'package:jpush_flutter/jpush_flutter.dart'; +import 'package:palette_generator/palette_generator.dart'; import 'package:power_logger/power_logger.dart'; import 'package:provider/provider.dart'; -import 'package:velocity_x/velocity_x.dart'; - -import 'widget/home_search.dart'; class HomePage extends StatefulWidget { HomePage({Key? key}) : super(key: key); @@ -62,11 +59,16 @@ class _HomePageState extends State int sysCount = 0; int sum = 0; + int _currentSwiperIndex = 0; + // ActivityItemModel? _activityItemModel; List _activityItemModels = []; List _boardItemModels = []; List _swiperModels = []; + SwiperController _swiperController = SwiperController(); + ValueNotifier _barColor = ValueNotifier(Colors.transparent); + @override void initState() { super.initState(); @@ -81,12 +83,19 @@ class _HomePageState extends State } _scrollController = ScrollController(); _refreshController = EasyRefreshController(); + _swiperController.addListener(() { + //由于先触发监听后,再执行onChangeIndex函数,所以_currentSwiperIndex会比当前index少1,用+1并求余的方式获得真正当前index; + _swiperBarColor((_currentSwiperIndex + 1) % 3); + }); + SystemChrome.setSystemUIOverlayStyle( + SystemUiOverlayStyle(statusBarColor: Colors.transparent)); } @override void dispose() { _refreshController.dispose(); _scrollController?.dispose(); + _swiperController.dispose(); super.dispose(); } @@ -97,11 +106,51 @@ class _HomePageState extends State commentCount = appProvider.messageCenterModel.commentCount ?? 0; sysCount = appProvider.messageCenterModel.sysCount ?? 0; sum = commentCount + sysCount; - return Scaffold( - extendBodyBehindAppBar: true, - appBar: AnimateAppBar( - scrollController: _scrollController, - actions: [ + var head = ValueListenableBuilder( + valueListenable: _barColor, + builder: (context, Color color, child) { + return Container( + padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top), + decoration: BoxDecoration( + border: Border.all(width: 0, color: color), + color: color, + ), + width: double.infinity, + child: child, + ); + }, + child: Padding( + padding: EdgeInsets.symmetric(vertical: 16.w, horizontal: 16.w), + child: Row(crossAxisAlignment: CrossAxisAlignment.center, children: [ + if (appProvider.location != null) + Padding( + padding: const EdgeInsets.only(right: 5), + child: Image.asset( + R.ASSETS_ICONS_ICON_MAIN_LOCATION_PNG, + width: 32.w, + height: 32.w, + ), + ), + Text( + appProvider.location?['city'] == null + ? '' + : appProvider.location?['city'] as String? ?? '', + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 24.sp, + color: Color(0xff333333), + ), + textAlign: TextAlign.center, + ), + Text( + '(${appProvider.weatherType} ${appProvider.weatherTemp}℃)', + style: TextStyle( + fontSize: 24.sp, + color: Color(0xff999999), + ), + textAlign: TextAlign.center, + ), + Spacer(), GestureDetector( onTap: () { Get.to(() => BeeSearch()); @@ -134,292 +183,307 @@ class _HomePageState extends State height: 40.w, width: 40.w), )), ), - ], + ]), ), - body: Stack( - children: [ - EasyRefresh( - controller: _refreshController, - header: MaterialHeader(), - firstRefresh: true, - onRefresh: () async { - //_activityItemModel = await CommunityFunc.activity(); - _activityItemModels = await CommunityFunc.activityList(); - _boardItemModels = await CommunityFunc.board(); - _swiperModels = await CommunityFunc.swiper(); - appProvider.getMessageCenter(); - setState(() {}); - }, - child: CustomScrollView( - controller: _scrollController, - slivers: [ - SliverToBoxAdapter( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - HomeSearch(), - - HomeSwiper(), //要做点击事件 - // SizedBox(height: 100.w), - Container( - padding: EdgeInsets.only(top: 24.w, bottom: 32.w), - child: getFunction(), //ApplicationView(), - decoration: BoxDecoration( + ); + return AnnotatedRegion( + value: SystemUiOverlayStyle.dark, + child: Scaffold( + extendBody: true, + extendBodyBehindAppBar: true, + body: Stack( + children: [ + EasyRefresh( + controller: _refreshController, + header: BeeBallPauseHeader(bgColor: _barColor), + firstRefresh: true, + onRefresh: () async { + //_activityItemModel = await CommunityFunc.activity(); + _activityItemModels = await CommunityFunc.activityList(); + _boardItemModels = await CommunityFunc.board(); + _swiperModels = await CommunityFunc.swiper(); + appProvider.getMessageCenter(); + setState(() {}); + }, + child: CustomScrollView( + controller: _scrollController, + slivers: [ + SliverToBoxAdapter( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + HomeSwiper(), //要做点击事件 + // SizedBox(height: 100.w), + Container( + padding: EdgeInsets.only(top: 24.w, bottom: 32.w), + child: getFunction(), //ApplicationView(), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: const [ + BoxShadow( + color: Color(0x14000000), + blurRadius: 0, + offset: Offset(0.0, 2.0), + spreadRadius: 0.1) + ], + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(28), + bottomRight: Radius.circular(28))), + ) + //ApplicationBox(child: ApplicationView()), + ], + ), + ), + SliverToBoxAdapter( + child: Container( + height: 40, + margin: EdgeInsets.only( + left: 32.w, right: 32.w, top: 24.w), + decoration: BoxDecoration( color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(8)), boxShadow: const [ BoxShadow( color: Color(0x14000000), - blurRadius: 0, - offset: Offset(0.0, 2.0), - spreadRadius: 0.1) + blurRadius: 4, + spreadRadius: 0.5) ], - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(28), - bottomRight: Radius.circular(28))), - ) - //ApplicationBox(child: ApplicationView()), - ], - ), - ), - SliverToBoxAdapter( - child: Container( - height: 40, - margin: - EdgeInsets.only(left: 32.w, right: 32.w, top: 24.w), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(8)), - boxShadow: const [ - BoxShadow( - color: Color(0x14000000), - blurRadius: 4, - spreadRadius: 0.5) - ], - ), - child: HomeNotification(items: _boardItemModels)), - ), - SliverToBoxAdapter( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - GestureDetector( - child: Container( - margin: EdgeInsets.only(top: 24.w), - padding: EdgeInsets.only(left: 32.w, top: 24.w), - width: 140, - height: 150, - decoration: BoxDecoration( - image: DecorationImage( - fit: BoxFit.fill, - image: AssetImage(R.ASSETS_IMAGES_CARD_YELLOW_PNG), - )), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - '访客邀请', - style: TextStyle( - color: Color(0xD9000000), - fontSize: 26.sp, - fontWeight: FontWeight.bold), - ), - 10.hb, - Text( - '一键分享', - style: TextStyle( - color: Color(0x73000000), - fontSize: 20.sp, - ), - ), - Text( - '让拜访不再是难事', - style: TextStyle( - color: Color(0x73000000), - fontSize: 20.sp, - ), - ), - Spacer(), - Image.asset( - R.ASSETS_ICONS_ICON_MAIN_INVITE_PNG, - width: 100.w, - height: 100.w, + ), + child: HomeNotification(items: _boardItemModels)), + ), + SliverToBoxAdapter( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GestureDetector( + child: Container( + margin: EdgeInsets.only(top: 24.w), + padding: EdgeInsets.only(left: 32.w, top: 24.w), + width: 140, + height: 150, + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: + AssetImage(R.ASSETS_IMAGES_CARD_YELLOW_PNG), + )), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '访客邀请', + style: TextStyle( + color: Color(0xD9000000), + fontSize: 26.sp, + fontWeight: FontWeight.bold), + ), + 10.hb, + Text( + '一键分享', + style: TextStyle( + color: Color(0x73000000), + fontSize: 20.sp, + ), + ), + Text( + '让拜访不再是难事', + style: TextStyle( + color: Color(0x73000000), + fontSize: 20.sp, + ), + ), + Spacer(), + Image.asset( + R.ASSETS_ICONS_ICON_MAIN_INVITE_PNG, + width: 100.w, + height: 100.w, + ), + 30.hb, + ], ), - 30.hb, - ], + ), + onTap: () { + Get.to(VisitorAccessPage()); + }, ), - ), - onTap: () { - Get.to(VisitorAccessPage()); - }, - ), - 25.wb, - Container( - margin: EdgeInsets.only(top: 24.w), - child: Column( - children: [ - GestureDetector( - child: Container( - width: 190, - height: 69, - decoration: BoxDecoration( - image: DecorationImage( - fit: BoxFit.fill, - image: - AssetImage(R.ASSETS_IMAGES_CARD_PINK_PNG), - )), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - 20.wb, - Column( - crossAxisAlignment: - CrossAxisAlignment.start, + 25.wb, + Container( + margin: EdgeInsets.only(top: 24.w), + child: Column( + children: [ + GestureDetector( + child: Container( + width: 190, + height: 69, + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage( + R.ASSETS_IMAGES_CARD_PINK_PNG), + )), + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, children: [ - 20.hb, - Text( - '一键报警', - style: TextStyle( - color: Color(0xD9000000), - fontSize: 26.sp, - fontWeight: FontWeight.bold), + 20.wb, + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + 20.hb, + Text( + '一键报警', + style: TextStyle( + color: Color(0xD9000000), + fontSize: 26.sp, + fontWeight: FontWeight.bold), + ), + 10.hb, + Text( + '提交报警位置给物业', + style: TextStyle( + color: Color(0x73000000), + fontSize: 20.sp, + ), + ), + ], ), - 10.hb, - Text( - '提交报警位置给物业', - style: TextStyle( - color: Color(0x73000000), - fontSize: 20.sp, - ), + Spacer(), + Image.asset( + R.ASSETS_ICONS_ICON_MAIN_POLICE_PNG, + width: 98.w, + height: 98.w, ), + 20.wb, ], ), - Spacer(), - Image.asset( - R.ASSETS_ICONS_ICON_MAIN_POLICE_PNG, - width: 98.w, - height: 98.w, - ), - 20.wb, - ], + ), + onTap: () { + Get.to(AlarmPage()); + }, ), - ), - onTap: () { - Get.to(AlarmPage()); - }, - ), - GestureDetector( - child: Container( - margin: EdgeInsets.only(top: 20.w), - width: 190, - height: 69, - decoration: BoxDecoration( - image: DecorationImage( - fit: BoxFit.fill, - image: - AssetImage(R.ASSETS_IMAGES_CARD_BLUE_PNG), - )), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - 20.wb, - Column( - crossAxisAlignment: - CrossAxisAlignment.start, + GestureDetector( + child: Container( + margin: EdgeInsets.only(top: 20.w), + width: 190, + height: 69, + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage( + R.ASSETS_IMAGES_CARD_BLUE_PNG), + )), + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, children: [ - 20.hb, - Text( - '建议咨询', - style: TextStyle( - color: Color(0xD9000000), - fontSize: 26.sp, - fontWeight: FontWeight.bold), + 20.wb, + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + 20.hb, + Text( + '建议咨询', + style: TextStyle( + color: Color(0xD9000000), + fontSize: 26.sp, + fontWeight: FontWeight.bold), + ), + 10.hb, + Text( + '欢迎给我们提供服务意见', + style: TextStyle( + color: Color(0x73000000), + fontSize: 20.sp, + ), + ), + ], ), - 10.hb, - Text( - '欢迎给我们提供服务意见', - style: TextStyle( - color: Color(0x73000000), - fontSize: 20.sp, - ), + Spacer(), + Image.asset( + R.ASSETS_ICONS_ICON_MAIN_CONSULT_PNG, + width: 98.w, + height: 98.w, ), + 20.wb, ], ), - Spacer(), - Image.asset( - R.ASSETS_ICONS_ICON_MAIN_CONSULT_PNG, - width: 98.w, - height: 98.w, - ), - 20.wb, - ], - ), - ), - onTap: () { - Get.to(AdvicePage(type: AdviceType.SUGGESTION)); - }, - ) - ], - ), - ) - ], - ), - ), - SliverToBoxAdapter( - child: Column( - children: [ - HomeTitle( - title: '社区活动', - suffixTitle: '查看全部', - onTap: () => Get.to(() => ActivityListPage()), - ), - _activityItemModels == [] - ? SizedBox() - : Container( - height: 400.w, - padding: EdgeInsets.only(left: 32.w), - child: ListView.separated( - padding: EdgeInsets.zero, - separatorBuilder: (context, index) { - return SizedBox( - width: 16.w, - ); - }, - scrollDirection: Axis.horizontal, - itemBuilder: (context, index) { - return Container( - width: 500.w, - child: Builder( - builder: (context) { - return ActivityCard( - model: _activityItemModels[index]); - }, ), - ); - }, - itemCount: _activityItemModels.length, + onTap: () { + Get.to(AdvicePage( + type: AdviceType.SUGGESTION)); + }, + ) + ], ), - ), - // : ActivityCard(model: _activityItemModel) - // .pSymmetric(h: 24.w, v: 24.w), + ) + ], + ), + ), + SliverToBoxAdapter( + child: Column( + children: [ + HomeTitle( + title: '社区活动', + suffixTitle: '查看全部', + onTap: () => Get.to(() => ActivityListPage()), + ), + _activityItemModels == [] + ? SizedBox() + : Container( + height: 400.w, + padding: EdgeInsets.only(left: 32.w), + child: ListView.separated( + padding: EdgeInsets.zero, + separatorBuilder: (context, index) { + return SizedBox( + width: 16.w, + ); + }, + scrollDirection: Axis.horizontal, + itemBuilder: (context, index) { + return Container( + width: 500.w, + child: Builder( + builder: (context) { + return ActivityCard( + model: + _activityItemModels[index]); + }, + ), + ); + }, + itemCount: _activityItemModels.length, + ), + ), + // : ActivityCard(model: _activityItemModel) + // .pSymmetric(h: 24.w, v: 24.w), + ], + )), ], - )), - ], - ), + ), + ), + OverlayLivingBtnWidget() + ], ), - OverlayLivingBtnWidget() - ], - ), - ); + )); } Widget HomeSwiper() { return Container( width: double.infinity, height: 320.w, + decoration: + BoxDecoration(border: Border.all(width: 0, color: _barColor.value)), child: AspectRatio( aspectRatio: 375 / 160, child: Swiper( key: UniqueKey(), + controller: _swiperController, + onIndexChanged: (index) async { + _currentSwiperIndex = index; + }, itemBuilder: (BuildContext context, int index) { return getSwiperImage(_swiperModels[index]); }, @@ -456,6 +520,18 @@ class _HomePageState extends State ); } + Future _swiperBarColor(int index) async { + if (_swiperModels.isNotEmpty) { + var color = + await PaletteGenerator.fromImageProvider(CachedNetworkImageProvider( + API.image(ImgModel.first(_swiperModels[index].voResourcesImgList)), + )); + _barColor.value = color.dominantColor?.color ?? Colors.transparent; + } else { + _barColor.value = Colors.transparent; + } + } + Widget getSwiperImage(SwiperModel swiperModel) { return Container( child: FadeInImage.assetNetwork( @@ -531,3 +607,62 @@ class _HomePageState extends State @override bool get wantKeepAlive => true; } + +class BeeBallPauseHeader extends Header { + /// Key + final Key? key; + + final ValueNotifier bgColor; + + final LinkHeaderNotifier linkNotifier = LinkHeaderNotifier(); + + BeeBallPauseHeader({ + this.key, + required this.bgColor, + bool enableHapticFeedback = true, + bool enableInfiniteRefresh = false, + }) : super( + extent: 70.0, + triggerDistance: 70.0, + float: false, + enableHapticFeedback: enableHapticFeedback, + enableInfiniteRefresh: enableInfiniteRefresh, + ); + + @override + Widget contentBuilder( + BuildContext context, + RefreshMode refreshState, + double pulledExtent, + double refreshTriggerPullDistance, + double refreshIndicatorExtent, + AxisDirection axisDirection, + bool float, + Duration? completeDuration, + bool enableInfiniteRefresh, + bool success, + bool noMore) { + linkNotifier.contentBuilder( + context, + refreshState, + pulledExtent, + refreshTriggerPullDistance, + refreshIndicatorExtent, + axisDirection, + float, + completeDuration, + enableInfiniteRefresh, + success, + noMore); + return ValueListenableBuilder( + valueListenable: bgColor, + builder: (context, Color color, child) { + return BallPulseHeaderWidget( + key: key, + color: bgColor.value.complementary, + backgroundColor: bgColor.value, + linkNotifier: linkNotifier, + ); + }); + } +} diff --git a/lib/pages/home/widget/animate_app_bar.dart b/lib/pages/home/widget/animate_app_bar.dart index 13e7d18f..1b4e6f1c 100644 --- a/lib/pages/home/widget/animate_app_bar.dart +++ b/lib/pages/home/widget/animate_app_bar.dart @@ -1,14 +1,16 @@ import 'package:aku_new_community/provider/app_provider.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter/services.dart'; import 'package:provider/provider.dart'; class AnimateAppBar extends StatefulWidget with PreferredSizeWidget { final ScrollController? scrollController; final List? actions; + final ValueNotifier bgColor; - AnimateAppBar({Key? key, this.scrollController, this.actions}) + AnimateAppBar( + {Key? key, this.scrollController, this.actions, required this.bgColor}) : super(key: key); @override @@ -19,63 +21,57 @@ class AnimateAppBar extends StatefulWidget with PreferredSizeWidget { } class _AnimateAppBarState extends State { - Color _bgColor = Colors.white; - @override void initState() { super.initState(); - widget.scrollController!.addListener(() { - setState(() { - _bgColor = widget.scrollController!.offset > 30 - ? Colors.white - : widget.scrollController!.offset < 0 - ? Colors.transparent - : Colors.white - .withOpacity((widget.scrollController!.offset / 30)); - }); - }); } @override Widget build(BuildContext context) { final appProvider = Provider.of(context); - return Padding( - padding: const EdgeInsets.only(top: 5), - child: AppBar( - titleSpacing: 10.0, - title: Row(crossAxisAlignment: CrossAxisAlignment.center, children: [ - if (appProvider.location != null) - Padding( - padding: const EdgeInsets.only(right: 5), - child: Image.asset( - R.ASSETS_ICONS_ICON_MAIN_LOCATION_PNG, - width: 32.w, - height: 32.w, - ), - ), - Text( - appProvider.location?['city'] == null - ? '' - : appProvider.location?['city'] as String? ?? '', - style: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 24.sp, - color: Color(0xff333333), + return ValueListenableBuilder( + valueListenable: widget.bgColor, + builder: (context, color, child) { + return AppBar( + systemOverlayStyle: SystemUiOverlayStyle( + statusBarColor: widget.bgColor.value, + statusBarIconBrightness: Brightness.light), + titleSpacing: 10.0, + title: child, + backgroundColor: widget.bgColor.value, + actions: widget.actions, + ); + }, + child: Row(crossAxisAlignment: CrossAxisAlignment.center, children: [ + if (appProvider.location != null) + Padding( + padding: const EdgeInsets.only(right: 5), + child: Image.asset( + R.ASSETS_ICONS_ICON_MAIN_LOCATION_PNG, + width: 32.w, + height: 32.w, ), - textAlign: TextAlign.center, ), - Text( - '(${appProvider.weatherType} ${appProvider.weatherTemp}℃)', - style: TextStyle( - fontSize: 24.sp, - color: Color(0xff999999), - ), - textAlign: TextAlign.center, + Text( + appProvider.location?['city'] == null + ? '' + : appProvider.location?['city'] as String? ?? '', + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 24.sp, + color: Color(0xff333333), + ), + textAlign: TextAlign.center, + ), + Text( + '(${appProvider.weatherType} ${appProvider.weatherTemp}℃)', + style: TextStyle( + fontSize: 24.sp, + color: Color(0xff999999), ), - ]), - backgroundColor: _bgColor, - actions: widget.actions, - ), + textAlign: TextAlign.center, + ), + ]), ); } } diff --git a/lib/pages/home/widget/filter_tool_bar.dart b/lib/pages/home/widget/filter_tool_bar.dart deleted file mode 100644 index d7199f2c..00000000 --- a/lib/pages/home/widget/filter_tool_bar.dart +++ /dev/null @@ -1,592 +0,0 @@ -/* - * ==================================================== - * package : widgets - * author : Created by nansi. - * time : 2019/5/13 1:44 PM - * remark : - * ==================================================== - */ - -import 'package:aku_new_community/utils/text_utils.dart'; -import 'package:flutter/material.dart'; - -/// 自筛选列表点击监听 -typedef SelectedListener = Function(int selectedIndex, FilterItemModel item); - -/// 下拉列表状态变更 -typedef PopOptionHandle = Function(OptionListStatus status); - -/// filterBar 标题点击、变更等监听 -typedef FilterToolBarListener = Function(bool update); - -class FilterToolBarController { - late FilterResultContainerHelper helper; - late int selectedIndex; - late FilterItemModel item; - late GlobalKey _containerKey; - late GlobalKey _toolBarKey; - - /// [update] 是否需要通知外层 sublist 点击的index 和上次一致时,不通知外层 - FilterToolBarListener updateToolBarState = (bool update) {}; - - close() { - helper.changeOptionListStatus(OptionListStatus.close); - } - - get toolBarDx { - RenderBox box = _toolBarKey.currentContext?.findRenderObject() - as RenderBox; //_toolBarKey.currentContext.findRenderObject(); - Offset offset = box.localToGlobal(Offset.zero); - return offset.dx; - } - - double get toolBarDy { - /// toolbar 距离top 的间距 - container外层距离top的间距 - RenderBox containerBox = - _containerKey.currentContext?.findRenderObject() as RenderBox; - RenderBox box = _toolBarKey.currentContext?.findRenderObject() as RenderBox; - Offset containerTopOffset = containerBox.localToGlobal(Offset.zero); - Offset toolBarTopOffset = box.localToGlobal(Offset.zero); - return toolBarTopOffset.dy - containerTopOffset.dy; - } - -////获取position -// RenderBox box = _key.currentContext.findRenderObject(); -// Offset offset = box.localToGlobal(Offset.zero); -// -////获取size -// Size size = box.size; - -// print(" ---- $offset ------- $size"); - -} - -enum OptionListStatus { open, close } - -/// 筛选子列表操作 -class FilterResultContainerHelper { - final PopOptionHandle handle; - - /// 字筛选列表弹出状态 - late OptionListStatus status; - - FilterResultContainerHelper({required this.handle}); - - changeOptionListStatus(OptionListStatus status) { - this.status = status; - this.handle(status); - } -} - -/// 筛选下拉列表容器 与 FilterToolBar 一起使用 -class FilterToolBarResultContainer extends StatefulWidget { - final FilterToolBarController? controller; - final Widget? body; - - const FilterToolBarResultContainer( - {GlobalKey? key, this.controller, this.body}) - : assert(controller != null, "controller 不为空"); - - @override - State createState() { - return _FilterToolBarResultContainerState(); - } -} - -class _FilterToolBarResultContainerState - extends State with TickerProviderStateMixin { - /// 子列表行数 - late int _lines; - - int maxLines = 3; - - /// 子列表单行高度 - double _lineHeight = 35.0; - - /// 底部内边距 - double _bottomSpacing = 8.0; - - /// 顶部边距 - double _topSpacing = 8.0; - - /// 未选中颜色 - Color _unselectedColor = Colors.grey[700]!; - - /// toolbar 字体大小 - // double _toolBarTitleFont = 14.0; - - /// 子列表字体大小 - double _subTitleFont = 13.0; - - /// 子列表单行内边距 因为点击要整行选中,所以在row上设置左右边距 - EdgeInsetsGeometry _subtitleRowPadding = EdgeInsets.only(left: 15, right: 15); - - late AnimationController _animationController; - late Animation _animation; - - @override - void initState() { - _animationController = - AnimationController(vsync: this, duration: Duration(milliseconds: 150)); - - _lines = maxLines; - - widget.controller?.helper = FilterResultContainerHelper(handle: (status) { - if (status == OptionListStatus.open) { - _buildAnimation(widget.controller!.item); - _animationController.forward(); - } else { - _animationController.reset(); - } - }); - - if (widget.key == null) { - widget.controller!._containerKey = GlobalKey(); - } else { - widget.controller!._containerKey = widget.key as GlobalKey; - } - - super.initState(); - } - - @override - void dispose() { - _animationController.dispose(); - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Container( - key: widget.controller!._containerKey, - child: _buildBody(context), - ); - } - - Stack _buildBody(BuildContext context) { - return Stack( - children: [ - /// body内容 - Container( - height: double.infinity, - child: widget.body, - ), - - /// 蒙版 - _maskView(), - - widget.controller?._toolBarKey == null - ? Container() - : Positioned( - top: widget.controller!.toolBarDy + 40, - left: 0, - right: 0, - bottom: 0, - child: Stack(children: [ - widget.controller!.item.type == FilterItemType.list - ? _buildList(context) - : Container(), - ])) - ], - ); - } - - Widget _maskView() { - double? num = widget.controller?.toolBarDy; - - return widget.controller?._toolBarKey == null - ? Container() - : Positioned( - top: (num as double) + 40, - left: 0, - right: 0, - bottom: 0, - child: Offstage( - child: GestureDetector( - behavior: HitTestBehavior.translucent, - onTap: () { - widget.controller!.helper.changeOptionListStatus( - OptionListStatus.close, - ); - widget.controller!.updateToolBarState(false); - _animationController.reset(); - }, - child: Opacity( - opacity: 0.3, - child: Container( - color: Colors.black, - ), - ), - ), - offstage: _animation == null || - (_animation.status == AnimationStatus.dismissed), - ), - ); - } - - /// 有多个子列表时 因为有设置最大行数,小于最大行数[widget.maxLines]时,以子列表个数为准, - /// 否则以最大行数为准,选中时切换动画, - _buildAnimation(FilterItemModel item) { - _lines = - item.subtitles!.length > maxLines ? maxLines : item.subtitles!.length; - - _animation = new Tween( - begin: 0.0 - _lines * _lineHeight - _bottomSpacing - _topSpacing, - end: 0.0) - .animate(_animationController) - ..addListener(() { - setState(() { - // the state that has changed here is the animation object’s value - }); - }); - } - - /// 筛选子列表 - Positioned _buildList(context) { - FilterItemModel item = widget.controller!.item; - return Positioned( - top: _animation.value, - left: 0, - right: 0, - child: LimitedBox( - maxHeight: _lineHeight * _lines + _topSpacing + _bottomSpacing, - child: Container( - padding: EdgeInsets.only(bottom: _bottomSpacing, top: 5), - height: _lineHeight * item.subtitles!.length + - _bottomSpacing + - _topSpacing, - decoration: BoxDecoration( - color: Color.fromARGB(240, 255, 255, 255), - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(10), - bottomRight: Radius.circular(10))), - child: MediaQuery.removePadding( - context: context, - removeTop: true, - child: ListView.builder( - physics: NeverScrollableScrollPhysics(), - controller: PrimaryScrollController.of(context), - itemCount: item.subtitles!.length, - itemBuilder: (context, index) { - bool subTitleSelected = item.selectedSubIndex == index; - return Container( - height: _lineHeight, - child: RawMaterialButton( - onPressed: () { - widget.controller!.helper - .changeOptionListStatus(OptionListStatus.close); - widget.controller!.updateToolBarState(false); - if (item.selectedSubIndex == index) return; - - item.selectedSubIndex = index; - String title = item.subtitleShort == null || - TextUtils.isEmpty(item.subtitleShort![index]) - ? item.subtitles![index] - : item.subtitleShort![index]; - item.title = title; - - widget.controller!.updateToolBarState(true); - }, - child: _sublistItem(index, item, subTitleSelected), - ), - ); - }), - ), - ), - ), - ); - } - - /// 子列表item - Container _sublistItem( - int index, FilterItemModel item, bool subTitleSelected) { - return Container( - padding: _subtitleRowPadding, - child: Row( - children: [ - Offstage( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 8), - child: Icon( - Icons.check, - size: 17, - color: Colors.red, - ), - ), - offstage: index != item.selectedSubIndex, - ), - Expanded( - child: Text( - item.subtitles![index], - style: TextStyle( - fontSize: _subTitleFont, - color: _unselectedColor, - fontWeight: - (subTitleSelected ? FontWeight.w600 : FontWeight.w400)), - )), - ], - ), - ); - } -} - -class FilterToolBar extends StatefulWidget { - FilterToolBar({ - required this.titles, - required this.listener, - required this.controller, - this.selectedColor, - this.maxLines = 4, - this.trialing, - this.startWidget, - this.fontSize = 15.0, - this.height = 40, - }) : assert(listener != null, "请设置监听事件"), - assert(controller != null, "请设置controller"); - - final List titles; - final Color? selectedColor; - final int maxLines; - final SelectedListener listener; - final Widget? trialing; - final Widget? startWidget; - final FilterToolBarController? controller; - final double fontSize; - final double height; - - @override - State createState() { - return _FilterToolBarState(); - } -} - -class _FilterToolBarState extends State - with TickerProviderStateMixin { - Color _unselectedColor = Colors.grey[700]!; - - GlobalKey _key = GlobalKey(); - - @override - void initState() { - super.initState(); - - widget.controller?.selectedIndex = widget.controller?.selectedIndex ?? 0; - - widget.controller?._toolBarKey = _key; - - widget.controller?.updateToolBarState = (bool update) { -// print("----- ${widget.controller.selectedIndex}"); - if (update) { - widget.listener( - widget.controller!.selectedIndex, widget.controller!.item); - } - setState(() {}); - }; - } - - @override - Widget build(BuildContext context) { - return Container( - width: double.infinity, - height: widget.height, - child: _buildToolBar(), - ); - } - - Container _buildToolBar() { - List items = []; - if (widget.startWidget != null) { - items.add(SizedBox( - width: 60, - )); - items.add(widget.startWidget!); - items.add(SizedBox( - width: 20, - )); - } - items.addAll(_buildToolBarItem()); - if (widget.trialing != null) { - items.add(widget.trialing!); - } - - return Container( - key: _key, - height: 40, - decoration: BoxDecoration( - color: Colors.white, - border: Border( - top: BorderSide(color: Colors.grey[200]!, width: 0.5), - bottom: BorderSide(color: Colors.grey[200]!, width: 0.5))), - child: Row( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: items, - ), - ); - } - - List _buildToolBarItem() { - return widget.titles.map((item) { - int index = widget.titles.indexOf(item); - bool selected = index == widget.controller?.selectedIndex; - Color color = (selected ? widget.selectedColor : _unselectedColor)!; - return Expanded( - child: GestureDetector( - onTap: () { - widget.controller?.item = item; - - /// 列表弹出后直接点击toolbar上按钮 列表消失 - if (widget.controller?.helper != null && - widget.controller?.helper.status == OptionListStatus.open) { - widget.controller?.helper.changeOptionListStatus( - OptionListStatus.close, - ); - } else { - if (item.type == FilterItemType.list) { - /// 当前已选中,再次点击弹出列表 - if (widget.controller?.selectedIndex == index) { - if (widget.controller?.helper != null) { - widget.controller?.helper.changeOptionListStatus( - OptionListStatus.open, - ); - } else { - FlutterError("列表类型需要与 FilterToolBarResultContainer 一起使用"); - } - } else { - /// 点击其他列表项时,把当前列表项之前选中的状态返回 - widget.listener(index, item); - } - } - } - - /// 上下箭头选项点击 - if (item.type == FilterItemType.double) { - if (widget.controller?.selectedIndex != index) { - item.selectedList![index] = true; - item.topSelected = item.selectedList![index]; - } else { - //print(item.topSelected); - //item.topSelected = !item.topSelected; - // print(widget.titles[index].topSelected); - item.selectedList![index] = !item.selectedList![index]; - item.topSelected = item.selectedList![index]; - } - widget.listener(index, item); - } - - /// 普通 - else if (item.type == FilterItemType.normal) { - if (widget.controller?.selectedIndex == index) return; - widget.listener(index, item); - } - - widget.controller?.selectedIndex = index; - - setState(() {}); - }, - child: Container( - color: Colors.white, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text(item.title, - style: TextStyle( - fontSize: widget.fontSize, - color: color, - fontWeight: FontWeight.w400) - // AppTextStyle.generate(widget.fontSize, - // color: color, fontWeight: FontWeight.w400), - ), - _buildArrow(item, color, selected, index) - ], - ), - ), - ), - ); - }).toList(); - } - - _buildArrow(FilterItemModel item, color, bool selected, int index) { - if (item.type == FilterItemType.list) { - return Icon( - selected - ? (widget.controller?.helper != null && - widget.controller?.helper.status == OptionListStatus.open - ? Icons.arrow_drop_up - : Icons.arrow_drop_down) - : Icons.arrow_drop_down, - color: color, - size: 19, - ); - } else if (item.type == FilterItemType.double) { - if (selected) { - return Padding( - padding: const EdgeInsets.only(left: 2.0), - child: Icon( - item.selectedList![index] - ? IconData(0xe620, fontFamily: "AppIcons") - : IconData(0xe621, fontFamily: "AppIcons"), - size: 7, - color: color, - ), - ); - } else { - return Padding( - padding: const EdgeInsets.only(left: 2.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon( - IconData(0xe620, fontFamily: "AppIcons"), - size: 7, - color: _unselectedColor, - ), - Icon( - IconData(0xe621, fontFamily: "AppIcons"), - size: 7, - color: _unselectedColor, - ), - ], - ), - ); - } - } else { - return Container(); - } - } -} - -enum FilterItemType { - /// 列表形式 - list, - - /// 价格等上下箭头 - double, - - /// 普通 - normal -} - -class FilterItemModel { - final FilterItemType type; - String title; - final List? subtitles; - - /// 列表下拉时的子标题 - final List? subtitleShort; - List? selectedList; - bool topSelected; - int selectedSubIndex = 0; - - FilterItemModel({ - required this.type, - required this.title, - this.selectedList, - this.subtitles, - this.subtitleShort, - this.topSelected = true, - }) : assert( - type == FilterItemType.list - ? (subtitles != null && subtitles.length > 0) - : true, - "type为list,列表项不能为空"); -} diff --git a/lib/pages/home/widget/home_search.dart b/lib/pages/home/widget/home_search.dart deleted file mode 100644 index 4cb5bbf7..00000000 --- a/lib/pages/home/widget/home_search.dart +++ /dev/null @@ -1,54 +0,0 @@ -import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class HomeSearch extends StatefulWidget { - HomeSearch({Key? key}) : super(key: key); - - @override - _HomeSearchState createState() => _HomeSearchState(); -} - -class _HomeSearchState extends State { - @override - Widget build(BuildContext context) { - return Container( - // decoration: BoxDecoration( - // gradient: LinearGradient( - // begin: Alignment.centerLeft, - // end: Alignment.centerRight, - // colors: [Color(0xffffd000), Color(0xffffbd00)], - // ), - // ), - color: Colors.white, - padding: EdgeInsets.only( - top: MediaQuery.of(context).padding.top, - left: 32.w, - right: 32.w, - bottom: 16.w, - ), - // child: MaterialButton( - // materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - // height: 72.w, - // shape: StadiumBorder(), - // elevation: 0, - // minWidth: double.infinity, - // color: Color(0xFFF3F3F3), - // onPressed: () { - // Get.to(() => BeeSearch()); - // }, - // child: Row( - // children: [ - // Icon( - // Icons.search, - // size: 32.w, - // color: Color(0xFF666666), - // ), - // 10.wb, - // '搜索应用'.text.size(28.sp).color(ktextSubColor).make().expand(), - // ], - // ), - // ), - ); - } -} diff --git a/lib/pages/house_introduce/house_introduce.dart b/lib/pages/house_introduce/house_introduce.dart index 8dd82b23..897df747 100644 --- a/lib/pages/house_introduce/house_introduce.dart +++ b/lib/pages/house_introduce/house_introduce.dart @@ -6,11 +6,9 @@ import 'package:aku_new_community/models/house_introduce/house_introduce_model.d import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; import 'house_detail_page.dart'; diff --git a/lib/pages/industry_committee/committee_mailbox/committee_mailbox_page.dart b/lib/pages/industry_committee/committee_mailbox/committee_mailbox_page.dart index 17d48063..88fa5400 100644 --- a/lib/pages/industry_committee/committee_mailbox/committee_mailbox_page.dart +++ b/lib/pages/industry_committee/committee_mailbox/committee_mailbox_page.dart @@ -1,6 +1,5 @@ import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class CommitteeMailboxPage extends StatefulWidget { diff --git a/lib/pages/industry_committee/industry_committee_page.dart b/lib/pages/industry_committee/industry_committee_page.dart index b3b3a841..e050f3fa 100644 --- a/lib/pages/industry_committee/industry_committee_page.dart +++ b/lib/pages/industry_committee/industry_committee_page.dart @@ -13,7 +13,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'package:velocity_x/velocity_x.dart'; class IndustryCommitteePage extends StatefulWidget { IndustryCommitteePage({Key? key}) : super(key: key); diff --git a/lib/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart b/lib/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart index 6f13543b..ff70d4e4 100644 --- a/lib/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart +++ b/lib/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart @@ -1,6 +1,5 @@ import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'widget/bill_card.dart'; diff --git a/lib/pages/life_pay/life_pay_bill_page/widget/bill_card.dart b/lib/pages/life_pay/life_pay_bill_page/widget/bill_card.dart index b84defd2..3e2e7d06 100644 --- a/lib/pages/life_pay/life_pay_bill_page/widget/bill_card.dart +++ b/lib/pages/life_pay/life_pay_bill_page/widget/bill_card.dart @@ -1,6 +1,5 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class BillCard extends StatelessWidget { diff --git a/lib/pages/life_pay/life_pay_page.dart b/lib/pages/life_pay/life_pay_page.dart index 750d96a0..e7aab54e 100644 --- a/lib/pages/life_pay/life_pay_page.dart +++ b/lib/pages/life_pay/life_pay_page.dart @@ -25,7 +25,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart' hide Response; import 'package:provider/provider.dart'; -import 'package:velocity_x/velocity_x.dart'; class LifePayPage extends StatefulWidget { LifePayPage({Key? key}) : super(key: key); diff --git a/lib/pages/life_pay/life_pay_record_page.dart b/lib/pages/life_pay/life_pay_record_page.dart index 49727c3e..c493c99a 100644 --- a/lib/pages/life_pay/life_pay_record_page.dart +++ b/lib/pages/life_pay/life_pay_record_page.dart @@ -1,16 +1,13 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/models/life_pay/life_pay_record_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:velocity_x/velocity_x.dart'; class LifePayRecordPage extends StatefulWidget { LifePayRecordPage({Key? key}) : super(key: key); diff --git a/lib/pages/life_pay/widget/submit_bar.dart b/lib/pages/life_pay/widget/submit_bar.dart index fe2b325b..8d708051 100644 --- a/lib/pages/life_pay/widget/submit_bar.dart +++ b/lib/pages/life_pay/widget/submit_bar.dart @@ -1,6 +1,5 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class SubmitBar extends StatefulWidget { diff --git a/lib/pages/manager_func.dart b/lib/pages/manager_func.dart index b44d8a2d..2048dbf2 100644 --- a/lib/pages/manager_func.dart +++ b/lib/pages/manager_func.dart @@ -9,7 +9,7 @@ import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:dio/dio.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; class ManagerFunc { @Deprecated('') diff --git a/lib/pages/message_center_page/announce/announce_card.dart b/lib/pages/message_center_page/announce/announce_card.dart index db89b0e5..9f4e6561 100644 --- a/lib/pages/message_center_page/announce/announce_card.dart +++ b/lib/pages/message_center_page/announce/announce_card.dart @@ -2,7 +2,7 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/models/message/announce_list_model.dart'; import 'package:aku_new_community/pages/message_center_page/announce/announce_view.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/pages/message_center_page/comment_message/comment_message_page.dart b/lib/pages/message_center_page/comment_message/comment_message_page.dart index 3a19d67b..9b18507c 100644 --- a/lib/pages/message_center_page/comment_message/comment_message_page.dart +++ b/lib/pages/message_center_page/comment_message/comment_message_page.dart @@ -1,4 +1,3 @@ -import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/message/comment_message_model.dart'; @@ -7,12 +6,9 @@ import 'package:aku_new_community/utils/bee_date_util.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:velocity_x/velocity_x.dart'; class CommentMessagePage extends StatefulWidget { CommentMessagePage({Key? key}) : super(key: key); diff --git a/lib/pages/message_center_page/refund_details.dart b/lib/pages/message_center_page/refund_details.dart index 21ad854a..c1c4d604 100644 --- a/lib/pages/message_center_page/refund_details.dart +++ b/lib/pages/message_center_page/refund_details.dart @@ -1,6 +1,5 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class RefundDetails extends StatelessWidget { diff --git a/lib/pages/one_alarm/widget/alarm_page.dart b/lib/pages/one_alarm/widget/alarm_page.dart index 154becc3..225c57f3 100644 --- a/lib/pages/one_alarm/widget/alarm_page.dart +++ b/lib/pages/one_alarm/widget/alarm_page.dart @@ -8,12 +8,10 @@ import 'package:amap_flutter_base/amap_flutter_base.dart'; import 'package:amap_flutter_map/amap_flutter_map.dart'; import 'package:flutter/material.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'package:velocity_x/velocity_x.dart'; class PermissionUtil { static Future getLocationPermission() async { diff --git a/lib/pages/opening_code_page/opening_code_page.dart b/lib/pages/opening_code_page/opening_code_page.dart index 2a7cc5f6..d3b0cd22 100644 --- a/lib/pages/opening_code_page/opening_code_page.dart +++ b/lib/pages/opening_code_page/opening_code_page.dart @@ -6,8 +6,7 @@ import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; -import 'package:flutter/cupertino.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_icons/flutter_icons.dart'; diff --git a/lib/pages/personal/address/address_list_page.dart b/lib/pages/personal/address/address_list_page.dart index b095f223..1b823db9 100644 --- a/lib/pages/personal/address/address_list_page.dart +++ b/lib/pages/personal/address/address_list_page.dart @@ -1,5 +1,3 @@ -import 'dart:ui'; - import 'package:aku_new_community/model/user/adress_model.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; diff --git a/lib/pages/personal/address/address_selector.dart b/lib/pages/personal/address/address_selector.dart index 135f2af0..fe2f6452 100644 --- a/lib/pages/personal/address/address_selector.dart +++ b/lib/pages/personal/address/address_selector.dart @@ -11,7 +11,6 @@ import 'package:aku_new_community/model/user/province_model.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/text_utils.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; typedef AddressSelectorCallback = Function( String province, String city, String disctrict, int? locationId); diff --git a/lib/pages/personal/address/new_address_page.dart b/lib/pages/personal/address/new_address_page.dart index 906faad1..ed06bc17 100644 --- a/lib/pages/personal/address/new_address_page.dart +++ b/lib/pages/personal/address/new_address_page.dart @@ -1,5 +1,3 @@ -import 'dart:ui'; - import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/model/user/adress_model.dart'; import 'package:aku_new_community/model/user/province_model.dart'; diff --git a/lib/pages/personal/intergral/integral_center_page.dart b/lib/pages/personal/intergral/integral_center_page.dart index d9ee3b3e..96308faa 100644 --- a/lib/pages/personal/intergral/integral_center_page.dart +++ b/lib/pages/personal/intergral/integral_center_page.dart @@ -2,7 +2,6 @@ import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/pages/personal/intergral/progress_paint.dart'; import 'package:aku_new_community/pages/personal/intergral/rule_explain_page.dart'; import 'package:aku_new_community/widget/bee_back_button.dart'; -import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -207,8 +206,7 @@ class _integralCenterPageState extends State { right: 0, top: 168.w, child: GestureDetector( - onTap: (){ - }, + onTap: () {}, child: Container( width: 176.w, height: 58.w, diff --git a/lib/pages/personal/personal_page.dart b/lib/pages/personal/personal_page.dart index 9054a52b..c6cca8e5 100644 --- a/lib/pages/personal/personal_page.dart +++ b/lib/pages/personal/personal_page.dart @@ -1,4 +1,3 @@ -import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/pages/personal/clock_in/clock_in_page.dart'; diff --git a/lib/pages/personal/update_tel_page.dart b/lib/pages/personal/update_tel_page.dart index febfeaeb..8835cde8 100644 --- a/lib/pages/personal/update_tel_page.dart +++ b/lib/pages/personal/update_tel_page.dart @@ -5,7 +5,7 @@ import 'package:aku_new_community/pages/sign/sign_func.dart'; import 'package:aku_new_community/provider/user_provider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/pages/personal/user_profile_page.dart b/lib/pages/personal/user_profile_page.dart index ed186552..58bb9eee 100644 --- a/lib/pages/personal/user_profile_page.dart +++ b/lib/pages/personal/user_profile_page.dart @@ -13,12 +13,11 @@ import 'package:aku_new_community/widget/picker/bee_custom_picker.dart'; import 'package:aku_new_community/widget/picker/bee_date_picker.dart'; import 'package:aku_new_community/widget/picker/bee_image_picker.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; -import 'package:velocity_x/velocity_x.dart'; class UserProfilePage extends StatefulWidget { UserProfilePage({Key? key}) : super(key: key); diff --git a/lib/pages/personal/widget/refund_shop_card.dart b/lib/pages/personal/widget/refund_shop_card.dart index b36cfd96..c2b058eb 100644 --- a/lib/pages/personal/widget/refund_shop_card.dart +++ b/lib/pages/personal/widget/refund_shop_card.dart @@ -1,6 +1,5 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class RefundShopCard extends StatelessWidget { diff --git a/lib/pages/personal/widget/refund_tile_card.dart b/lib/pages/personal/widget/refund_tile_card.dart index a6c53e35..880ed975 100644 --- a/lib/pages/personal/widget/refund_tile_card.dart +++ b/lib/pages/personal/widget/refund_tile_card.dart @@ -1,6 +1,5 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_icons/flutter_icons.dart'; diff --git a/lib/pages/property/property_page.dart b/lib/pages/property/property_page.dart index cb7d4cc2..7ac1dffd 100644 --- a/lib/pages/property/property_page.dart +++ b/lib/pages/property/property_page.dart @@ -1,5 +1,4 @@ import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/application_objects.dart'; import 'package:aku_new_community/pages/life_pay/life_pay_choose_page.dart'; import 'package:aku_new_community/pages/property/property_func.dart'; @@ -13,7 +12,6 @@ import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; diff --git a/lib/pages/renovation_manage/new_renovation/new_renovation_add_page.dart b/lib/pages/renovation_manage/new_renovation/new_renovation_add_page.dart index 37fb1409..9158f169 100644 --- a/lib/pages/renovation_manage/new_renovation/new_renovation_add_page.dart +++ b/lib/pages/renovation_manage/new_renovation/new_renovation_add_page.dart @@ -1,6 +1,5 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; @@ -11,7 +10,7 @@ import 'package:aku_new_community/widget/others/bee_input_row.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:aku_new_community/widget/picker/bee_date_picker.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; diff --git a/lib/pages/renovation_manage/renovation_manage_card.dart b/lib/pages/renovation_manage/renovation_manage_card.dart index f1e13fa6..e35ea92e 100644 --- a/lib/pages/renovation_manage/renovation_manage_card.dart +++ b/lib/pages/renovation_manage/renovation_manage_card.dart @@ -2,7 +2,7 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/pages/renovation_manage/renovation_manage_detail_page.dart'; import 'package:aku_new_community/pages/renovation_manage/renovation_map.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; diff --git a/lib/pages/renovation_manage/renovation_manage_detail_page.dart b/lib/pages/renovation_manage/renovation_manage_detail_page.dart index 4ee03ec9..36f18770 100644 --- a/lib/pages/renovation_manage/renovation_manage_detail_page.dart +++ b/lib/pages/renovation_manage/renovation_manage_detail_page.dart @@ -4,7 +4,7 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/pages/renovation_manage/renovation_map.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; diff --git a/lib/pages/service_browse/service_browse_detail_page.dart b/lib/pages/service_browse/service_browse_detail_page.dart index 4475bd08..c6e4c9df 100644 --- a/lib/pages/service_browse/service_browse_detail_page.dart +++ b/lib/pages/service_browse/service_browse_detail_page.dart @@ -2,7 +2,7 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/models/service_browse/service_browse_list_mode.dart'; import 'package:aku_new_community/utils/link_text_parase.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/pages/service_browse/service_browse_page.dart b/lib/pages/service_browse/service_browse_page.dart index 0ae09901..646e173e 100644 --- a/lib/pages/service_browse/service_browse_page.dart +++ b/lib/pages/service_browse/service_browse_page.dart @@ -4,7 +4,7 @@ import 'package:aku_new_community/models/service_browse/service_browse_list_mode import 'package:aku_new_community/pages/service_browse/service_browse_detail_page.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/pages/services/old_age/old_age_support_page_simple.dart b/lib/pages/services/old_age/old_age_support_page_simple.dart index f49a0642..e01938d7 100644 --- a/lib/pages/services/old_age/old_age_support_page_simple.dart +++ b/lib/pages/services/old_age/old_age_support_page_simple.dart @@ -8,7 +8,7 @@ import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:dio/dio.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/pages/setting_page/feedback_page/feedback_page.dart b/lib/pages/setting_page/feedback_page/feedback_page.dart index 0f35dee6..51b33785 100644 --- a/lib/pages/setting_page/feedback_page/feedback_page.dart +++ b/lib/pages/setting_page/feedback_page/feedback_page.dart @@ -6,7 +6,6 @@ import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/picker/grid_image_picker.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; diff --git a/lib/pages/setting_page/invite_page/invite_page.dart b/lib/pages/setting_page/invite_page/invite_page.dart index 0e74cbed..9fcbc080 100644 --- a/lib/pages/setting_page/invite_page/invite_page.dart +++ b/lib/pages/setting_page/invite_page/invite_page.dart @@ -1,6 +1,5 @@ import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:qr_flutter/qr_flutter.dart'; diff --git a/lib/pages/share_pay_page/share_pay_detail_page.dart b/lib/pages/share_pay_page/share_pay_detail_page.dart index a974edbe..2e4c5ccf 100644 --- a/lib/pages/share_pay_page/share_pay_detail_page.dart +++ b/lib/pages/share_pay_page/share_pay_detail_page.dart @@ -9,10 +9,8 @@ import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bee_check_radio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; -import 'package:velocity_x/velocity_x.dart'; class SharePayDetailPage extends StatefulWidget { final SharePayListModel model; diff --git a/lib/pages/share_pay_page/share_pay_page.dart b/lib/pages/share_pay_page/share_pay_page.dart index a72ae1e1..728c1e44 100644 --- a/lib/pages/share_pay_page/share_pay_page.dart +++ b/lib/pages/share_pay_page/share_pay_page.dart @@ -20,7 +20,6 @@ import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_easyrefresh/material_header.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; diff --git a/lib/pages/share_pay_page/share_record_page.dart b/lib/pages/share_pay_page/share_record_page.dart index 22ab674c..cdb2ef63 100644 --- a/lib/pages/share_pay_page/share_record_page.dart +++ b/lib/pages/share_pay_page/share_record_page.dart @@ -1,16 +1,13 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/models/life_pay/share_pay_record_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:velocity_x/velocity_x.dart'; class ShareRecordPage extends StatefulWidget { const ShareRecordPage({Key? key}) : super(key: key); diff --git a/lib/pages/sign/login/forgot_psd_page.dart b/lib/pages/sign/login/forgot_psd_page.dart index 5dec80aa..66926139 100644 --- a/lib/pages/sign/login/forgot_psd_page.dart +++ b/lib/pages/sign/login/forgot_psd_page.dart @@ -4,7 +4,7 @@ import 'package:aku_new_community/pages/sign/widget/tel_text_field.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; diff --git a/lib/pages/sign/login/other_login_page.dart b/lib/pages/sign/login/other_login_page.dart index 3a7bc3d6..206dfbe4 100644 --- a/lib/pages/sign/login/other_login_page.dart +++ b/lib/pages/sign/login/other_login_page.dart @@ -9,7 +9,7 @@ import 'package:aku_new_community/provider/app_provider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; diff --git a/lib/pages/sign/login/psd_verify.dart b/lib/pages/sign/login/psd_verify.dart index 98751447..488d126a 100644 --- a/lib/pages/sign/login/psd_verify.dart +++ b/lib/pages/sign/login/psd_verify.dart @@ -1,4 +1,4 @@ -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; enum PSDVERIFY { shorLength, Insufficient, different, correct, empty } diff --git a/lib/pages/sign/sign_in_page.dart b/lib/pages/sign/sign_in_page.dart index 31e5be7d..16b9a661 100644 --- a/lib/pages/sign/sign_in_page.dart +++ b/lib/pages/sign/sign_in_page.dart @@ -7,7 +7,7 @@ import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_back_button.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:get/get.dart' hide Response; diff --git a/lib/pages/splash/splash_page.dart b/lib/pages/splash/splash_page.dart index f30a36bf..911e28ef 100644 --- a/lib/pages/splash/splash_page.dart +++ b/lib/pages/splash/splash_page.dart @@ -1,6 +1,5 @@ import 'dart:io'; -import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/main_initialize.dart'; import 'package:aku_new_community/pages/setting_page/agreement_page/agreement_page.dart'; import 'package:aku_new_community/pages/setting_page/agreement_page/privacy_page.dart'; @@ -12,12 +11,10 @@ import 'package:aku_new_community/utils/hive_store.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:amap_flutter_location/amap_flutter_location.dart'; import 'package:flutter/cupertino.dart'; -import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:get/get.dart'; -import 'package:hive/hive.dart'; import 'package:hive_flutter/hive_flutter.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:power_logger/power_logger.dart'; diff --git a/lib/pages/surrounding_enterprises/surrounding_enterprises_page.dart b/lib/pages/surrounding_enterprises/surrounding_enterprises_page.dart index 6de8b8bd..5e1b39d8 100644 --- a/lib/pages/surrounding_enterprises/surrounding_enterprises_page.dart +++ b/lib/pages/surrounding_enterprises/surrounding_enterprises_page.dart @@ -7,11 +7,9 @@ import 'package:aku_new_community/pages/surrounding_enterprises/surrounding_ente import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class SurroundingEnterprisesPage extends StatefulWidget { SurroundingEnterprisesPage({Key? key}) : super(key: key); diff --git a/lib/pages/things_page/widget/add_fixed_submit_page.dart b/lib/pages/things_page/widget/add_fixed_submit_page.dart index d833a0ef..39acd874 100644 --- a/lib/pages/things_page/widget/add_fixed_submit_page.dart +++ b/lib/pages/things_page/widget/add_fixed_submit_page.dart @@ -3,7 +3,6 @@ import 'dart:io'; import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/app_theme.dart'; -import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/pages/manager_func.dart'; import 'package:aku_new_community/pages/things_page/widget/finish_fixed_submit_page.dart'; import 'package:aku_new_community/provider/app_provider.dart'; @@ -16,12 +15,9 @@ import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/others/house_head_card.dart'; import 'package:aku_new_community/widget/picker/grid_image_picker.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; -import 'package:velocity_x/velocity_x.dart'; class AddFixedSubmitPage extends StatefulWidget { AddFixedSubmitPage({Key? key}) : super(key: key); diff --git a/lib/pages/things_page/widget/fixed_detail_page.dart b/lib/pages/things_page/widget/fixed_detail_page.dart index 39f5d16c..7c24b4b4 100644 --- a/lib/pages/things_page/widget/fixed_detail_page.dart +++ b/lib/pages/things_page/widget/fixed_detail_page.dart @@ -1,5 +1,4 @@ import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/models/manage/fix_report/fix_detail_model.dart'; import 'package:aku_new_community/pages/life_pay/pay_finish_page.dart'; @@ -16,10 +15,8 @@ import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'package:velocity_x/velocity_x.dart'; class FixedDetailPage extends StatefulWidget { final int id; diff --git a/lib/pages/visitor_access_page/visitor_access_page.dart b/lib/pages/visitor_access_page/visitor_access_page.dart index 8b59442d..6f796b50 100644 --- a/lib/pages/visitor_access_page/visitor_access_page.dart +++ b/lib/pages/visitor_access_page/visitor_access_page.dart @@ -9,7 +9,7 @@ import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/common_input.dart'; import 'package:aku_new_community/widget/picker/bee_date_picker.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_icons/flutter_icons.dart'; diff --git a/lib/provider/user_provider.dart b/lib/provider/user_provider.dart index 1352b577..57df1030 100644 --- a/lib/provider/user_provider.dart +++ b/lib/provider/user_provider.dart @@ -12,7 +12,7 @@ import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/utils/websocket/web_socket_util.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/foundation.dart'; import 'package:get/get.dart'; import 'package:jpush_flutter/jpush_flutter.dart'; diff --git a/lib/ui/community/activity/activity_card.dart b/lib/ui/community/activity/activity_card.dart index 2b7fc662..6ef6cdac 100644 --- a/lib/ui/community/activity/activity_card.dart +++ b/lib/ui/community/activity/activity_card.dart @@ -3,7 +3,7 @@ import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/community/activity_item_model.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; @@ -29,9 +29,9 @@ class ActivityCard extends StatelessWidget { elevation: 0, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(24.w), - side: BorderSide( - color: Colors.grey, - ), + // side: BorderSide( + // color: Colors.grey, + // ), ), materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, child: Column( @@ -78,12 +78,18 @@ class ActivityCard extends StatelessWidget { height: 39.w, width: 98.w, decoration: BoxDecoration( - color: outdate ? Color(0xFFABABAB) : Color(0x80FEBF76), + color: outdate + ? Colors.black.withOpacity(0.06) + : Color(0x80FEBF76), borderRadius: BorderRadius.all(Radius.circular(4)), ), child: outdate - ? '已结束'.text.size(22.sp).color(Color(0xFF666666)).make() + ? '已结束' + .text + .size(22.sp) + .color(Colors.black.withOpacity(0.25)) + .make() : '报名中' .text .size(22.sp) diff --git a/lib/ui/community/activity/activity_detail_page.dart b/lib/ui/community/activity/activity_detail_page.dart index 8005e0e3..ca95881b 100644 --- a/lib/ui/community/activity/activity_detail_page.dart +++ b/lib/ui/community/activity/activity_detail_page.dart @@ -4,7 +4,7 @@ import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/others/stack_avatar.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/ui/community/activity/activity_detail_page_old.dart b/lib/ui/community/activity/activity_detail_page_old.dart index 9ac9ae28..87ed370d 100644 --- a/lib/ui/community/activity/activity_detail_page_old.dart +++ b/lib/ui/community/activity/activity_detail_page_old.dart @@ -11,7 +11,7 @@ import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/others/stack_avatar.dart'; import 'package:aku_new_community/widget/picker/bee_image_preview.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; diff --git a/lib/ui/community/facility/facility_preorder_page.dart b/lib/ui/community/facility/facility_preorder_page.dart index 061982bd..12f250e2 100644 --- a/lib/ui/community/facility/facility_preorder_page.dart +++ b/lib/ui/community/facility/facility_preorder_page.dart @@ -13,7 +13,7 @@ import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/picker/bee_date_picker.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; diff --git a/lib/ui/community/notice/notice_card.dart b/lib/ui/community/notice/notice_card.dart index f45879b1..ba82c4f2 100644 --- a/lib/ui/community/notice/notice_card.dart +++ b/lib/ui/community/notice/notice_card.dart @@ -5,7 +5,7 @@ import 'package:aku_new_community/model/community/board_model.dart'; import 'package:aku_new_community/ui/community/notice/notice_detail_page.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/picker/bee_image_preview.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; diff --git a/lib/ui/home/public_infomation/public_infomation_card.dart b/lib/ui/home/public_infomation/public_infomation_card.dart index 9d66eb83..9e1e123f 100644 --- a/lib/ui/home/public_infomation/public_infomation_card.dart +++ b/lib/ui/home/public_infomation/public_infomation_card.dart @@ -4,7 +4,7 @@ import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/models/news/news_item_model.dart'; import 'package:aku_new_community/ui/home/public_infomation/public_information_detail_page.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; diff --git a/lib/ui/home/public_infomation/public_information_detail_page.dart b/lib/ui/home/public_infomation/public_information_detail_page.dart index b56ec2e6..107a847c 100644 --- a/lib/ui/home/public_infomation/public_information_detail_page.dart +++ b/lib/ui/home/public_infomation/public_information_detail_page.dart @@ -6,7 +6,7 @@ import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; diff --git a/lib/ui/manager/advice/advice_add_comment_page.dart b/lib/ui/manager/advice/advice_add_comment_page.dart index aa3dc66c..099c3f6b 100644 --- a/lib/ui/manager/advice/advice_add_comment_page.dart +++ b/lib/ui/manager/advice/advice_add_comment_page.dart @@ -4,7 +4,7 @@ import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; diff --git a/lib/ui/manager/advice/advice_card.dart b/lib/ui/manager/advice/advice_card.dart index 882eb3bb..daf3a6a3 100644 --- a/lib/ui/manager/advice/advice_card.dart +++ b/lib/ui/manager/advice/advice_card.dart @@ -3,7 +3,7 @@ import 'package:aku_new_community/model/manager/suggestion_or_complain_model.dar import 'package:aku_new_community/ui/manager/advice/advice_detail_page.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/views/horizontal_image_view.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:get/get.dart'; diff --git a/lib/ui/manager/advice/advice_detail_page.dart b/lib/ui/manager/advice/advice_detail_page.dart index 098bd173..56bfdd04 100644 --- a/lib/ui/manager/advice/advice_detail_page.dart +++ b/lib/ui/manager/advice/advice_detail_page.dart @@ -13,7 +13,7 @@ import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/views/bee_grid_image_view.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:dio/dio.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart' hide Response; diff --git a/lib/ui/manager/advice/new_advice_page.dart b/lib/ui/manager/advice/new_advice_page.dart index c38f01b2..86189bb3 100644 --- a/lib/ui/manager/advice/new_advice_page.dart +++ b/lib/ui/manager/advice/new_advice_page.dart @@ -12,7 +12,7 @@ import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/picker/grid_image_picker.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/ui/manager/house_keeping/house_keeping_card.dart b/lib/ui/manager/house_keeping/house_keeping_card.dart index 25d8c11d..e4afdfdc 100644 --- a/lib/ui/manager/house_keeping/house_keeping_card.dart +++ b/lib/ui/manager/house_keeping/house_keeping_card.dart @@ -9,7 +9,7 @@ import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/buttons/card_bottom_button.dart'; import 'package:aku_new_community/widget/others/aku_chip_box.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; diff --git a/lib/ui/manager/house_keeping/house_keeping_detail_page.dart b/lib/ui/manager/house_keeping/house_keeping_detail_page.dart index 359ee9b6..3c15bf68 100644 --- a/lib/ui/manager/house_keeping/house_keeping_detail_page.dart +++ b/lib/ui/manager/house_keeping/house_keeping_detail_page.dart @@ -13,7 +13,7 @@ import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/views/bee_grid_image_view.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart'; diff --git a/lib/ui/manager/questionnaire/questionnaire_page.dart b/lib/ui/manager/questionnaire/questionnaire_page.dart index 2914a76f..385be67d 100644 --- a/lib/ui/manager/questionnaire/questionnaire_page.dart +++ b/lib/ui/manager/questionnaire/questionnaire_page.dart @@ -9,7 +9,7 @@ import 'package:aku_new_community/utils/hive_store.dart'; import 'package:aku_new_community/utils/websocket/tips_dialog.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/stack_avatar.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; diff --git a/lib/ui/manager/visitor/visitor_list_item.dart b/lib/ui/manager/visitor/visitor_list_item.dart index 669dfb5e..b4d3cd97 100644 --- a/lib/ui/manager/visitor/visitor_list_item.dart +++ b/lib/ui/manager/visitor/visitor_list_item.dart @@ -5,7 +5,7 @@ import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; diff --git a/lib/ui/manager/visitor/visitor_passport_page.dart b/lib/ui/manager/visitor/visitor_passport_page.dart index c8929f93..eef139b4 100644 --- a/lib/ui/manager/visitor/visitor_passport_page.dart +++ b/lib/ui/manager/visitor/visitor_passport_page.dart @@ -9,7 +9,7 @@ import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_back_button.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; diff --git a/lib/ui/market/category/new_category_sub_card.dart b/lib/ui/market/category/new_category_sub_card.dart index 33442dd3..f3a3e827 100644 --- a/lib/ui/market/category/new_category_sub_card.dart +++ b/lib/ui/market/category/new_category_sub_card.dart @@ -21,7 +21,7 @@ class NewCategorySubCard extends StatelessWidget { Spacer(), FadeInImage.assetNetwork( image: API.image( - subModels.imgUrls!.isNotEmpty ? subModels.imgUrls!.first : ''), + subModels.imgUrls.isNotEmpty ? subModels.imgUrls.first : ''), //subModels.imgUrls!.isNotEmpty? subModels.imgUrls!.first :'', placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, height: 75.w, diff --git a/lib/ui/market/category/new_category_sub_view.dart b/lib/ui/market/category/new_category_sub_view.dart index 87beb67d..57ccbbd3 100644 --- a/lib/ui/market/category/new_category_sub_view.dart +++ b/lib/ui/market/category/new_category_sub_view.dart @@ -20,9 +20,9 @@ class _NewCategorySubViewState extends State super.build(context); return ListView.builder( itemBuilder: (context, index) { - return _SecondCard(widget.model.categoryList![index]); + return _SecondCard(widget.model.categoryList[index]); }, - itemCount: widget.model.categoryList!.length, + itemCount: widget.model.categoryList.length, ); } @@ -56,10 +56,10 @@ class _NewCategorySubViewState extends State shrinkWrap: true, itemBuilder: (context, index) { return NewCategorySubCard( - subModels: item.categoryList![index], + subModels: item.categoryList[index], ); }, - itemCount: item.categoryList!.length, + itemCount: item.categoryList.length, ), ], ), diff --git a/lib/ui/market/collection/collection_list_card.dart b/lib/ui/market/collection/collection_list_card.dart index be4635f4..ae620da9 100644 --- a/lib/ui/market/collection/collection_list_card.dart +++ b/lib/ui/market/collection/collection_list_card.dart @@ -156,7 +156,7 @@ class CollectionListCard extends StatelessWidget { // 24.wb, GestureDetector( onTap: () async { - await CollectionFunc.collection(model.id!); + await CollectionFunc.collection(model.id); refreshController.callRefresh(); }, diff --git a/lib/ui/market/market_page.dart b/lib/ui/market/market_page.dart index 12f29d52..8d2aa6df 100644 --- a/lib/ui/market/market_page.dart +++ b/lib/ui/market/market_page.dart @@ -25,14 +25,12 @@ import 'package:aku_new_community/utils/network/base_list_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/home/home_sliver_app_bar.dart'; import 'package:aku_new_community/widget/others/rectIndicator.dart'; +import 'package:card_swiper/card_swiper.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_swiper_null_safety/flutter_swiper_null_safety.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; -import 'package:velocity_x/velocity_x.dart'; import 'category/new_category_page.dart'; import 'market_home_goods_card.dart'; @@ -974,7 +972,7 @@ class _MarketPageState extends State ], ); }, - itemCount: 6, + itemCount: _goodsPopularModelList.length, shrinkWrap: true, ), // Row( diff --git a/lib/ui/market/search/good_detail_bottomSheet.dart b/lib/ui/market/search/good_detail_bottomSheet.dart index 351b3468..ddefe1f5 100644 --- a/lib/ui/market/search/good_detail_bottomSheet.dart +++ b/lib/ui/market/search/good_detail_bottomSheet.dart @@ -34,13 +34,9 @@ class _GoodDetailBottomSheetState extends State void initState() { super.initState(); _scrollController = ScrollController(); - if (widget.goodDetail.jcookSpecificationVoList != null) { - widget.goodDetail.jcookSpecificationVoList!.forEach((element) { - if (element.attribute != null) { - attributes.addAll(element.attribute!); - } - }); - } + widget.goodDetail.jcookSpecificationVoList.forEach((element) { + attributes.addAll(element.attribute); + }); } @override diff --git a/lib/ui/market/search/good_detail_page.dart b/lib/ui/market/search/good_detail_page.dart index d50c0d2b..2d3875c2 100644 --- a/lib/ui/market/search/good_detail_page.dart +++ b/lib/ui/market/search/good_detail_page.dart @@ -274,9 +274,7 @@ class _GoodDetailPageState extends State { 16.wb, '原价:¥'.text.color(Color(0xFFBBBBBB)).size(24.sp).make(), Text( - _goodDetail!.sellPrice == null - ? '' - : (_goodDetail!.sellPrice!).toStringAsFixed(2), + (_goodDetail!.sellPrice).toStringAsFixed(2), style: TextStyle( fontSize: 24.sp, decoration: TextDecoration.lineThrough, @@ -309,9 +307,7 @@ class _GoodDetailPageState extends State { 16.wb, '¥'.text.color(Color(0xFFE52E2E)).size(28.sp).make(), Text( - _goodDetail!.sellPrice == null - ? '' - : (_goodDetail!.sellPrice!).toStringAsFixed(2), + (_goodDetail!.sellPrice).toStringAsFixed(2), style: TextStyle(fontSize: 40.sp, color: Color(0xFFE52E2E)), ), Spacer(), @@ -343,18 +339,15 @@ class _GoodDetailPageState extends State { 16.wb, '原价:'.text.color(Color(0xFFBBBBBB)).size(24.sp).make(), Text( - _goodDetail!.discountPrice == null - ? '' - : (_goodDetail!.discountPrice!).toStringAsFixed(2), + (_goodDetail!.discountPrice).toStringAsFixed(2), style: TextStyle(fontSize: 24.sp, color: Color(0xFFBBBBBB)), ), 50.wb, '折扣:'.text.color(Color(0xFFBBBBBB)).size(24.sp).make(), Text( - (_goodDetail!.discountPrice ?? 0) > - (_goodDetail!.sellPrice ?? 0) - ? _getDiscount(_goodDetail!.sellPrice.toDouble() ?? -1, - _goodDetail!.discountPrice.toDouble() ?? -1) + (_goodDetail!.discountPrice) > (_goodDetail!.sellPrice) + ? _getDiscount(_goodDetail!.sellPrice.toDouble(), + _goodDetail!.discountPrice.toDouble()) : '暂无折扣', style: TextStyle(fontSize: 24.sp, color: Color(0xFFBBBBBB)), ), @@ -608,7 +601,7 @@ class _GoodDetailPageState extends State { 40.wb, GestureDetector( onTap: () async { - await CollectionFunc.collection(_goodDetail!.id!); + await CollectionFunc.collection(_goodDetail!.id); _refreshController.callRefresh(); }, child: Column( @@ -656,7 +649,7 @@ class _GoodDetailPageState extends State { children: [ GestureDetector( onTap: () async { - await SearchFunc.addGoodsCar(_goodDetail!.id!); + await SearchFunc.addGoodsCar(_goodDetail!.id); }, child: Container( width: 230.w, @@ -731,7 +724,7 @@ class _GoodDetailPageState extends State { child: FadeInImage.assetNetwork( fit: BoxFit.fill, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: imgList[index].url ?? ''), + image: imgList[index].url), ); }), ), diff --git a/lib/ui/market/search/submit_order_page_normal.dart b/lib/ui/market/search/submit_order_page_normal.dart index 0be59a17..864389f8 100644 --- a/lib/ui/market/search/submit_order_page_normal.dart +++ b/lib/ui/market/search/submit_order_page_normal.dart @@ -345,7 +345,7 @@ class _SubmitOrderNormalPageState extends State { int num = int.parse(_controllers.text); print(num); allNum += num; - allPrice += (widget.goodModel.sellPrice! * num); + allPrice += (widget.goodModel.sellPrice * num); _allPrice = allPrice + fee; @@ -465,7 +465,7 @@ class _SubmitOrderNormalPageState extends State { 92.wb, '购买数量'.text.size(28.sp).color(Color(0xFF333333)).make(), Spacer(), - _getBottomSuffix(GoodStatus.onSell, model.id!) + _getBottomSuffix(GoodStatus.onSell, model.id) ], ), 48.hb, @@ -491,7 +491,7 @@ class _SubmitOrderNormalPageState extends State { .make(), 5.wb, '商品金额:'.text.size(28.sp).color(Color(0xFF333333)).make(), - '¥${(num * model.sellPrice!).toStringAsFixed(2)}' + '¥${(num * model.sellPrice).toStringAsFixed(2)}' .text .size(28.sp) .color(Color(0xFF333333)) @@ -524,7 +524,7 @@ class _SubmitOrderNormalPageState extends State { ), child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: model.jcookImageVoList![0].url ?? '', + image: model.jcookImageVoList![0].url, height: 188.w, width: 188.w, ), @@ -549,7 +549,7 @@ class _SubmitOrderNormalPageState extends State { children: [ Container( child: top, - width: model.sellPrice! > 9999 ? 300.w : 320.w, + width: model.sellPrice > 9999 ? 300.w : 320.w, alignment: Alignment.topCenter, ), @@ -570,7 +570,7 @@ class _SubmitOrderNormalPageState extends State { '¥' .richText .withTextSpanChildren([ - model.sellPrice! + model.sellPrice .toStringAsFixed(2) .textSpan .size(28.sp) diff --git a/lib/ui/profile/house/add_house_page.dart b/lib/ui/profile/house/add_house_page.dart index 1d91d509..b5b035c7 100644 --- a/lib/ui/profile/house/add_house_page.dart +++ b/lib/ui/profile/house/add_house_page.dart @@ -7,7 +7,7 @@ import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/ui/profile/house/contract_stop/pay_surplus_rent_page.dart b/lib/ui/profile/house/contract_stop/pay_surplus_rent_page.dart index 273b958a..6e9bcd00 100644 --- a/lib/ui/profile/house/contract_stop/pay_surplus_rent_page.dart +++ b/lib/ui/profile/house/contract_stop/pay_surplus_rent_page.dart @@ -10,7 +10,7 @@ import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/others/bee_input_row.dart'; import 'package:aku_new_community/widget/others/house_head_card.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; diff --git a/lib/ui/profile/house/contract_stop/upload_empty_list_page.dart b/lib/ui/profile/house/contract_stop/upload_empty_list_page.dart index 6134114a..5924240d 100644 --- a/lib/ui/profile/house/contract_stop/upload_empty_list_page.dart +++ b/lib/ui/profile/house/contract_stop/upload_empty_list_page.dart @@ -12,7 +12,7 @@ import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:aku_new_community/widget/picker/bee_date_picker.dart'; import 'package:aku_new_community/widget/views/doc_view.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/ui/profile/house/house_card.dart b/lib/ui/profile/house/house_card.dart index 66398e11..e297cac1 100644 --- a/lib/ui/profile/house/house_card.dart +++ b/lib/ui/profile/house/house_card.dart @@ -2,7 +2,7 @@ import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/models/user/passed_house_list_model.dart'; import 'package:aku_new_community/ui/profile/house/pick_my_house_page.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; @@ -27,14 +27,14 @@ class HouseCard extends StatelessWidget { Key? key, required this.model, required this.isOwner, - }) : type = CardAuthType.FAIL, + }) : type = CardAuthType.FAIL, super(key: key); const HouseCard.success({ Key? key, required this.model, required this.isOwner, - }) : type = CardAuthType.SUCCESS, + }) : type = CardAuthType.SUCCESS, super(key: key); String get _assetPath { diff --git a/lib/ui/profile/house/house_owners_page.dart b/lib/ui/profile/house/house_owners_page.dart index e9504245..704f259d 100644 --- a/lib/ui/profile/house/house_owners_page.dart +++ b/lib/ui/profile/house/house_owners_page.dart @@ -17,7 +17,7 @@ import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/ui/profile/house/lease_pay_query/lease_pay_query_detail_page.dart b/lib/ui/profile/house/lease_pay_query/lease_pay_query_detail_page.dart index d48134a5..87b252d1 100644 --- a/lib/ui/profile/house/lease_pay_query/lease_pay_query_detail_page.dart +++ b/lib/ui/profile/house/lease_pay_query/lease_pay_query_detail_page.dart @@ -10,7 +10,7 @@ import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:power_logger/power_logger.dart'; diff --git a/lib/ui/profile/house/lease_pay_query/lease_pay_query_page.dart b/lib/ui/profile/house/lease_pay_query/lease_pay_query_page.dart index ddbab7e3..541ef0bf 100644 --- a/lib/ui/profile/house/lease_pay_query/lease_pay_query_page.dart +++ b/lib/ui/profile/house/lease_pay_query/lease_pay_query_page.dart @@ -8,7 +8,7 @@ import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; diff --git a/lib/ui/profile/house/my_house_list.dart b/lib/ui/profile/house/my_house_list.dart index 6d6b5991..67171752 100644 --- a/lib/ui/profile/house/my_house_list.dart +++ b/lib/ui/profile/house/my_house_list.dart @@ -6,7 +6,7 @@ import 'package:aku_new_community/ui/profile/house/house_func.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/bee_row_tile.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/ui/profile/new_house/certification/certification_page.dart b/lib/ui/profile/new_house/certification/certification_page.dart index b301f3cb..5cdde2b1 100644 --- a/lib/ui/profile/new_house/certification/certification_page.dart +++ b/lib/ui/profile/new_house/certification/certification_page.dart @@ -7,7 +7,7 @@ import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; diff --git a/lib/ui/service/hall/hall_card.dart b/lib/ui/service/hall/hall_card.dart new file mode 100644 index 00000000..c6fd7062 --- /dev/null +++ b/lib/ui/service/hall/hall_card.dart @@ -0,0 +1,174 @@ +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/models/task/hall_list_model.dart'; +import 'package:aku_new_community/ui/service/hall/hall_detail_page.dart'; +import 'package:aku_new_community/ui/service/task_map.dart'; +import 'package:aku_new_community/widget/buttons/card_bottom_button.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + +import '../task_func.dart'; + +class HallCard extends StatelessWidget { + final HallListModel model; + final VoidCallback refresh; + + const HallCard({Key? key, required this.model, required this.refresh}) + : super(key: key); + + @override + Widget build(BuildContext context) { + var head = Row( + children: [ + Container( + width: 100.w, + height: 50.w, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFFFFF7E6), + borderRadius: BorderRadius.circular(8.w), + ), + child: '#${TaskMap.typeToString[model.type]}' + .text + .size(28.sp) + .color(Color(0xFFFA8C16)) + .make(), + ), + Spacer(), + Assets.icons.intergral.image(width: 24.w, height: 24.w), + 8.w.widthBox, + '${model.reward}'.text.size(32.sp).color(Colors.red).make() + ], + ); + return GestureDetector( + onTap: () { + Get.to(() => HallDetailPage(model: model)); + }, + child: Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.w), + ), + padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w), + child: Column( + children: [ + head, + 34.w.heightBox, + Row( + children: [ + Assets.icons.clockCircle.image(width: 36.w, height: 36.w), + 24.w.widthBox, + '${DateUtil.formatDateStr(model.appointmentDate)}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + 20.w.heightBox, + Row( + children: [ + Assets.icons.environment.image(width: 36.w, height: 36.w), + 24.w.widthBox, + '${model.appointmentAddress}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + 34.w.heightBox, + Container( + width: 638.w, + decoration: BoxDecoration( + color: Colors.black.withOpacity(0.03), + borderRadius: BorderRadius.circular(8.w)), + padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '#${TaskMap.typeToString[model.type]}' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + 16.w.heightBox, + model.content.text + .size(28.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + ), + 40.w.heightBox, + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + 40.w.heightBox, + Row( + children: [ + Spacer(), + CardBottomButton.yellow( + text: '领取任务', + onPressed: () async { + var re = await TaskFunc.take(taskId: model.id); + if (re) { + refresh(); + } + }), + ], + ), + ], + ), + ], + ), + ), + ); + } + + Widget _cardBottom(int) { + switch (int) { + case 1: + case 2: + return Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + 40.w.heightBox, + CardBottomButton.white( + text: '取消订单', + onPressed: () async { + var re = await TaskFunc.cancel(taskId: model.id); + if (re) { + refresh(); + } + }), + CardBottomButton.yellow( + text: '确认完成', + onPressed: () async { + var re = await TaskFunc.finish(taskId: model.id); + if (re) { + refresh(); + } + }), + ], + ); + case 4: + return Column( + children: [ + 32.w.heightBox, + Row( + children: [ + '客户取消:暂不需要该服务'.text.size(24.sp).color(Colors.red).make(), + Spacer(), + ], + ), + ], + ); + default: + return SizedBox.shrink(); + } + } +} diff --git a/lib/ui/service/hall/hall_detail_page.dart b/lib/ui/service/hall/hall_detail_page.dart new file mode 100644 index 00000000..4e46d44a --- /dev/null +++ b/lib/ui/service/hall/hall_detail_page.dart @@ -0,0 +1,268 @@ +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/models/task/hall_list_model.dart'; +import 'package:aku_new_community/ui/service/task_map.dart'; +import 'package:aku_new_community/widget/bee_divider.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class HallDetailPage extends StatefulWidget { + final HallListModel model; + + const HallDetailPage({Key? key, required this.model}) : super(key: key); + + @override + _HallDetailPageState createState() => _HallDetailPageState(); +} + +class _HallDetailPageState extends State { + @override + Widget build(BuildContext context) { + return BeeScaffold( + extendBody: true, + title: '', + body: Stack( + children: [ + Column( + children: [ + Container( + width: double.infinity, + height: 380.w, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: widget.model.status == 4 + ? [ + Colors.white, + Color(0xFFADACAC), + ] + : [ + Color(0xFFFFB737), + Color(0xFFFFD361), + ]), + ), + child: Column( + children: [ + 150.w.heightBox, + Row( + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 32.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '${TaskMap.detailStatusToString[widget.model.status]}' + .text + .size(40.sp) + .color(Colors.black) + .bold + .make(), + '${TaskMap.subStatus[widget.model.status]}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ], + ), + ), + Spacer(), + // Padding( + // padding: EdgeInsets.only(right: 32.w), + // child: MaterialButton( + // color: Colors.white, + // elevation: 0, + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(8.w), + // ), + // onPressed: () async { + // var re = await TaskFunc.cancel( + // taskId: widget.model.id); + // if (re) { + // Get.back(); + // } + // }, + // child: '取消订单' + // .text + // .size(24.sp) + // .color(Colors.black.withOpacity(0.65)) + // .make(), + // ), + // ) + ], + ), + ], + ), + ), + Flexible( + child: Container( + width: double.infinity, + color: Color(0xFFE5E5E5), + ), + ), + ], + ), + Positioned( + top: 280.w, + left: 32.w, + right: 32.w, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + _content(), + 24.w.heightBox, + _taskInfo(), + ], + )), + ], + ), + ); + } + + Widget _taskInfo() { + return Container( + width: 686.w, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.w), + ), + padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w), + child: Column( + children: [ + Row( + children: [ + '任务信息'.text.size(28.sp).color(Colors.black).bold.make(), + Spacer(), + ], + ), + 24.w.heightBox, + BeeDivider.horizontal(), + 24.w.heightBox, + Row( + children: [ + '创建时间' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + Spacer(), + '${DateUtil.formatDateStr(widget.model.createDate)}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make() + ], + ), + ], + ), + ); + } + + Widget _content() { + var head = Row( + children: [ + Container( + width: 100.w, + height: 50.w, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFFFFF7E6), + borderRadius: BorderRadius.circular(8.w), + ), + child: '#${TaskMap.typeToString[widget.model.type]}' + .text + .size(28.sp) + .color(Color(0xFFFA8C16)) + .make(), + ), + Spacer(), + Assets.icons.intergral.image(width: 24.w, height: 24.w), + 8.w.widthBox, + '${widget.model.reward}'.text.size(32.sp).color(Colors.red).make() + ], + ); + return Container( + width: 686.w, + height: 500.w, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.w), + ), + padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w), + child: Column( + children: [ + head, + 34.w.heightBox, + Row( + children: [ + Assets.icons.clockCircle.image(width: 36.w, height: 36.w), + 24.w.widthBox, + '${DateUtil.formatDateStr(widget.model.appointmentDate)}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + 20.w.heightBox, + Row( + children: [ + Assets.icons.environment.image(width: 36.w, height: 36.w), + 24.w.widthBox, + '${widget.model.appointmentAddress}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + 34.w.heightBox, + Container( + width: 638.w, + decoration: BoxDecoration( + color: Colors.black.withOpacity(0.03), + borderRadius: BorderRadius.circular(8.w)), + padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '#${TaskMap.typeToString[widget.model.type]}' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + 16.w.heightBox, + widget.model.content.text + .size(28.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + ), + 32.w.heightBox, + BeeDivider.horizontal(), + 32.w.heightBox, + Row( + children: [ + Assets.icons.reward.image(width: 36.w, height: 36.w), + 24.w.widthBox, + '报酬' + .text + .size(26.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + Spacer(), + '¥${widget.model.reward}' + .text + .size(32.sp) + .color(Colors.red) + .make(), + ], + ), + ], + ), + ); + } +} diff --git a/lib/ui/service/hall/hall_view.dart b/lib/ui/service/hall/hall_view.dart new file mode 100644 index 00000000..efe39722 --- /dev/null +++ b/lib/ui/service/hall/hall_view.dart @@ -0,0 +1,49 @@ +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/models/task/hall_list_model.dart'; +import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/src/extensions/num_ext.dart'; + +import 'hall_card.dart'; + +class HallView extends StatefulWidget { + const HallView({Key? key}) : super(key: key); + + @override + _HallViewState createState() => _HallViewState(); +} + +class _HallViewState extends State { + EasyRefreshController _refreshController = EasyRefreshController(); + + @override + void dispose() { + _refreshController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return BeeListView( + path: API.manager.task.hallList, + controller: _refreshController, + extraParams: {}, + convert: (json) => + json.tableList!.map((e) => HallListModel.fromJson(e)).toList(), + builder: (models) { + return ListView.separated( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), + itemBuilder: (context, index) { + return HallCard( + model: models[index], + refresh: () => _refreshController.callRefresh()); + }, + separatorBuilder: (_, __) { + return 24.w.heightBox; + }, + itemCount: models.length); + }); + } +} diff --git a/lib/ui/service/my_take_task/my_take_task_card.dart b/lib/ui/service/my_take_task/my_take_task_card.dart new file mode 100644 index 00000000..762712ef --- /dev/null +++ b/lib/ui/service/my_take_task/my_take_task_card.dart @@ -0,0 +1,190 @@ +import 'package:aku_new_community/extensions/widget_list_ext.dart'; +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/models/task/my_take_task_list_model.dart'; +import 'package:aku_new_community/ui/service/my_take_task/my_take_task_detail_page.dart'; +import 'package:aku_new_community/ui/service/task_map.dart'; +import 'package:aku_new_community/widget/bee_divider.dart'; +import 'package:aku_new_community/widget/buttons/card_bottom_button.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + +import '../task_func.dart'; + +class MyTakeTaskCard extends StatelessWidget { + final MyTakeTaskListModel model; + final VoidCallback refresh; + + const MyTakeTaskCard({Key? key, required this.model, required this.refresh}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () { + Get.to(() => MyTakeTaskDetailPage(model: model)); + }, + child: Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.w), + ), + padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w), + child: Column( + children: [ + Row( + children: [ + '接单时间 ${DateUtil.formatDateStr(model.createDate)}' + .text + .size(26.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + Spacer(), + '${TaskMap.statusToString[model.status]}' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .bold + .make() + ], + ), + 20.w.heightBox, + BeeDivider.horizontal(), + 34.w.heightBox, + Row( + children: [ + Assets.icons.clockCircle.image(width: 36.w, height: 36.w), + 24.w.widthBox, + '${DateUtil.formatDateStr(model.appointmentDate)}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + 20.w.heightBox, + Row( + children: [ + Assets.icons.environment.image(width: 36.w, height: 36.w), + 24.w.widthBox, + '${model.appointmentAddress}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + 34.w.heightBox, + Container( + width: 638.w, + decoration: BoxDecoration( + color: Colors.black.withOpacity(0.03), + borderRadius: BorderRadius.circular(8.w)), + padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '#${TaskMap.typeToString[model.type]}' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + 16.w.heightBox, + model.content.text + .size(28.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + ), + 40.w.heightBox, + Row( + children: [ + Spacer(), + RichText( + text: TextSpan( + text: '实付 ', + children: model.rewardType == 2 + ? [ + WidgetSpan( + child: Assets.icons.intergral + .image(width: 24.w, height: 24.w), + ), + model.reward + .toString() + .textSpan + .size(32.sp) + .color(Colors.red) + .make(), + ] + : [ + '¥ ${model.reward}' + .toString() + .textSpan + .size(32.sp) + .color(Colors.red) + .make(), + ], + style: TextStyle( + color: Colors.black.withOpacity(0.65), fontSize: 24.sp), + ), + ) + ], + ), + _cardBottom(model.status), + ], + ), + ), + ); + } + + Widget _cardBottom(int) { + switch (int) { + case 1: + case 2: + return Column( + children: [ + 40.w.heightBox, + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + // CardBottomButton.white( + // text: '取消订单', + // onPressed: () async { + // var re = await TaskFunc.cancel(taskId: model.id); + // if (re) { + // refresh(); + // } + // }), + CardBottomButton.yellow( + text: '确认完成', + onPressed: () async { + var re = await TaskFunc.finish(taskId: model.id); + if (re) { + refresh(); + } + }), + ].sepWidget(separate: 10.w.widthBox), + ) + ], + ); + case 4: + return Column( + children: [ + 32.w.heightBox, + Row( + children: [ + '客户取消:暂不需要该服务'.text.size(24.sp).color(Colors.red).make(), + Spacer(), + ], + ), + ], + ); + default: + return SizedBox.shrink(); + } + } +} diff --git a/lib/ui/service/my_take_task/my_take_task_detail_page.dart b/lib/ui/service/my_take_task/my_take_task_detail_page.dart new file mode 100644 index 00000000..2ddc3f57 --- /dev/null +++ b/lib/ui/service/my_take_task/my_take_task_detail_page.dart @@ -0,0 +1,268 @@ +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/models/task/my_take_task_list_model.dart'; +import 'package:aku_new_community/ui/service/task_map.dart'; +import 'package:aku_new_community/widget/bee_divider.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class MyTakeTaskDetailPage extends StatefulWidget { + final MyTakeTaskListModel model; + + const MyTakeTaskDetailPage({Key? key, required this.model}) : super(key: key); + + @override + _MyTakeTaskDetailPageState createState() => _MyTakeTaskDetailPageState(); +} + +class _MyTakeTaskDetailPageState extends State { + @override + Widget build(BuildContext context) { + return BeeScaffold( + extendBody: true, + title: '', + body: Stack( + children: [ + Column( + children: [ + Container( + width: double.infinity, + height: 380.w, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: widget.model.status == 4 + ? [ + Colors.white, + Color(0xFFADACAC), + ] + : [ + Color(0xFFFFB737), + Color(0xFFFFD361), + ]), + ), + child: Column( + children: [ + 150.w.heightBox, + Row( + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 32.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '${TaskMap.detailStatusToString[widget.model.status]}' + .text + .size(40.sp) + .color(Colors.black) + .bold + .make(), + '${TaskMap.subStatus[widget.model.status]}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ], + ), + ), + Spacer(), + // Padding( + // padding: EdgeInsets.only(right: 32.w), + // child: MaterialButton( + // color: Colors.white, + // elevation: 0, + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(8.w), + // ), + // onPressed: () async { + // var re = await TaskFunc.cancel( + // taskId: widget.model.id); + // if (re) { + // Get.back(); + // } + // }, + // child: '取消订单' + // .text + // .size(24.sp) + // .color(Colors.black.withOpacity(0.65)) + // .make(), + // ), + // ) + ], + ), + ], + ), + ), + Flexible( + child: Container( + width: double.infinity, + color: Color(0xFFE5E5E5), + ), + ), + ], + ), + Positioned( + top: 280.w, + left: 32.w, + right: 32.w, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + _content(), + 24.w.heightBox, + _taskInfo(), + ], + )), + ], + ), + ); + } + + Widget _taskInfo() { + return Container( + width: 686.w, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.w), + ), + padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w), + child: Column( + children: [ + Row( + children: [ + '任务信息'.text.size(28.sp).color(Colors.black).bold.make(), + Spacer(), + ], + ), + 24.w.heightBox, + BeeDivider.horizontal(), + 24.w.heightBox, + Row( + children: [ + '创建时间' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + Spacer(), + '${DateUtil.formatDateStr(widget.model.createDate)}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make() + ], + ), + ], + ), + ); + } + + Widget _content() { + var head = Row( + children: [ + Container( + width: 100.w, + height: 50.w, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFFFFF7E6), + borderRadius: BorderRadius.circular(8.w), + ), + child: '#${TaskMap.typeToString[widget.model.type]}' + .text + .size(28.sp) + .color(Color(0xFFFA8C16)) + .make(), + ), + Spacer(), + Assets.icons.intergral.image(width: 24.w, height: 24.w), + 8.w.widthBox, + '${widget.model.reward}'.text.size(32.sp).color(Colors.red).make() + ], + ); + return Container( + width: 686.w, + height: 500.w, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.w), + ), + padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w), + child: Column( + children: [ + head, + 34.w.heightBox, + Row( + children: [ + Assets.icons.clockCircle.image(width: 36.w, height: 36.w), + 24.w.widthBox, + '${DateUtil.formatDateStr(widget.model.appointmentDate)}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + 20.w.heightBox, + Row( + children: [ + Assets.icons.environment.image(width: 36.w, height: 36.w), + 24.w.widthBox, + '${widget.model.appointmentAddress}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + 34.w.heightBox, + Container( + width: 638.w, + decoration: BoxDecoration( + color: Colors.black.withOpacity(0.03), + borderRadius: BorderRadius.circular(8.w)), + padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '#${TaskMap.typeToString[widget.model.type]}' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + 16.w.heightBox, + widget.model.content.text + .size(28.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + ), + 32.w.heightBox, + BeeDivider.horizontal(), + 32.w.heightBox, + Row( + children: [ + Assets.icons.reward.image(width: 36.w, height: 36.w), + 24.w.widthBox, + '报酬' + .text + .size(26.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + Spacer(), + '¥${widget.model.reward}' + .text + .size(32.sp) + .color(Colors.red) + .make(), + ], + ), + ], + ), + ); + } +} diff --git a/lib/ui/service/my_take_task/my_take_task_view.dart b/lib/ui/service/my_take_task/my_take_task_view.dart new file mode 100644 index 00000000..c9a34867 --- /dev/null +++ b/lib/ui/service/my_take_task/my_take_task_view.dart @@ -0,0 +1,48 @@ +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/models/task/my_take_task_list_model.dart'; +import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; +import 'package:aku_new_community/ui/service/my_take_task/my_take_task_card.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class MyTakeTaskView extends StatefulWidget { + const MyTakeTaskView({Key? key}) : super(key: key); + + @override + _MyTakeTaskViewState createState() => _MyTakeTaskViewState(); +} + +class _MyTakeTaskViewState extends State { + EasyRefreshController _refreshController = EasyRefreshController(); + + @override + void dispose() { + _refreshController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return BeeListView( + path: API.manager.task.myTakeTask, + controller: _refreshController, + convert: (json) => json.tableList! + .map((e) => MyTakeTaskListModel.fromJson(e)) + .toList(), + builder: (models) { + return ListView.separated( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), + itemBuilder: (context, index) { + return MyTakeTaskCard( + model: models[index], + refresh: () => _refreshController.callRefresh()); + }, + separatorBuilder: (_, __) { + return 24.w.heightBox; + }, + itemCount: models.length); + }); + } +} diff --git a/lib/ui/service/my_task/my_task_card.dart b/lib/ui/service/my_task/my_task_card.dart new file mode 100644 index 00000000..0810b2b1 --- /dev/null +++ b/lib/ui/service/my_task/my_task_card.dart @@ -0,0 +1,196 @@ +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/models/task/my_task_list_model.dart'; +import 'package:aku_new_community/ui/service/my_task/my_task_detail_page.dart'; +import 'package:aku_new_community/ui/service/task_map.dart'; +import 'package:aku_new_community/widget/buttons/card_bottom_button.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + +import '../task_func.dart'; + +class MyTaskCard extends StatelessWidget { + final MyTaskListModel model; + final VoidCallback refresh; + + const MyTaskCard({Key? key, required this.model, required this.refresh}) + : super(key: key); + + @override + Widget build(BuildContext context) { + var head = Row( + children: [ + Container( + width: 100.w, + height: 50.w, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFFFFF7E6), + borderRadius: BorderRadius.circular(8.w), + ), + child: '#${TaskMap.typeToString[model.type]}' + .text + .size(28.sp) + .color(Color(0xFFFA8C16)) + .make(), + ), + Spacer(), + '${TaskMap.statusToString[model.status]}' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .bold + .make() + ], + ); + return GestureDetector( + onTap: () { + Get.to(() => MyTaskDetailPage(model: model)); + }, + child: Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.w), + ), + padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w), + child: Column( + children: [ + head, + 34.w.heightBox, + Row( + children: [ + Assets.icons.clockCircle.image(width: 36.w, height: 36.w), + 24.w.widthBox, + '${DateUtil.formatDateStr(model.appointmentDate)}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + 20.w.heightBox, + Row( + children: [ + Assets.icons.environment.image(width: 36.w, height: 36.w), + 24.w.widthBox, + '${model.appointmentAddress}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + 34.w.heightBox, + Container( + width: 638.w, + decoration: BoxDecoration( + color: Colors.black.withOpacity(0.03), + borderRadius: BorderRadius.circular(8.w)), + padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '#${TaskMap.typeToString[model.type]}' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + 16.w.heightBox, + model.content.text + .size(28.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + ), + 40.w.heightBox, + Row( + children: [ + Spacer(), + RichText( + text: TextSpan( + text: '实付 ', + children: model.rewardType == 2 + ? [ + WidgetSpan( + child: Assets.icons.intergral + .image(width: 24.w, height: 24.w), + ), + model.reward + .toString() + .textSpan + .size(32.sp) + .color(Colors.red) + .make(), + ] + : [ + '¥ ${model.reward}' + .toString() + .textSpan + .size(32.sp) + .color(Colors.red) + .make(), + ], + style: TextStyle( + color: Colors.black.withOpacity(0.65), fontSize: 24.sp), + ), + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + 40.w.heightBox, + Row( + children: [ + Spacer(), + CardBottomButton.yellow( + text: '取消订单', + onPressed: () async { + var re = await TaskFunc.cancel(taskId: model.id); + if (re) { + refresh(); + } + }), + ], + ), + ], + ), + ], + ), + ), + ); + } + + Widget _cardBottom(int) { + switch (int) { + case 1: + case 2: + return Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + 40.w.heightBox, + CardBottomButton.white(text: '取消订单', onPressed: () {}), + CardBottomButton.yellow(text: '确认完成', onPressed: () {}), + ], + ); + case 4: + return Column( + children: [ + 32.w.heightBox, + Row( + children: [ + '客户取消:暂不需要该服务'.text.size(24.sp).color(Colors.red).make(), + Spacer(), + ], + ), + ], + ); + default: + return SizedBox.shrink(); + } + } +} diff --git a/lib/ui/service/my_task/my_task_detail_page.dart b/lib/ui/service/my_task/my_task_detail_page.dart new file mode 100644 index 00000000..10201671 --- /dev/null +++ b/lib/ui/service/my_task/my_task_detail_page.dart @@ -0,0 +1,268 @@ +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/models/task/my_task_list_model.dart'; +import 'package:aku_new_community/ui/service/task_map.dart'; +import 'package:aku_new_community/widget/bee_divider.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class MyTaskDetailPage extends StatefulWidget { + final MyTaskListModel model; + + const MyTaskDetailPage({Key? key, required this.model}) : super(key: key); + + @override + _MyTaskDetailPageState createState() => _MyTaskDetailPageState(); +} + +class _MyTaskDetailPageState extends State { + @override + Widget build(BuildContext context) { + return BeeScaffold( + extendBody: true, + title: '', + body: Stack( + children: [ + Column( + children: [ + Container( + width: double.infinity, + height: 380.w, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: widget.model.status == 4 + ? [ + Colors.white, + Color(0xFFADACAC), + ] + : [ + Color(0xFFFFB737), + Color(0xFFFFD361), + ]), + ), + child: Column( + children: [ + 150.w.heightBox, + Row( + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 32.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '${TaskMap.detailStatusToString[widget.model.status]}' + .text + .size(40.sp) + .color(Colors.black) + .bold + .make(), + '${TaskMap.subStatus[widget.model.status]}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ], + ), + ), + Spacer(), + // Padding( + // padding: EdgeInsets.only(right: 32.w), + // child: MaterialButton( + // color: Colors.white, + // elevation: 0, + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(8.w), + // ), + // onPressed: () async { + // var re = await TaskFunc.cancel( + // taskId: widget.model.id); + // if (re) { + // Get.back(); + // } + // }, + // child: '取消订单' + // .text + // .size(24.sp) + // .color(Colors.black.withOpacity(0.65)) + // .make(), + // ), + // ) + ], + ), + ], + ), + ), + Flexible( + child: Container( + width: double.infinity, + color: Color(0xFFE5E5E5), + ), + ), + ], + ), + Positioned( + top: 280.w, + left: 32.w, + right: 32.w, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + _content(), + 24.w.heightBox, + _taskInfo(), + ], + )), + ], + ), + ); + } + + Widget _taskInfo() { + return Container( + width: 686.w, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.w), + ), + padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w), + child: Column( + children: [ + Row( + children: [ + '任务信息'.text.size(28.sp).color(Colors.black).bold.make(), + Spacer(), + ], + ), + 24.w.heightBox, + BeeDivider.horizontal(), + 24.w.heightBox, + Row( + children: [ + '创建时间' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + Spacer(), + '${DateUtil.formatDateStr(widget.model.createDate)}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make() + ], + ), + ], + ), + ); + } + + Widget _content() { + var head = Row( + children: [ + Container( + width: 100.w, + height: 50.w, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFFFFF7E6), + borderRadius: BorderRadius.circular(8.w), + ), + child: '#${TaskMap.typeToString[widget.model.type]}' + .text + .size(28.sp) + .color(Color(0xFFFA8C16)) + .make(), + ), + Spacer(), + Assets.icons.intergral.image(width: 24.w, height: 24.w), + 8.w.widthBox, + '${widget.model.reward}'.text.size(32.sp).color(Colors.red).make() + ], + ); + return Container( + width: 686.w, + height: 500.w, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.w), + ), + padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w), + child: Column( + children: [ + head, + 34.w.heightBox, + Row( + children: [ + Assets.icons.clockCircle.image(width: 36.w, height: 36.w), + 24.w.widthBox, + '${DateUtil.formatDateStr(widget.model.appointmentDate)}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + 20.w.heightBox, + Row( + children: [ + Assets.icons.environment.image(width: 36.w, height: 36.w), + 24.w.widthBox, + '${widget.model.appointmentAddress}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + 34.w.heightBox, + Container( + width: 638.w, + decoration: BoxDecoration( + color: Colors.black.withOpacity(0.03), + borderRadius: BorderRadius.circular(8.w)), + padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '#${TaskMap.typeToString[widget.model.type]}' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + 16.w.heightBox, + widget.model.content.text + .size(28.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + ), + 32.w.heightBox, + BeeDivider.horizontal(), + 32.w.heightBox, + Row( + children: [ + Assets.icons.reward.image(width: 36.w, height: 36.w), + 24.w.widthBox, + '报酬' + .text + .size(26.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + Spacer(), + '¥${widget.model.reward}' + .text + .size(32.sp) + .color(Colors.red) + .make(), + ], + ), + ], + ), + ); + } +} diff --git a/lib/ui/service/my_task/my_task_view.dart b/lib/ui/service/my_task/my_task_view.dart new file mode 100644 index 00000000..056fadb8 --- /dev/null +++ b/lib/ui/service/my_task/my_task_view.dart @@ -0,0 +1,47 @@ +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/models/task/my_task_list_model.dart'; +import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; +import 'package:aku_new_community/ui/service/my_task/my_task_card.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class MyTaskView extends StatefulWidget { + const MyTaskView({Key? key}) : super(key: key); + + @override + _MyTaskViewState createState() => _MyTaskViewState(); +} + +class _MyTaskViewState extends State { + EasyRefreshController _refreshController = EasyRefreshController(); + + @override + void dispose() { + _refreshController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return BeeListView( + path: API.manager.task.myTask, + controller: _refreshController, + convert: (json) => + json.tableList!.map((e) => MyTaskListModel.fromJson(e)).toList(), + builder: (models) { + return ListView.separated( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), + itemBuilder: (context, index) { + return MyTaskCard( + model: models[index], + refresh: () => _refreshController.callRefresh()); + }, + separatorBuilder: (_, __) { + return 24.w.heightBox; + }, + itemCount: models.length); + }); + } +} diff --git a/lib/ui/service/publish_task_page.dart b/lib/ui/service/publish_task_page.dart new file mode 100644 index 00000000..0e0ca0ef --- /dev/null +++ b/lib/ui/service/publish_task_page.dart @@ -0,0 +1,614 @@ +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/ui/service/task_func.dart'; +import 'package:aku_new_community/utils/headers.dart'; +import 'package:aku_new_community/widget/bee_divider.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:aku_new_community/widget/picker/bee_date_picker.dart'; +import 'package:aku_new_community/widget/picker/bee_picker_box.dart'; +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class PublishTaskPage extends StatefulWidget { + const PublishTaskPage({Key? key}) : super(key: key); + + @override + _PublishTaskPageState createState() => _PublishTaskPageState(); +} + +class _PublishTaskPageState extends State { + List _types = ['跑腿', '代驾', '装修', '陪玩', '家政', '维修', '搬家', '家教', '其他']; + int _type = 0; + List _sexStr = ['男', '女', '不限']; + int _sex = 0; + int _service = 0; + List _serviceObject = ['住户', '物业', '不限']; + List _rewardTypes = ['赏金', '积分']; + int _rewardType = 0; + DateTime? _appointDate = DateTime.now(); + TextEditingController _titleController = TextEditingController(); + TextEditingController _contentController = TextEditingController(); + TextEditingController _addressController = TextEditingController(); + TextEditingController _rewardController = TextEditingController(); + + @override + void dispose() { + _titleController.dispose(); + _contentController.dispose(); + _addressController.dispose(); + _rewardController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return BeeScaffold( + title: '发布任务', + body: SafeArea( + child: ListView( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), + children: [ + Container( + width: double.infinity, + padding: EdgeInsets.only(left: 32.w, right: 32.w, bottom: 32.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16.w), + ), + child: Column( + children: [ + Row( + children: [ + SizedBox( + width: 170.w, + child: '标题' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ), + Expanded( + child: TextField( + controller: _titleController, + onChanged: (text) => setState(() {}), + autofocus: false, + decoration: InputDecoration( + hintStyle: TextStyle( + fontSize: 28.sp, + color: Colors.black.withOpacity(0.25), + ), + border: InputBorder.none, + hintText: '请输入', + ), + ), + ), + ], + ), + BeeDivider.horizontal(), + 32.w.heightBox, + GestureDetector( + onTap: () async { + _type = 1; + showModalBottomSheet( + context: context, + builder: (context) { + return BeePickerBox( + onPressed: () { + Get.back(); + print(_type); + setState(() {}); + }, + child: CupertinoPicker.builder( + itemExtent: 60.w, + childCount: _types.length, + onSelectedItemChanged: (index) { + _type = index + 1; + }, + itemBuilder: (context, index) { + return Center( + child: _types[index] + .text + .size(32.sp) + .isIntrinsic + .color(Colors.black.withOpacity(0.25)) + .make(), + ); + })); + }, + ); + }, + child: Material( + color: Colors.transparent, + child: Row( + children: [ + SizedBox( + width: 170.w, + child: '分类' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ), + '${_type == 0 ? '请选择分类' : _types[_type - 1]}' + .text + .size(28.sp) + .color(Colors.black + .withOpacity(_type == 0 ? 0.25 : 0.85)) + .make(), + Spacer(), + Icon( + CupertinoIcons.chevron_right, + size: 24.w, + ), + ], + ), + ), + ), + 32.w.heightBox, + BeeDivider.horizontal(), + 32.w.heightBox, + GestureDetector( + onTap: () async { + await Get.bottomSheet(CupertinoActionSheet( + cancelButton: CupertinoActionSheetAction( + onPressed: () { + Get.back(); + }, + child: '取消' + .text + .size(28.sp) + .isIntrinsic + .color(Colors.black.withOpacity(0.85)) + .make()), + actions: [ + CupertinoActionSheetAction( + onPressed: () { + _sex = 1; + Get.back(); + setState(() {}); + }, + child: '男' + .text + .size(28.sp) + .isIntrinsic + .color(Colors.black.withOpacity(0.85)) + .make()), + CupertinoActionSheetAction( + onPressed: () { + _sex = 2; + Get.back(); + setState(() {}); + }, + child: '女' + .text + .size(28.sp) + .isIntrinsic + .color(Colors.black.withOpacity(0.85)) + .make()), + CupertinoActionSheetAction( + onPressed: () { + _sex = 3; + Get.back(); + setState(() {}); + }, + child: '不限' + .text + .size(28.sp) + .isIntrinsic + .color(Colors.black.withOpacity(0.85)) + .make()) + ], + )); + }, + child: Material( + color: Colors.transparent, + child: Row( + children: [ + SizedBox( + width: 170.w, + child: '性别' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ), + '${_sex == 0 ? '请选择性别' : _sexStr[_sex - 1]}' + .text + .size(28.sp) + .color(Colors.black + .withOpacity(_sex == 0 ? 0.25 : 0.85)) + .make(), + Spacer(), + Icon( + CupertinoIcons.chevron_right, + size: 24.w, + ), + ], + ), + ), + ), + 32.w.heightBox, + BeeDivider.horizontal(), + 32.w.heightBox, + GestureDetector( + onTap: () async { + await Get.bottomSheet(CupertinoActionSheet( + cancelButton: CupertinoActionSheetAction( + onPressed: () { + Get.back(); + }, + child: '取消' + .text + .size(28.sp) + .isIntrinsic + .color(Colors.black.withOpacity(0.85)) + .make()), + actions: [ + CupertinoActionSheetAction( + onPressed: () { + _service = 1; + Get.back(); + setState(() {}); + }, + child: '住户' + .text + .size(28.sp) + .isIntrinsic + .color(Colors.black.withOpacity(0.85)) + .make()), + CupertinoActionSheetAction( + onPressed: () { + _service = 2; + Get.back(); + setState(() {}); + }, + child: '物业' + .text + .size(28.sp) + .isIntrinsic + .color(Colors.black.withOpacity(0.85)) + .make()), + CupertinoActionSheetAction( + onPressed: () { + _service = 3; + Get.back(); + setState(() {}); + }, + child: '不限' + .text + .size(28.sp) + .isIntrinsic + .color(Colors.black.withOpacity(0.85)) + .make()) + ], + )); + }, + child: Material( + color: Colors.transparent, + child: Row( + children: [ + SizedBox( + width: 170.w, + child: '服务人员' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ), + '${_service == 0 ? '请选择服务人员' : _serviceObject[_service - 1]}' + .text + .size(28.sp) + .color(Colors.black + .withOpacity(_service == 0 ? 0.25 : 0.85)) + .make(), + Spacer(), + Icon( + CupertinoIcons.chevron_right, + size: 24.w, + ), + ], + ), + ), + ), + 32.w.heightBox, + BeeDivider.horizontal(), + 32.w.heightBox, + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + '任务内容' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ], + ), + 32.w.heightBox, + Container( + width: double.infinity, + padding: EdgeInsets.symmetric(horizontal: 24.w), + decoration: BoxDecoration( + color: Colors.black.withOpacity(0.06), + borderRadius: BorderRadius.circular(16.w)), + child: TextField( + controller: _contentController, + autofocus: false, + onChanged: (text) => setState(() {}), + minLines: 5, + maxLength: 200, + maxLines: 20, + decoration: InputDecoration( + border: InputBorder.none, + ), + ), + ), + ], + ), + ), + 32.w.heightBox, + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 32.w, right: 32.w, bottom: 32.w, top: 32.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16.w), + ), + child: Column( + children: [ + GestureDetector( + onTap: () async { + _appointDate = + await BeeDatePicker.timePicker(DateTime.now()); + }, + child: Material( + color: Colors.transparent, + child: Row( + children: [ + SizedBox( + width: 170.w, + child: '预约时间' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ), + '${DateUtil.formatDate(_appointDate)}' + .text + .size(28.sp) + .color(Colors.black + .withOpacity(_type == 0 ? 0.25 : 0.85)) + .make(), + Spacer(), + Icon( + CupertinoIcons.chevron_right, + size: 24.w, + ), + ], + ), + ), + ), + 32.w.heightBox, + BeeDivider.horizontal(), + 32.w.heightBox, + Row( + children: [ + SizedBox( + width: 170.w, + child: '预约地址' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ), + '${S.of(context)!.tempPlotName}' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + '|' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.25)) + .make(), + Expanded( + child: TextField( + autofocus: false, + controller: _addressController, + onChanged: (text) => setState(() {}), + decoration: InputDecoration( + contentPadding: EdgeInsets.zero, + isDense: true, + border: InputBorder.none, + hintText: '请输入', + hintStyle: TextStyle( + fontSize: 28.sp, + color: Colors.black.withOpacity(0.25), + )), + ), + ), + ], + ), + 32.w.heightBox, + BeeDivider.horizontal(), + 32.w.heightBox, + GestureDetector( + onTap: () async { + await Get.bottomSheet(CupertinoActionSheet( + cancelButton: CupertinoActionSheetAction( + onPressed: () { + Get.back(); + }, + child: '取消' + .text + .size(28.sp) + .isIntrinsic + .color(Colors.black.withOpacity(0.85)) + .make()), + actions: [ + CupertinoActionSheetAction( + onPressed: () { + _rewardType = 1; + Get.back(); + setState(() {}); + }, + child: '赏金' + .text + .size(28.sp) + .isIntrinsic + .color(Colors.black.withOpacity(0.85)) + .make()), + CupertinoActionSheetAction( + onPressed: () { + _rewardType = 2; + Get.back(); + setState(() {}); + }, + child: '积分' + .text + .size(28.sp) + .isIntrinsic + .color(Colors.black.withOpacity(0.85)) + .make()), + ], + )); + }, + child: Material( + color: Colors.transparent, + child: Row( + children: [ + SizedBox( + width: 170.w, + child: '报酬类型' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ), + '${_rewardType == 0 ? '请选择报酬类型' : _rewardTypes[_rewardType - 1]}' + .text + .size(28.sp) + .color(Colors.black + .withOpacity(_rewardType == 0 ? 0.25 : 0.85)) + .make(), + Spacer(), + Icon( + CupertinoIcons.chevron_right, + size: 24.w, + ), + ], + ), + ), + ), + 32.w.heightBox, + BeeDivider.horizontal(), + 32.w.heightBox, + Row( + children: [ + SizedBox( + width: 170.w, + child: '${_rewardType == 1 ? '赏金金额' : '积分数量'}' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ), + Expanded( + child: TextField( + textAlign: TextAlign.end, + onChanged: (text) => setState(() {}), + autofocus: false, + controller: _rewardController, + style: TextStyle(color: Colors.red), + decoration: InputDecoration( + contentPadding: EdgeInsets.zero, + isDense: true, + border: InputBorder.none, + hintText: '请输入', + hintStyle: TextStyle( + fontSize: 28.sp, + color: Colors.black.withOpacity(0.25), + )), + ), + ), + '${_rewardType == 1 ? '元' : ''}' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + ], + ) + ], + ), + ), + ], + ), + ), + bottomNavi: Padding( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w), + child: MaterialButton( + elevation: 0, + height: 93.w, + disabledColor: Colors.black.withOpacity(0.06), + disabledTextColor: Colors.black.withOpacity(0.25), + textColor: Colors.black.withOpacity(0.85), + shape: + RoundedRectangleBorder(borderRadius: BorderRadius.circular(65.w)), + color: kPrimaryColor, + onPressed: !canTap + ? null + : () async { + var cancel = BotToast.showLoading(); + var re = await TaskFunc.publish( + title: _titleController.text, + taskType: _type, + taskSex: _sex, + serviceObject: _service, + taskContent: _contentController.text, + taskDate: _appointDate.toString(), + taskAddress: _addressController.text, + rewardType: _rewardType, + reward: _rewardController.text); + if (re) { + Get.back(); + } + cancel(); + }, + child: '确认发布'.text.size(32.sp).bold.make(), + ), + ), + ); + } + + bool get canTap { + if (_titleController.text.isEmpty) { + return false; + } + if (_type == 0) { + return false; + } + if (_rewardType == 0) { + return false; + } + if (_sex == 0) { + return false; + } + if (_appointDate == null) { + return false; + } + if (_contentController.text.isEmpty) { + return false; + } + if (_addressController.text.isEmpty) { + return false; + } + if (_rewardController.text.isEmpty) { + return false; + } + return true; + } +} diff --git a/lib/ui/service/task_func.dart b/lib/ui/service/task_func.dart new file mode 100644 index 00000000..78403d95 --- /dev/null +++ b/lib/ui/service/task_func.dart @@ -0,0 +1,61 @@ +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/utils/network/net_util.dart'; + +class TaskFunc { + ///确认发布 + static Future publish( + {required String title, + required int taskType, + required int taskSex, + required int serviceObject, + required String taskContent, + required String taskDate, + required String taskAddress, + required int rewardType, + required String reward}) async { + var base = await NetUtil().post(API.manager.task.publish, params: { + 'title': title, + 'taskType': taskType, + 'taskSex': taskSex, + 'serviceObject': serviceObject, + 'taskContent': taskContent, + 'taskDate': taskDate, + 'taskAddress': taskAddress, + 'rewardType': rewardType, + 'reward': int.parse(reward), + }); + return base.success; + } + + ///取消任务 + static Future cancel({ + required int taskId, + }) async { + var base = await NetUtil().get(API.manager.task.cancel, params: { + 'taskId': taskId, + }); + return base.success; + } + + ///接取任务 + + static Future take({ + required int taskId, + }) async { + var base = await NetUtil().get(API.manager.task.take, params: { + 'taskId': taskId, + }); + return base.success; + } + + ///完成任务 + + static Future finish({ + required int taskId, + }) async { + var base = await NetUtil().get(API.manager.task.finish, params: { + 'taskId': taskId, + }); + return base.success; + } +} diff --git a/lib/ui/service/task_map.dart b/lib/ui/service/task_map.dart new file mode 100644 index 00000000..740d206b --- /dev/null +++ b/lib/ui/service/task_map.dart @@ -0,0 +1,26 @@ +class TaskMap { + static Map statusToString = { + 1: '未接单', + 2: '待处理', + 3: '已完成', + 4: '已取消' + }; + + static Map typeToString = {1: '跑腿', 2: '代驾', 3: '装修', 4: '陪玩'}; + static Map serviceObject = {1: '住户', 2: '物业', 3: '不限'}; + + static Map rewardType = {1: '赏金', 2: '积分'}; + static Map detailStatusToString = { + 1: '已发布', + 2: '待处理', + 3: '已完成', + 4: '已取消' + }; + + static Map subStatus = { + 1: '请耐心等待帮手领取任务', + 2: '帮手正在为您服务中', + 3: '帮手已完成任务', + 4: '该任务已取消' + }; +} diff --git a/lib/ui/service/task_page.dart b/lib/ui/service/task_page.dart new file mode 100644 index 00000000..042c7fa5 --- /dev/null +++ b/lib/ui/service/task_page.dart @@ -0,0 +1,91 @@ +import 'package:aku_new_community/ui/service/hall/hall_view.dart'; +import 'package:aku_new_community/ui/service/my_take_task/my_take_task_view.dart'; +import 'package:aku_new_community/ui/service/my_task/my_task_view.dart'; +import 'package:aku_new_community/ui/service/publish_task_page.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:aku_new_community/widget/painter/tab_indicator.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class TaskPage extends StatefulWidget { + const TaskPage({Key? key}) : super(key: key); + + @override + _TaskPageState createState() => _TaskPageState(); +} + +class _TaskPageState extends State with TickerProviderStateMixin { + late TabController _tabController; + + List _tabs = ['大厅', '我服务的', '我发布的']; + + @override + void initState() { + _tabController = TabController(length: _tabs.length, vsync: this); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return BeeScaffold( + title: '', + actions: [ + IconButton( + onPressed: () { + Get.to(() => PublishTaskPage()); + }, + icon: Icon( + Icons.add_circle_outline, + size: 40.w, + color: Colors.black, + )) + ], + appBarBottom: PreferredSize( + preferredSize: Size.fromHeight(88.w), + child: Row( + children: [ + ..._tabs + .mapIndexed( + (currentValue, index) => _tabCard(currentValue, index)) + .toList(), + ], + )), + body: SafeArea( + child: TabBarView(controller: _tabController, children: [ + HallView(), + MyTakeTaskView(), + MyTaskView(), + ])), + ); + } + + Widget _tabCard(String title, int index) { + var select = index == _tabController.index; + return GestureDetector( + onTap: () { + _tabController.animateTo(index); + setState(() {}); + }, + child: Material( + color: Colors.transparent, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 8.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + title.text + .size(select ? 36.sp : 32.sp) + .fontWeight(select ? FontWeight.bold : FontWeight.normal) + .color(Colors.black.withOpacity(select ? 0.85 : 0.65)) + .make(), + 8.w.heightBox, + select ? TabIndicator() : 10.w.heightBox, + ], + ), + ), + ), + ); + } +} diff --git a/lib/utils/bee_date_util.dart b/lib/utils/bee_date_util.dart index 3c412294..32c4aaab 100644 --- a/lib/utils/bee_date_util.dart +++ b/lib/utils/bee_date_util.dart @@ -1,4 +1,4 @@ -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; class BeeDateUtil { DateTime? date; diff --git a/lib/utils/network/net_util.dart b/lib/utils/network/net_util.dart index 3cbd45b9..94eefbbd 100644 --- a/lib/utils/network/net_util.dart +++ b/lib/utils/network/net_util.dart @@ -10,7 +10,7 @@ import 'package:aku_new_community/utils/network/base_list_model.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:dio/dio.dart'; -import 'package:flustars/flustars.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:get/get.dart' hide Response, FormData, MultipartFile; import 'package:power_logger/power_logger.dart'; import 'package:provider/provider.dart'; diff --git a/lib/widget/painter/tab_indicator.dart b/lib/widget/painter/tab_indicator.dart new file mode 100644 index 00000000..9ca9cfaa --- /dev/null +++ b/lib/widget/painter/tab_indicator.dart @@ -0,0 +1,21 @@ +import 'package:aku_new_community/widget/painter/tab_indicator_parinter.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class TabIndicator extends StatelessWidget { + final double? width; + final double? height; + + const TabIndicator({Key? key, this.width, this.height}) : super(key: key); + + @override + Widget build(BuildContext context) { + return SizedBox( + width: width ?? 40.w, + height: height ?? 10.w, + child: CustomPaint( + painter: TabIndicatorPainter(), + ), + ); + } +} diff --git a/lib/widget/painter/tab_indicator_parinter.dart b/lib/widget/painter/tab_indicator_parinter.dart new file mode 100644 index 00000000..634f67ab --- /dev/null +++ b/lib/widget/painter/tab_indicator_parinter.dart @@ -0,0 +1,27 @@ +import 'package:aku_new_community/base/base_style.dart'; +import 'package:flutter/material.dart'; + +class TabIndicatorPainter extends CustomPainter { + @override + void paint(Canvas canvas, Size size) { + Paint paint = Paint() + ..color = kPrimaryColor + ..strokeCap = StrokeCap.round + ..strokeWidth = 2 + ..style = PaintingStyle.stroke; + Path path = Path(); + path.moveTo(0, 0); + path.quadraticBezierTo(size.width / 2, size.height, size.width, 0); + canvas.drawPath(path, paint); + } + + @override + bool shouldRebuildSemantics(covariant CustomPainter oldDelegate) { + return false; + } + + @override + bool shouldRepaint(covariant CustomPainter oldDelegate) { + return false; + } +} diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 9e0c85f8..a7fcd583 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -9,7 +9,6 @@ import device_info_plus_macos import package_info import package_info_plus_macos import path_provider_macos -import shared_preferences_macos import sqflite import url_launcher_macos @@ -18,7 +17,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin")) FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) - SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/pubspec.lock b/pubspec.lock index 0f7ee381..f2a71ab2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,408 +5,410 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "31.0.0" + version: "34.0.0" advance_pdf_viewer: dependency: "direct main" description: name: advance_pdf_viewer - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.1" amap_flutter_base: dependency: "direct main" description: name: amap_flutter_base - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" amap_flutter_location: dependency: "direct main" description: name: amap_flutter_location - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" amap_flutter_map: dependency: "direct main" description: name: amap_flutter_map - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.8.0" + version: "3.2.0" animated_text_kit: dependency: "direct main" description: name: animated_text_kit - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.2.1" archive: dependency: transitive description: name: archive - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "3.1.2" + version: "3.1.11" args: dependency: transitive description: name: args - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "2.3.0" async: dependency: transitive description: name: async - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.8.2" auto_size_text_pk: dependency: transitive description: name: auto_size_text_pk - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" badges: dependency: "direct main" description: name: badges - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.2" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" bot_toast: dependency: "direct main" description: name: bot_toast - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.0.1" build: dependency: transitive description: name: build - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.1" build_config: dependency: transitive description: name: build_config - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" build_daemon: dependency: transitive description: name: build_daemon - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.1" build_resolvers: dependency: transitive description: name: build_resolvers - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.6" build_runner: dependency: "direct dev" description: name: build_runner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.7" build_runner_core: dependency: transitive description: name: build_runner_core - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "7.1.0" + version: "7.2.3" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "5.1.0" + version: "5.1.1" built_value: dependency: transitive description: name: built_value - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "8.1.1" + version: "8.1.4" cached_network_image: dependency: "direct main" description: name: cached_network_image - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "3.2.0" cached_network_image_platform_interface: dependency: transitive description: name: cached_network_image_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" cached_network_image_web: dependency: transitive description: name: cached_network_image_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" + card_swiper: + dependency: "direct main" + description: + name: card_swiper + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" carousel_slider: dependency: "direct main" description: name: carousel_slider - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.0.0" characters: dependency: transitive description: name: characters - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.1" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.1" cli_util: dependency: transitive description: name: cli_util - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.3.3" + version: "0.3.5" clock: dependency: transitive description: name: clock - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" code_builder: dependency: transitive description: name: code_builder - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.1.0" collection: dependency: "direct main" description: name: collection - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.15.0" color: dependency: transitive description: name: color - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" common_utils: - dependency: transitive + dependency: "direct main" description: - name: common_utils - url: "https://pub.flutter-io.cn" - source: hosted + path: "." + ref: HEAD + resolved-ref: ffa9aea43befda07b3b343cf83635d6d0c87ecf9 + url: "https://github.com/meng-fucius/common_utils" + source: git version: "2.0.2" convert: dependency: transitive description: name: convert - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.1" cross_file: dependency: transitive description: name: cross_file - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.3.1+4" + version: "0.3.2" crypto: dependency: transitive description: name: crypto - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.1" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.4" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.2.1" dartx: dependency: transitive description: name: dartx - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.8.0" + version: "1.0.0" decimal: dependency: transitive description: name: decimal - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "2.1.0" device_info_plus: dependency: transitive description: name: device_info_plus - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.0" device_info_plus_linux: dependency: transitive description: name: device_info_plus_linux - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" device_info_plus_macos: dependency: transitive description: name: device_info_plus_macos - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.2" device_info_plus_platform_interface: dependency: transitive description: name: device_info_plus_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.3.0+1" device_info_plus_web: dependency: transitive description: name: device_info_plus_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" device_info_plus_windows: dependency: transitive description: name: device_info_plus_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" dio: dependency: "direct main" description: name: dio - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "4.0.4" dotted_border: dependency: "direct main" description: name: dotted_border - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.0+2" equatable: dependency: "direct main" description: name: equatable - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.3" expandable: dependency: "direct main" description: name: expandable - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.0.1" extended_list_library: dependency: transitive description: name: extended_list_library - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" ffi: dependency: transitive description: name: ffi - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.2" file: dependency: transitive description: name: file - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "6.1.2" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" - flustars: - dependency: "direct main" - description: - name: flustars - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.0.1" flutter: dependency: "direct main" description: flutter @@ -416,42 +418,42 @@ packages: dependency: transitive description: name: flutter_blurhash - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.6.0" flutter_cache_manager: dependency: transitive description: name: flutter_cache_manager - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "3.1.2" + version: "3.3.0" flutter_easyrefresh: dependency: "direct main" description: name: flutter_easyrefresh - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.2.1" flutter_gen_core: dependency: transitive description: name: flutter_gen_core - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "4.1.3" + version: "4.1.5" flutter_gen_runner: dependency: "direct dev" description: name: flutter_gen_runner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "4.1.3" + version: "4.1.5" flutter_highlight: dependency: transitive description: name: flutter_highlight - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.7.0" flutter_icons: @@ -472,44 +474,37 @@ packages: dependency: "direct dev" description: name: flutter_native_splash - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.3.2" flutter_plugin_android_lifecycle: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.5" flutter_rating_bar: dependency: "direct main" description: name: flutter_rating_bar - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.0.0" flutter_screenutil: dependency: "direct main" description: name: flutter_screenutil - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "5.0.0+2" + version: "5.1.1" flutter_slidable: dependency: "direct main" description: name: flutter_slidable - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.6.0" - flutter_swiper_null_safety: - dependency: "direct main" - description: - name: flutter_swiper_null_safety - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.0.2" flutter_test: dependency: "direct dev" description: flutter @@ -524,462 +519,483 @@ packages: dependency: "direct main" description: name: fluwx - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "3.5.0" + version: "3.6.1+4" frontend_server_client: dependency: transitive description: name: frontend_server_client - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.2" get: dependency: "direct main" description: name: get - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "4.1.4" + version: "4.6.1" glob: dependency: transitive description: name: glob - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.2" graphs: dependency: transitive description: name: graphs - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0" grinder: dependency: "direct dev" description: name: grinder - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.9.0" highlight: dependency: transitive description: name: highlight - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.7.0" hive: dependency: "direct main" description: name: hive - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5" hive_flutter: dependency: "direct main" description: name: hive_flutter - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" hive_generator: dependency: "direct dev" description: name: hive_generator - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.2" http: dependency: transitive description: name: http - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.13.3" + version: "0.13.4" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.0.0" image: dependency: transitive description: name: image - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "3.0.2" + version: "3.1.1" image_picker: dependency: "direct main" description: name: image_picker - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.7.5+4" image_picker_for_web: dependency: transitive description: name: image_picker_for_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "2.1.5" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "2.4.3" import_sorter: dependency: "direct dev" description: name: import_sorter - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.6.0" infinite_listview: dependency: transitive description: name: infinite_listview - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" intl: dependency: "direct main" description: name: intl - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.17.0" io: dependency: transitive description: name: io - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3" jpush_flutter: dependency: "direct main" description: name: jpush_flutter - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "2.2.2" js: dependency: transitive description: name: js - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.6.3" json_annotation: dependency: "direct main" description: name: json_annotation - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.4.0" json_serializable: dependency: "direct dev" description: name: json_serializable - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "6.1.3" + version: "6.1.4" logger: dependency: transitive description: name: logger - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.0" logging: dependency: transitive description: name: logging - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" matcher: dependency: transitive description: name: matcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.12.11" meta: dependency: transitive description: name: meta - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.7.0" mime: dependency: transitive description: name: mime - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" nested: dependency: transitive description: name: nested - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" numberpicker: dependency: transitive description: name: numberpicker - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" octo_image: dependency: transitive description: name: octo_image - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.0+1" + version: "1.0.1" open_file: dependency: "direct main" description: name: open_file - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.2.1" package_config: dependency: transitive description: name: package_config - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" package_info: dependency: "direct main" description: name: package_info - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" package_info_plus: dependency: transitive description: name: package_info_plus - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.3.0" package_info_plus_linux: dependency: transitive description: name: package_info_plus_linux - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3" package_info_plus_macos: dependency: transitive description: name: package_info_plus_macos - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.3.0" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.2" package_info_plus_web: dependency: transitive description: name: package_info_plus_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.4" package_info_plus_windows: dependency: transitive description: name: package_info_plus_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.4" + palette_generator: + dependency: "direct main" + description: + name: palette_generator + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.2" path: dependency: transitive description: name: path - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.8.0" path_drawing: dependency: transitive description: name: path_drawing - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.5.1" + version: "1.0.0" path_parsing: dependency: transitive description: name: path_parsing - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.2.1" + version: "1.0.0" path_provider: dependency: "direct main" description: name: path_provider - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.8" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.11" + path_provider_ios: + dependency: transitive + description: + name: path_provider_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.7" path_provider_linux: dependency: transitive description: name: path_provider_linux - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.5" path_provider_macos: dependency: transitive description: name: path_provider_macos - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.5" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.3" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.5" pedantic: dependency: transitive description: name: pedantic - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.11.1" permission_handler: dependency: "direct main" description: name: permission_handler - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "7.2.0" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "3.6.1" + version: "3.7.0" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "4.1.0" + version: "4.4.0" pin_input_text_field: dependency: transitive description: name: pin_input_text_field - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.1.1" platform: dependency: transitive description: name: platform - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.1.2" pool: dependency: transitive description: name: pool - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.5.0" power_logger: dependency: "direct main" description: name: power_logger - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.2" process: dependency: transitive description: name: process - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "4.2.3" + version: "4.2.4" provider: dependency: "direct main" description: name: provider - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.0.0" pub_semver: dependency: "direct dev" description: name: pub_semver - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0" pubspec_parse: dependency: transitive description: name: pubspec_parse - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.2.0" qr: dependency: transitive description: name: qr - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" qr_code_scanner: dependency: "direct main" description: name: qr_code_scanner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.4.0" qr_flutter: dependency: "direct main" description: name: qr_flutter - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.0.0" random_character: @@ -995,98 +1011,56 @@ packages: dependency: transitive description: name: rational - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "2.1.0" rxdart: dependency: transitive description: name: rxdart - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.27.1" + version: "0.27.3" scroll_to_index: dependency: "direct main" description: name: scroll_to_index - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" share: dependency: "direct main" description: name: share - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.4" - shared_preferences: - dependency: transitive - description: - name: shared_preferences - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.0.6" - shared_preferences_linux: - dependency: transitive - description: - name: shared_preferences_linux - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.0.2" - shared_preferences_macos: - dependency: transitive - description: - name: shared_preferences_macos - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.0.2" - shared_preferences_platform_interface: - dependency: transitive - description: - name: shared_preferences_platform_interface - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.0.0" - shared_preferences_web: - dependency: transitive - description: - name: shared_preferences_web - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.0.1" - shared_preferences_windows: - dependency: transitive - description: - name: shared_preferences_windows - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.0.2" shelf: dependency: transitive description: name: shelf - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" shimmer: dependency: "direct main" description: name: shimmer - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" signature: dependency: "direct main" description: name: signature - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.1.1" sky_engine: @@ -1098,261 +1072,268 @@ packages: dependency: "direct main" description: name: sms_autofill - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.2.0" source_gen: dependency: transitive description: name: source_gen - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.2.1" source_helper: dependency: transitive description: name: source_helper - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.1" source_span: dependency: transitive description: name: source_span - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.8.1" - sp_util: - dependency: transitive - description: - name: sp_util - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.0.3" sqflite: dependency: transitive description: name: sqflite - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.0+3" + version: "2.0.2" sqflite_common: dependency: transitive description: name: sqflite_common - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.0+2" + version: "2.2.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" synchronized: dependency: transitive description: name: synchronized - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.4.3" time: dependency: transitive description: name: time - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" timing: dependency: transitive description: name: timing - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" tint: dependency: transitive description: name: tint - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" tobias: dependency: "direct main" description: name: tobias - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.0" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.0" universal_io: dependency: transitive description: name: universal_io - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.4" url_launcher: dependency: "direct main" description: name: url_launcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "6.0.9" + version: "6.0.18" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.14" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.14" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.3" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.3" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5" url_launcher_web: dependency: transitive description: name: url_launcher_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.6" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.2" uuid: dependency: transitive description: name: uuid - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "3.0.4" + version: "3.0.5" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" velocity_x: dependency: "direct main" description: name: velocity_x - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "3.3.0" + version: "3.4.0" vxstate: dependency: transitive description: name: vxstate - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" watcher: dependency: transitive description: name: watcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" waterfall_flow: dependency: "direct main" description: name: waterfall_flow - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" web_socket_channel: dependency: "direct main" description: name: web_socket_channel - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" win32: dependency: transitive description: name: win32 - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.3.11" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.2.0+1" xml: dependency: transitive description: name: xml - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "5.1.2" + version: "5.3.1" yaml: dependency: "direct dev" description: name: yaml - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.1.0" sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=2.0.0" + dart: ">=2.15.0 <3.0.0" + flutter: ">=2.5.0" diff --git a/pubspec.yaml b/pubspec.yaml index ef1ae1d3..7df203c9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -26,7 +26,9 @@ dependencies: #超链接 跳转拨号等 url_launcher: ^6.0.3 #常用工具类 - flustars: ^2.0.1 + common_utils: + git: + url: https://github.com/meng-fucius/common_utils flutter_icons: git: url: https://git.oa00.com/flutter_third/flutter-icons.git @@ -104,13 +106,15 @@ dependencies: #加载网络图片 cached_network_image: ^3.1.0 #轮播图 - flutter_swiper_null_safety: ^1.0.2 + card_swiper: ^2.0.1 #划动组件 carousel_slider: ^4.0.0-nullsafety.0 #跳转索引列表 scroll_to_index: ^2.1.1 #验证码自动填充 sms_autofill: ^2.2.0 + #提取图片主色 + palette_generator: ^0.3.2 dev_dependencies: