From b013c5598469fb4a188e04a07e6e4ed87cd26060 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Tue, 1 Mar 2022 17:17:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E6=B4=BB=E5=8A=A8=E3=80=81?= =?UTF-8?q?=E5=85=AC=E5=91=8A=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/sars_api.dart | 39 ++ lib/model/community/activity_item_model.dart | 7 +- lib/model/community/swiper_model.dart | 1 + lib/models/home/activity_detail_model.dart | 75 ++++ lib/models/home/activity_detail_model.g.dart | 45 ++ lib/models/home/announce_detail_model.dart | 34 ++ lib/models/home/announce_detail_model.g.dart | 25 ++ lib/models/home/home_activity_model.dart | 67 +++ lib/models/home/home_activity_model.g.dart | 22 + lib/models/home/home_announce_model.dart | 24 + lib/models/home/home_announce_model.g.dart | 18 + lib/models/home/home_swiper_model.dart | 23 + lib/models/home/home_swiper_model.g.dart | 18 + lib/pages/home/home_page.dart | 85 ++-- lib/pages/property/property_index.dart | 126 ------ lib/pages/property/widget/property_card.dart | 180 -------- lib/pages/tab_navigator.dart | 35 +- lib/ui/community/activity/activity_card.dart | 235 +++++----- .../activity/activity_detail_page.dart | 421 +++++++++++------- lib/ui/community/activity/activity_func.dart | 24 + .../activity/activity_list_page.dart | 31 +- lib/ui/community/community_func.dart | 35 +- .../topic/topic_community_view.dart | 2 +- lib/ui/community/notice/notice_card.dart | 70 ++- .../community/notice/notice_detail_page.dart | 54 ++- lib/ui/community/notice/notice_page.dart | 20 +- lib/ui/home/home_notification.dart | 34 +- lib/widget/beeImageNetwork.dart | 22 +- lib/widget/others/stack_avatar.dart | 15 +- pubspec.lock | 414 ++++++++--------- 30 files changed, 1179 insertions(+), 1022 deletions(-) create mode 100644 lib/models/home/activity_detail_model.dart create mode 100644 lib/models/home/activity_detail_model.g.dart create mode 100644 lib/models/home/announce_detail_model.dart create mode 100644 lib/models/home/announce_detail_model.g.dart create mode 100644 lib/models/home/home_activity_model.dart create mode 100644 lib/models/home/home_activity_model.g.dart create mode 100644 lib/models/home/home_announce_model.dart create mode 100644 lib/models/home/home_announce_model.g.dart create mode 100644 lib/models/home/home_swiper_model.dart create mode 100644 lib/models/home/home_swiper_model.g.dart delete mode 100644 lib/pages/property/property_index.dart delete mode 100644 lib/pages/property/widget/property_card.dart create mode 100644 lib/ui/community/activity/activity_func.dart diff --git a/lib/constants/sars_api.dart b/lib/constants/sars_api.dart index ddf060c4..ed7aeb55 100644 --- a/lib/constants/sars_api.dart +++ b/lib/constants/sars_api.dart @@ -28,6 +28,10 @@ class SARSAPI { static _Message message = _Message(); static _Community community = _Community(); static _Task task = _Task(); + static _HomeCarouse homeCarouse = _HomeCarouse(); + static _Activity activity = _Activity(); + static _Announce announce = _Announce(); + static _Information information = _Information(); ///二级分类 static _ProfileApi profile = _ProfileApi(); @@ -169,3 +173,38 @@ class _Task { ///查询任务发布信息列表 String get list => '/app/user/taskRelease/list'; } + +class _HomeCarouse { + ///获取首页轮播图列表 + String get list => '/app/user/homepageCarousel/list'; +} + +class _Activity { + ///查询活动详情 + String get detail => '/app/user/activity/findById'; + + ///活动报名 + String get registration => '/app/user/activity/registration'; + + ///查询所有的活动列表 + String get list => '/app/user/activity/list'; +} + +class _Announce { + ///查询通知公告列表 + String get list => '/app/user/announcement/list'; + + ///查询通知公告详情 + String get detail => '/app/user/announcement/detail'; +} + +class _Information { + ///查询app资讯推荐阅读列表信息 + String get recommendList => '/app/user/information/recommendList'; + + ///查询app资讯列表信息 + String get list => '/app/user/information/list'; + + ///查询app所有的资讯分类信息 + String get categoryList => '/app/user/information/categoryList'; +} diff --git a/lib/model/community/activity_item_model.dart b/lib/model/community/activity_item_model.dart index 1def725b..02c42212 100644 --- a/lib/model/community/activity_item_model.dart +++ b/lib/model/community/activity_item_model.dart @@ -1,10 +1,9 @@ -import 'package:flutter/material.dart'; - -import 'package:common_utils/common_utils.dart'; - import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/model/common/img_model.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter/material.dart'; +@Deprecated('弃用') class ActivityItemModel { int? id; String? title; diff --git a/lib/model/community/swiper_model.dart b/lib/model/community/swiper_model.dart index 3e8ddd5f..36d9261d 100644 --- a/lib/model/community/swiper_model.dart +++ b/lib/model/community/swiper_model.dart @@ -1,5 +1,6 @@ import 'package:aku_new_community/model/common/img_model.dart'; +@Deprecated('弃用') class SwiperModel { int? newsId; String? title; diff --git a/lib/models/home/activity_detail_model.dart b/lib/models/home/activity_detail_model.dart new file mode 100644 index 00000000..fc0cc241 --- /dev/null +++ b/lib/models/home/activity_detail_model.dart @@ -0,0 +1,75 @@ +import 'package:aku_new_community/model/common/img_model.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'activity_detail_model.g.dart'; + +@JsonSerializable() +class ActivityDetailModel { + final int id; + final List imgList; + final String title; + final int status; + final String registrationStartTime; + final String registrationEndTime; + final String activityStartTime; + final String activityEndTime; + final String activityAddress; + final List registrationList; + final int registrationNum; + final int registrationNumMax; + final double registrationCost; + final String activityContact; + final String activityTel; + final String content; + final String unit; + final String contact; + final String tel; + final List organizerImgList; + + factory ActivityDetailModel.fromJson(Map json) => + _$ActivityDetailModelFromJson(json); + + DateTime? get regisStartTime => DateUtil.getDateTime(registrationStartTime); + DateTime? get regisEndTime => DateUtil.getDateTime(registrationEndTime); + DateTime? get activeTime => DateUtil.getDateTime(activityStartTime); + DateTime? get activeEndTime => DateUtil.getDateTime(activityEndTime); + const ActivityDetailModel({ + required this.id, + required this.imgList, + required this.title, + required this.status, + required this.registrationStartTime, + required this.registrationEndTime, + required this.activityStartTime, + required this.activityEndTime, + required this.activityAddress, + required this.registrationList, + required this.registrationNum, + required this.registrationNumMax, + required this.registrationCost, + required this.activityContact, + required this.activityTel, + required this.content, + required this.unit, + required this.contact, + required this.tel, + required this.organizerImgList, + }); +} + +@JsonSerializable() +class Registration { + final int id; + final String name; + final List avatarImgList; + + factory Registration.fromJson(Map json) => + _$RegistrationFromJson(json); + + const Registration({ + required this.id, + required this.name, + required this.avatarImgList, + }); +} diff --git a/lib/models/home/activity_detail_model.g.dart b/lib/models/home/activity_detail_model.g.dart new file mode 100644 index 00000000..7c4652b9 --- /dev/null +++ b/lib/models/home/activity_detail_model.g.dart @@ -0,0 +1,45 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'activity_detail_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ActivityDetailModel _$ActivityDetailModelFromJson(Map json) => + ActivityDetailModel( + id: json['id'] as int, + imgList: (json['imgList'] as List) + .map((e) => ImgModel.fromJson(e as Map)) + .toList(), + title: json['title'] as String, + status: json['status'] as int, + registrationStartTime: json['registrationStartTime'] as String, + registrationEndTime: json['registrationEndTime'] as String, + activityStartTime: json['activityStartTime'] as String, + activityEndTime: json['activityEndTime'] as String, + activityAddress: json['activityAddress'] as String, + registrationList: (json['registrationList'] as List) + .map((e) => Registration.fromJson(e as Map)) + .toList(), + registrationNum: json['registrationNum'] as int, + registrationNumMax: json['registrationNumMax'] as int, + registrationCost: (json['registrationCost'] as num).toDouble(), + activityContact: json['activityContact'] as String, + activityTel: json['activityTel'] as String, + content: json['content'] as String, + unit: json['unit'] as String, + contact: json['contact'] as String, + tel: json['tel'] as String, + organizerImgList: (json['organizerImgList'] as List) + .map((e) => ImgModel.fromJson(e as Map)) + .toList(), + ); + +Registration _$RegistrationFromJson(Map json) => Registration( + id: json['id'] as int, + name: json['name'] as String, + avatarImgList: (json['avatarImgList'] as List) + .map((e) => ImgModel.fromJson(e as Map)) + .toList(), + ); diff --git a/lib/models/home/announce_detail_model.dart b/lib/models/home/announce_detail_model.dart new file mode 100644 index 00000000..1703714d --- /dev/null +++ b/lib/models/home/announce_detail_model.dart @@ -0,0 +1,34 @@ +import 'package:aku_new_community/model/common/img_model.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'announce_detail_model.g.dart'; + +@JsonSerializable() +class AnnounceDetailModel { + final int id; + final String title; + final int object; + final int status; + final String content; + final int readingVolume; + final int downloadNum; + final String modifyDate; + final List coverImgList; + final List annexImgList; + + factory AnnounceDetailModel.fromJson(Map json) => + _$AnnounceDetailModelFromJson(json); + + const AnnounceDetailModel({ + required this.id, + required this.title, + required this.object, + required this.status, + required this.content, + required this.readingVolume, + required this.downloadNum, + required this.modifyDate, + required this.coverImgList, + required this.annexImgList, + }); +} diff --git a/lib/models/home/announce_detail_model.g.dart b/lib/models/home/announce_detail_model.g.dart new file mode 100644 index 00000000..90024865 --- /dev/null +++ b/lib/models/home/announce_detail_model.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'announce_detail_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AnnounceDetailModel _$AnnounceDetailModelFromJson(Map json) => + AnnounceDetailModel( + id: json['id'] as int, + title: json['title'] as String, + object: json['object'] as int, + status: json['status'] as int, + content: json['content'] as String, + readingVolume: json['readingVolume'] as int, + downloadNum: json['downloadNum'] as int, + modifyDate: json['modifyDate'] as String, + coverImgList: (json['coverImgList'] as List) + .map((e) => ImgModel.fromJson(e as Map)) + .toList(), + annexImgList: (json['annexImgList'] as List) + .map((e) => ImgModel.fromJson(e as Map)) + .toList(), + ); diff --git a/lib/models/home/home_activity_model.dart b/lib/models/home/home_activity_model.dart new file mode 100644 index 00000000..7febb34b --- /dev/null +++ b/lib/models/home/home_activity_model.dart @@ -0,0 +1,67 @@ +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'home_activity_model.g.dart'; + +@JsonSerializable() +class HomeActivityModel { + final int id; + final String title; + final int status; + final String registrationStartTime; + final String registrationEndTime; + final String activityStartTime; + final String activityEndTime; + final List? imgList; + final int? registrationNum; + factory HomeActivityModel.fromJson(Map json) => + _$HomeActivityModelFromJson(json); + + DateTime? get begin => DateUtil.getDateTime(registrationStartTime); + + DateTime? get end => DateUtil.getDateTime(registrationEndTime); + String get statusString { + switch (this.status) { + case 1: + return '未开始'; + case 2: + return '进行中'; + case 3: + return '已结束'; + case 4: + return '已投票'; + default: + return '未知'; + } + } + + Color get statusColor { + switch (this.status) { + case 1: + return kPrimaryColor; + case 2: + return Colors.black; + case 3: + return ktextSubColor; + case 4: + return ktextSubColor; + default: + return Colors.red; + } + } + + const HomeActivityModel({ + required this.id, + required this.title, + required this.status, + required this.registrationStartTime, + required this.registrationEndTime, + required this.activityStartTime, + required this.activityEndTime, + this.imgList, + this.registrationNum, + }); +} diff --git a/lib/models/home/home_activity_model.g.dart b/lib/models/home/home_activity_model.g.dart new file mode 100644 index 00000000..cf1783e8 --- /dev/null +++ b/lib/models/home/home_activity_model.g.dart @@ -0,0 +1,22 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'home_activity_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +HomeActivityModel _$HomeActivityModelFromJson(Map json) => + HomeActivityModel( + id: json['id'] as int, + title: json['title'] as String, + status: json['status'] as int, + registrationStartTime: json['registrationStartTime'] as String, + registrationEndTime: json['registrationEndTime'] as String, + activityStartTime: json['activityStartTime'] as String, + activityEndTime: json['activityEndTime'] as String, + imgList: (json['imgList'] as List?) + ?.map((e) => ImgModel.fromJson(e as Map)) + .toList(), + registrationNum: json['registrationNum'] as int?, + ); diff --git a/lib/models/home/home_announce_model.dart b/lib/models/home/home_announce_model.dart new file mode 100644 index 00000000..4ccf558e --- /dev/null +++ b/lib/models/home/home_announce_model.dart @@ -0,0 +1,24 @@ +import 'package:aku_new_community/model/common/img_model.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'home_announce_model.g.dart'; + +@JsonSerializable() +class HomeAnnounceModel { + final int id; + final String title; + final String content; + final List imgList; + final String createDate; + factory HomeAnnounceModel.fromJson(Map json) => + _$HomeAnnounceModelFromJson(json); + DateTime? get createDateString => DateUtil.getDateTime(createDate); + const HomeAnnounceModel({ + required this.id, + required this.title, + required this.content, + required this.imgList, + required this.createDate, + }); +} diff --git a/lib/models/home/home_announce_model.g.dart b/lib/models/home/home_announce_model.g.dart new file mode 100644 index 00000000..4c896550 --- /dev/null +++ b/lib/models/home/home_announce_model.g.dart @@ -0,0 +1,18 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'home_announce_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +HomeAnnounceModel _$HomeAnnounceModelFromJson(Map json) => + HomeAnnounceModel( + id: json['id'] as int, + title: json['title'] as String, + content: json['content'] as String, + imgList: (json['imgList'] as List) + .map((e) => ImgModel.fromJson(e as Map)) + .toList(), + createDate: json['createDate'] as String, + ); diff --git a/lib/models/home/home_swiper_model.dart b/lib/models/home/home_swiper_model.dart new file mode 100644 index 00000000..7c3d72f3 --- /dev/null +++ b/lib/models/home/home_swiper_model.dart @@ -0,0 +1,23 @@ +import 'package:aku_new_community/model/common/img_model.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'home_swiper_model.g.dart'; + +@JsonSerializable() +class HomeSwiperModel { + final int id; + final int type; + final String? customizeUrl; + final int? associationId; + final List? imgList; + factory HomeSwiperModel.fromJson(Map json) => + _$HomeSwiperModelFromJson(json); + + const HomeSwiperModel({ + required this.id, + required this.type, + this.customizeUrl, + this.associationId, + this.imgList, + }); +} diff --git a/lib/models/home/home_swiper_model.g.dart b/lib/models/home/home_swiper_model.g.dart new file mode 100644 index 00000000..c802a9ba --- /dev/null +++ b/lib/models/home/home_swiper_model.g.dart @@ -0,0 +1,18 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'home_swiper_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +HomeSwiperModel _$HomeSwiperModelFromJson(Map json) => + HomeSwiperModel( + id: json['id'] as int, + type: json['type'] as int, + customizeUrl: json['customizeUrl'] as String?, + associationId: json['associationId'] as int?, + imgList: (json['imgList'] as List?) + ?.map((e) => ImgModel.fromJson(e as Map)) + .toList(), + ); diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index 966ad00e..c6514835 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -1,26 +1,12 @@ // Dart imports: -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; - -import 'package:badges/badges.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:card_swiper/card_swiper.dart'; -import 'package:flutter_easyrefresh/easy_refresh.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:aku_new_community/constants/application_objects.dart'; import 'package:aku_new_community/constants/sars_api.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/models/home/home_activity_model.dart'; +import 'package:aku_new_community/models/home/home_announce_model.dart'; +import 'package:aku_new_community/models/home/home_swiper_model.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'; @@ -30,14 +16,28 @@ import 'package:aku_new_community/ui/community/activity/activity_list_page.dart' import 'package:aku_new_community/ui/community/community_func.dart'; import 'package:aku_new_community/ui/home/home_notification.dart'; import 'package:aku_new_community/ui/home/home_title.dart'; -import 'package:aku_new_community/ui/home/public_infomation/public_information_detail_page.dart'; import 'package:aku_new_community/ui/manager/advice/advice_page.dart'; +import 'package:aku_new_community/ui/market/search/good_detail_page.dart'; import 'package:aku_new_community/ui/search/bee_search.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/login_util.dart'; import 'package:aku_new_community/widget/animated/OverlayWidget.dart'; +import 'package:aku_new_community/widget/beeImageNetwork.dart'; 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: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: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:url_launcher/url_launcher.dart'; class HomePage extends StatefulWidget { HomePage({Key? key}) : super(key: key); @@ -64,9 +64,9 @@ class _HomePageState extends State int _currentSwiperIndex = 0; // ActivityItemModel? _activityItemModel; - List _activityItemModels = []; - List _boardItemModels = []; - List _swiperModels = []; + List _activityItemModels = []; + List _boardItemModels = []; + List _swiperModels = []; SwiperController _swiperController = SwiperController(); ValueNotifier _barColor = ValueNotifier(Colors.transparent); @@ -200,7 +200,6 @@ class _HomePageState extends State header: BeeBallPauseHeader(bgColor: _barColor), firstRefresh: true, onRefresh: () async { - //_activityItemModel = await CommunityFunc.activity(); _activityItemModels = await CommunityFunc.activityList(); _boardItemModels = await CommunityFunc.board(); _swiperModels = await CommunityFunc.swiper(); @@ -214,6 +213,7 @@ class _HomePageState extends State child: Column( mainAxisSize: MainAxisSize.min, children: [ + head, HomeSwiper(), //要做点击事件 // SizedBox(height: 100.w), Container( @@ -434,7 +434,7 @@ class _HomePageState extends State _activityItemModels == [] ? SizedBox() : Container( - height: 400.w, + height: 480.w, padding: EdgeInsets.only(left: 32.w), child: ListView.separated( padding: EdgeInsets.zero, @@ -513,8 +513,7 @@ class _HomePageState extends State // control: new SwiperControl(), autoplay: true, onTap: (index) { - Get.to(() => - PublicInformationDetailPage(id: _swiperModels[index].newsId!)); + swiperNavigate(_swiperModels[index]); }, itemCount: _swiperModels.length, ), @@ -522,11 +521,31 @@ class _HomePageState extends State ); } + void swiperNavigate(HomeSwiperModel model) { + switch (model.type) { + case 1: + launch(model.customizeUrl ?? ''); + break; + case 2: + Get.to(GoodDetailPage(goodId: model.id)); + break; + case 3: + // Get.to(page) + break; + case 4: + break; + case 5: + break; + default: + BotToast.showText(text: '类型错误'); + } + } + Future _swiperBarColor(int index) async { if (_swiperModels.isNotEmpty) { var color = await PaletteGenerator.fromImageProvider(CachedNetworkImageProvider( - SARSAPI.image(ImgModel.first(_swiperModels[index].voResourcesImgList)), + SARSAPI.image(ImgModel.first(_swiperModels[index].imgList)), )); _barColor.value = color.dominantColor?.color ?? Colors.transparent; } else { @@ -534,18 +553,10 @@ class _HomePageState extends State } } - Widget getSwiperImage(SwiperModel swiperModel) { + Widget getSwiperImage(HomeSwiperModel swiperModel) { return Container( - child: FadeInImage.assetNetwork( - placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: SARSAPI.image(ImgModel.first(swiperModel.voResourcesImgList)), - fit: BoxFit.fill, - imageErrorBuilder: (context, error, stackTrace) { - return Image.asset( - R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - fit: BoxFit.fill, - ); - }, + child: BeeImageNetwork( + imgs: swiperModel.imgList ?? [], ), ); } diff --git a/lib/pages/property/property_index.dart b/lib/pages/property/property_index.dart deleted file mode 100644 index 7e91cb1c..00000000 --- a/lib/pages/property/property_index.dart +++ /dev/null @@ -1,126 +0,0 @@ -import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/constants/application_objects.dart'; -import 'package:aku_new_community/model/community/board_model.dart'; -import 'package:aku_new_community/ui/community/notice/notice_card.dart'; -import 'package:aku_new_community/utils/headers.dart'; -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/bee_scaffold.dart'; -import 'package:aku_new_community/widget/views/application_box.dart'; -import 'package:aku_new_community/widget/views/application_view.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; - -import 'widget/property_card.dart'; - -//TODO CLEAN BOTTOM CODES. -@Deprecated("sh*t property_index need to be cleaned.") -class PropertyIndex extends StatefulWidget { - PropertyIndex({Key? key}) : super(key: key); - - @override - _PropertyIndexState createState() => _PropertyIndexState(); -} - -//TODO CLEAN BOTTOM CODES. -@Deprecated("sh*t property_index need to be cleaned.") -class _PropertyIndexState extends State - with AutomaticKeepAliveClientMixin, SingleTickerProviderStateMixin { - @override - bool get wantKeepAlive => true; - - EasyRefreshController _refreshController = EasyRefreshController(); - int _page = 1; - int? _pageCount = 0; - List _models = []; - - Future> _getItems() async { - BaseListModel model = await NetUtil().getList( - API.community.boardList, - params: { - 'pageNum': _page, - 'size': 10, - }, - ); - _pageCount = model.total; - return model.rows.map((e) => BoardItemModel.fromJson(e)).toList(); - } - - @override - void dispose() { - super.dispose(); - _refreshController.dispose(); - } - - @override - Widget build(BuildContext context) { - super.build(context); - return BeeScaffold( - title: '物业', - body: EasyRefresh( - controller: _refreshController, - firstRefresh: true, - header: MaterialHeader(), - footer: MaterialFooter(), - onRefresh: () async { - _page = 1; - _models = await _getItems(); - setState(() {}); - }, - onLoad: () async { - _page++; - _models.addAll(await _getItems()); - if (_page >= _pageCount!) _refreshController.finishLoad(noMore: true); - setState(() {}); - }, - child: CustomScrollView( - slivers: [ - SliverToBoxAdapter( - child: ApplicationBox( - child: ApplicationView.custom(items: smartManagerApp), - ), - ), - SliverToBoxAdapter( - child: PropertyCard(), - ), - // PropertyBar( - // title: '社区活动', - // subtitle: '精彩往期', - // more: '更多活动', - // fun: activityRouter, - // ), - // SliverToBoxAdapter( - // child: PropertyActivityCard(fun: activityDetailsRouter), - // ), - // PropertyBar( - // title: '社区公告', - // subtitle: '看看小区最近发生什么?', - // ), - SliverToBoxAdapter( - child: ListView.builder( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - itemBuilder: (context, index) => SizedBox(), - itemCount: 3, - ), - ), - SliverList( - delegate: SliverChildBuilderDelegate( - (context, index) { - final BoardItemModel model = _models[index]; - BoardItemModel? preModel; - if (index >= 1) preModel = _models[index - 1]; - return Padding( - padding: EdgeInsets.only(bottom: 8.w), - child: NoticeCard(model: model, preModel: preModel), - ); - }, - childCount: _models.length, - )), - ], - ), - ), - ); - } -} diff --git a/lib/pages/property/widget/property_card.dart b/lib/pages/property/widget/property_card.dart deleted file mode 100644 index b6086933..00000000 --- a/lib/pages/property/widget/property_card.dart +++ /dev/null @@ -1,180 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:get/get.dart'; -import 'package:url_launcher/url_launcher.dart'; - -import 'package:aku_new_community/utils/headers.dart'; - -class PropertyCard extends StatelessWidget { - PropertyCard({Key? key}) : super(key: key); - - final List> _listCard = [ - { - 'title': '电话物业', - 'subtitle': '24小时在线', - 'image': R.ASSETS_ICONS_PROPERTY_PNG, - 'coloList': [Color(0xff42ceff), Color(0xff198cfb)], - 'shapeColoList': [Color(0xff42ceff), Color(0xff0b69c4)] - } - ]; - - Future _phoneCall(String url) async { - if (await canLaunch(url)) { - await launch(url); - } else { - throw 'Could not launch $url'; - } - } - - void _showDialog(BuildContext context, String url) { - showCupertinoDialog( - context: context, - builder: (context) { - return CupertinoAlertDialog( - title: Text( - url, - style: TextStyle( - fontSize: 34.sp, - color: Color(0xff030303), - ), - ), - actions: [ - CupertinoDialogAction( - child: Text( - '取消', - style: TextStyle( - fontSize: 34.sp, - color: Color(0xff333333), - ), - ), - onPressed: () { - Get.back(); - }, - ), - CupertinoDialogAction( - child: Text( - '呼叫', - style: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 34.sp, - color: Color(0xffff8200), - ), - ), - onPressed: () { - _phoneCall('tel:$url'); - Get.back(); - }, - ), - ], - ); - }, - ); - } - - @override - Widget build(BuildContext context) { - return Container( - margin: EdgeInsets.symmetric( - horizontal: 32.w, - vertical: 20.w, - ), - child: GridView.builder( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - itemCount: _listCard.length, - itemBuilder: (BuildContext context, int index) { - return InkWell( - onTap: () { - switch (_listCard[index]['title']) { - case '电话物业': - _showDialog(context, '0574-87760023'); - break; - case '语音管家': - break; - default: - } - }, - child: Container( - padding: EdgeInsets.symmetric( - horizontal: 19.w, - vertical: 36.w, - ), - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.centerLeft, - end: Alignment.centerRight, - colors: _listCard[index]['coloList'], - ), - borderRadius: BorderRadius.all(Radius.circular(8)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.2), - offset: Offset(1.1, 1.1), - blurRadius: 10.0), - ], - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - alignment: Alignment.center, - height: 88.w, - width: 88.w, - decoration: BoxDecoration( - shape: BoxShape.circle, - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: _listCard[index]['shapeColoList'], - ), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.2), - offset: Offset(1.1, 1.1), - blurRadius: 10.0), - ], - ), - child: Image.asset( - _listCard[index]['image'], - fit: BoxFit.fill, - height: 64.w, - width: 77.w, - ), - ), - SizedBox(width: 24.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: 5.w), - Text( - _listCard[index]['title'], - style: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 32.sp, - color: Color(0xffffffff), - ), - ), - SizedBox(height: 4.w), - Text( - _listCard[index]['subtitle'], - style: TextStyle( - fontSize: 20.sp, - color: Color(0xffffffff), - ), - ), - ], - ), - ], - ), - ), - ); - }, - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 1, - crossAxisSpacing: 40.w, - childAspectRatio: 600.w / 160.w), - ), - ); - } -} diff --git a/lib/pages/tab_navigator.dart b/lib/pages/tab_navigator.dart index 98f2b6d5..6f85e35d 100644 --- a/lib/pages/tab_navigator.dart +++ b/lib/pages/tab_navigator.dart @@ -1,25 +1,18 @@ -import 'package:flutter/material.dart'; - -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; - import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/constants/sars_api.dart'; -import 'package:aku_new_community/model/user/province_model.dart'; import 'package:aku_new_community/pages/property/property_page.dart'; import 'package:aku_new_community/pages/sign/login/login_page.dart'; import 'package:aku_new_community/provider/app_provider.dart'; import 'package:aku_new_community/ui/community/community_views/community_page.dart'; import 'package:aku_new_community/ui/market/market_page.dart'; -import 'package:aku_new_community/utils/hive_store.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/utils/websocket/web_socket_util.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:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; + import 'home/home_page.dart'; import 'personal/personal_page.dart'; @@ -50,25 +43,11 @@ class _TabNavigatorState extends State final appProvider = Provider.of(Get.context!); Future.delayed(Duration(milliseconds: 0), () async { await appProvider.getMyAddress(); //设置默认地址 - List _province = []; - var agreement = await HiveStore.appBox?.get('cityList') ?? null; - if (agreement == null) { - ///获取城市列表 - BaseModel baseModel = await NetUtil().get( - API.user.findAllCityInfo, - ); - if (baseModel.data != null) { - _province = (baseModel.data as List) - .map((e) => ProvinceModel.fromJson(e)) - .toList(); - HiveStore.appBox!.put('cityList', _province); - } - } }); _pages = [ HomePage(), MarketPage(), - PropertyPage(), //PropertyIndex(), + PropertyPage(), CommunityPage(), PersonalIndex() ]; diff --git a/lib/ui/community/activity/activity_card.dart b/lib/ui/community/activity/activity_card.dart index 6b321eae..7f52e94f 100644 --- a/lib/ui/community/activity/activity_card.dart +++ b/lib/ui/community/activity/activity_card.dart @@ -1,154 +1,129 @@ +import 'package:aku_new_community/model/common/img_model.dart'; +import 'package:aku_new_community/models/home/home_activity_model.dart'; +import 'package:aku_new_community/ui/community/activity/activity_func.dart'; +import 'package:aku_new_community/utils/headers.dart'; +import 'package:aku_new_community/widget/beeImageNetwork.dart'; import 'package:flutter/material.dart'; - -import 'package:common_utils/common_utils.dart'; import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; -import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/constants/sars_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 'activity_detail_page_old.dart'; +import 'activity_detail_page.dart'; class ActivityCard extends StatelessWidget { - final ActivityItemModel? model; + final bool? home; + final HomeActivityModel? model; const ActivityCard({ Key? key, required this.model, + this.home = false, }) : super(key: key); bool get outdate => model!.end!.compareTo(DateTime.now()) == -1; Widget build(BuildContext context) { - return MaterialButton( - clipBehavior: Clip.antiAlias, - color: Colors.white, - padding: EdgeInsets.zero, - onPressed: () => Get.to(() => ActivityDetailPage(id: model!.id)), - elevation: 0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(24.w), - // side: BorderSide( - // color: Colors.grey, - // ), - ), - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Hero( - tag: ImgModel.first(model!.imgUrls), - child: Material( - color: Colors.grey, - child: FadeInImage.assetNetwork( - placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: SARSAPI.image(ImgModel.first(model!.imgUrls)), - height: 197.w, - width: double.infinity, - fit: BoxFit.cover, + return ConstrainedBox( + constraints: BoxConstraints(maxHeight: home! ? 480.w : 540.w), + child: MaterialButton( + clipBehavior: Clip.antiAlias, + color: Colors.white, + padding: EdgeInsets.zero, + onPressed: () => Get.to(() => ActivityDetailPage(id: model!.id)), + elevation: 0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(24.w), + ), + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Hero( + tag: ImgModel.first(model!.imgList), + child: Material( + color: Colors.grey, + child: BeeImageNetwork( + imgs: model!.imgList ?? [], + width: double.infinity, + height: home! ? 240.w : 340.w, + ), ), ), - ), - - Padding( - padding: EdgeInsets.only(left: 24.w, top: 24.w), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - constraints: BoxConstraints(maxWidth: 340.w), - child: Text( - model == null ? '' : model!.title!, - maxLines: 2, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Color(0xD9000000), - fontSize: 28.sp, - fontWeight: FontWeight.bold), + Padding( + padding: EdgeInsets.only(left: 24.w, top: 24.w), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + constraints: BoxConstraints(maxWidth: 340.w), + child: Text( + model == null ? '' : model!.title, + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Color(0xD9000000), + fontSize: 28.sp, + fontWeight: FontWeight.bold), + ), ), - ), - Spacer(), - GestureDetector( - child: Container( - //color: Color(0x80FEBF76), + Spacer(), + GestureDetector( + child: Container( + //color: Color(0x80FEBF76), - // shape: StadiumBorder(), - alignment: Alignment.center, - height: 39.w, - width: 98.w, - decoration: BoxDecoration( - color: outdate - ? Colors.black.withOpacity(0.06) - : Color(0x80FEBF76), - borderRadius: BorderRadius.all(Radius.circular(4)), - ), + // shape: StadiumBorder(), + alignment: Alignment.center, + height: 39.w, + width: 98.w, + decoration: BoxDecoration( + color: outdate + ? Colors.black.withOpacity(0.06) + : Color(0x80FEBF76), + borderRadius: BorderRadius.all(Radius.circular(4)), + ), - child: outdate - ? '已结束' - .text - .size(22.sp) - .color(Colors.black.withOpacity(0.25)) - .make() - : '报名中' - .text - .size(22.sp) - .color(Color(0xFFF48117)) - .make(), + child: outdate + ? '已结束' + .text + .size(22.sp) + .color(Colors.black.withOpacity(0.25)) + .make() + : '报名中' + .text + .size(22.sp) + .color(Color(0xFFF48117)) + .make(), + ), + onTap: () { + outdate + ? null + : () { + Get.to(() => ActivityDetailPage(id: model!.id)); + }; + }, ), - onTap: () { - outdate - ? null - : () { - Get.to(() => ActivityDetailPage(id: model!.id)); - }; - }, - ), - 24.wb - ], + 24.wb + ], + ), ), - ), - // [ - // '地 点:'.text.size(24.sp).color(Color(0xFF999999)).make(), - // model!.location!.text.size(24.sp).make(), - // ].row().pSymmetric(h: 24.w), - 20.hb, - [ - '报名截止:'.text.size(22.sp).color(Color(0x73000000)).make(), - '${DateUtil.formatDate( - model!.end, - format: 'yyyy年MM月dd日 HH:mm', - )}' - .text - .size(22.sp) - .color(Color(0x73000000)) - .make(), - ].row().pSymmetric(h: 24.w), - // [ - // // StackAvatar( - // // avatars: model!.headImgURls!.map((e) => e.url).toList()), - // Spacer(), - // MaterialButton( - // elevation: 0, - // materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - // color: Color(0xFFFFC40C), - // shape: StadiumBorder(), - // height: 44.w, - // minWidth: 120.w, - // disabledColor: Color(0xFFABABAB), - // onPressed: outdate - // ? null - // : () { - // Get.to(() => ActivityDetailPage(id: model!.id)); - // }, - // child: outdate - // ? '已结束'.text.size(20.sp).bold.make() - // : '去看看'.text.size(20.sp).bold.make(), - // ), - // ].row().p(24.w), - ], + Spacer(), + [ + Flexible( + child: AvatarsParticipate( + avatars: (model?.imgList?.map((e) => e.url).toList() ?? []), + pNum: model?.registrationNum ?? 0, + hasIcon: false, + ), + ), + // Spacer(), + ActivityFunc.dateCheck(model!.end) + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ].row().pSymmetric(h: 24.w), + 20.hb, + ], + ), ), ); } diff --git a/lib/ui/community/activity/activity_detail_page.dart b/lib/ui/community/activity/activity_detail_page.dart index 8869e66f..0146d1d5 100644 --- a/lib/ui/community/activity/activity_detail_page.dart +++ b/lib/ui/community/activity/activity_detail_page.dart @@ -1,36 +1,58 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:common_utils/common_utils.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; - -import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; +import 'package:aku_new_community/models/home/activity_detail_model.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'; +import 'package:aku_new_community/widget/beeImageNetwork.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/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/others/stack_avatar.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:get/get.dart'; +import 'package:url_launcher/url_launcher.dart'; + +import 'activity_func.dart'; class ActivityDetailPage extends StatefulWidget { - const ActivityDetailPage({Key? key}) : super(key: key); + final int id; + + const ActivityDetailPage({Key? key, required this.id}) : super(key: key); @override _ActivityDetailPageState createState() => _ActivityDetailPageState(); } class _ActivityDetailPageState extends State { + final EasyRefreshController _refreshController = EasyRefreshController(); + ActivityDetailModel? _model; + + @override + void initState() { + _refreshController.dispose(); + super.initState(); + } + @override Widget build(BuildContext context) { var content = Container( width: double.infinity, padding: EdgeInsets.all(32.w), + color: Colors.white, child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ '活动详情'.text.size(32.sp).color(Colors.black).bold.make(), 32.w.heightBox, - ''.text.size(28.sp).color(Colors.black.withOpacity(0.45)).make(), + '${_model?.content}' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), 32.w.heightBox, ...List.generate( 0, @@ -40,9 +62,8 @@ class _ActivityDetailPageState extends State { decoration: BoxDecoration( borderRadius: BorderRadius.circular(8.w), ), - child: Image.network( - '', - fit: BoxFit.fill, + child: BeeImageNetwork( + urls: [ImgModel.first(_model?.imgList)], ), )), ], @@ -50,57 +71,89 @@ class _ActivityDetailPageState extends State { ); return BeeScaffold( title: '活动详情', - body: ListView( - children: [ - _headWidget(), - 24.w.heightBox, - content, - 24.w.heightBox, - Container( - width: double.infinity, - padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 16.w), - height: 132.w, - child: Row( - children: [ - CircleAvatar( - child: FadeInImage.assetNetwork( - placeholder: Assets.images.placeholder.path, - image: '', + body: EasyRefresh( + header: MaterialHeader(), + controller: _refreshController, + firstRefresh: true, + onRefresh: () async { + BaseModel baseModel = await NetUtil().get( + SARSAPI.activity.detail, + params: {'activityId': widget.id}, + ); + _model = ActivityDetailModel.fromJson(baseModel.data); + setState(() {}); + }, + child: _model == null + ? SizedBox() + : ListView( + children: [ + _headWidget(), + 24.w.heightBox, + content, + 24.w.heightBox, + Container( + width: double.infinity, + color: Colors.white, + padding: + EdgeInsets.symmetric(horizontal: 32.w, vertical: 16.w), + height: 132.w, + child: Row( + children: [ + CircleAvatar( + child: BeeImageNetwork( + width: 100.w, + height: 100.w, + imgs: _model!.organizerImgList, + ), + radius: 50.w, + ), + 20.w.widthBox, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '${_model!.unit}' + .text + .size(28.sp) + .color(Colors.black) + .make(), + 8.w.heightBox, + '${S.of(context)!.tempPlotName}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.25)) + .make() + ], + ), + Spacer(), + MaterialButton( + minWidth: 120.w, + height: 60.w, + onPressed: () { + launch('tel:${_model!.tel}'); + }, + shape: RoundedRectangleBorder( + side: BorderSide( + color: Colors.blueAccent, + ), + borderRadius: BorderRadius.circular(30.w)), + child: '联系物业' + .text + .size(24.sp) + .color(Colors.blueAccent) + .make(), + ), + ], + ), ), - ), - 20.w.widthBox, - Column( - children: [ - '印象物业'.text.size(28.sp).color(Colors.black).make(), - 8.w.heightBox, - '${S.of(context)!.tempPlotName}' - .text - .size(24.sp) - .color(Colors.black.withOpacity(0.25)) - .make() - ], - ), - Spacer(), - MaterialButton( - minWidth: 120.w, - height: 60.w, - onPressed: () {}, - shape: RoundedRectangleBorder( - side: BorderSide( - color: Colors.blueAccent, - ), - borderRadius: BorderRadius.circular(30.w)), - child: - '联系物业'.text.size(24.sp).color(Colors.blueAccent).make(), - ), - ], - ), - ), - ], + ], + ), ), bottomNavi: BottomButton( child: '立即报名'.text.size(32.sp).color(Colors.black).bold.make(), - onPressed: () {}, + onPressed: () async { + await NetUtil().post(SARSAPI.activity.registration, + params: {'activityId': _model!.id}, showMessage: true); + }, ), ); } @@ -110,16 +163,21 @@ class _ActivityDetailPageState extends State { color: Colors.white, child: Column( children: [ - Image.asset( - Assets.images.logo.path, + Container( width: double.infinity, height: 280.w, + child: BeeImageNetwork( + imgs: _model!.imgList, + fit: BoxFit.fitWidth, + ), ), Padding( - padding: EdgeInsets.all(32.w), + padding: EdgeInsets.only( + left: 32.w, right: 32.w, top: 16.w, bottom: 16.w), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - '人才公寓党政建设讲座系列活动——庆祝中国共产党建党71周年活动' + '${_model!.title}' .text .size(32.sp) .color(Colors.black.withOpacity(0.85)) @@ -127,121 +185,110 @@ class _ActivityDetailPageState extends State { .bold .make(), 32.w.heightBox, - Container( - width: 104.w, - height: 42.w, - decoration: BoxDecoration( - color: Color(0xFFFEC076).withOpacity(0.5), - borderRadius: BorderRadius.circular(10.w)), - alignment: Alignment.center, - child: - '报名中'.text.size(24.sp).color(Color(0xFFF481170)).make(), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: 104.w, + height: 42.w, + decoration: BoxDecoration( + color: Color(0xFFFEC076).withOpacity(0.5), + borderRadius: BorderRadius.circular(10.w)), + alignment: Alignment.center, + child: '${ActivityFunc.dateCheck(_model!.regisEndTime)}' + .text + .size(24.sp) + .color(Color(0xFFF481170)) + .make(), + ), + ], ), 32.w.heightBox, _buildTile( '报名时间', '${DateUtil.formatDate( - DateTime.now(), + _model!.regisStartTime, format: 'yyyy.MM.dd HH:mm', )}-${DateUtil.formatDate( - DateTime.now(), + _model!.regisEndTime, format: 'yyyy.MM.dd HH:mm', )}', ), + 16.hb, _buildTile( '活动时间', '${DateUtil.formatDate( - DateTime.now(), + _model!.activeTime, format: 'yyyy.MM.dd HH:mm', )}-${DateUtil.formatDate( - DateTime.now(), + _model!.activeEndTime, format: 'yyyy.MM.dd HH:mm', )}', ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 32.w), - child: Row( - children: [ - '活动方式'.text.size(28.sp).make().box.width(136.w).make(), - '本次活动介绍' - .richText - .tap(() { - var bottomSheet = Container( - width: double.infinity, - padding: EdgeInsets.all(32.w), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(16.w)), - child: Column( - children: [ - '活动介绍'.text.size(32.sp).black.bold.make(), - 32.w.heightBox, - ], - ), - ); - Get.bottomSheet( - bottomSheet, - ); - }) - .size(28.sp) - .make(), - Spacer(), - ], - ), + 16.hb, + Row( + children: [ + '活动方式'.text.size(28.sp).make().box.width(136.w).make(), + '本次活动介绍' + .richText + .tap(() { + var bottomSheet = Container( + width: double.infinity, + padding: EdgeInsets.all(32.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16.w)), + child: Column( + children: [ + '活动介绍'.text.size(32.sp).black.bold.make(), + 32.w.heightBox, + _model!.content.text + .size(28.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + ); + Get.bottomSheet( + bottomSheet, + ); + }) + .size(28.sp) + .color(Colors.blue) + .make(), + Spacer(), + ], ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 32.w), - child: Row( - children: [ - '活动费用'.text.size(28.sp).make().box.width(136.w).make(), - '免费'.richText.size(28.sp).make(), - Spacer(), - ], - ), + 16.hb, + Row( + children: [ + '活动费用'.text.size(28.sp).make().box.width(136.w).make(), + '免费'.richText.size(28.sp).make(), + Spacer(), + ], ), - 32.w.heightBox, - Padding( - padding: EdgeInsets.symmetric(horizontal: 32.w), - child: Row( - children: [ - '活动地点'.text.size(28.sp).make().box.width(136.w).make(), - '永恒智慧大厦'.richText.tap(() {}).size(28.sp).make(), - Spacer(), - ], - ), + 16.w.heightBox, + Row( + children: [ + '活动地点'.text.size(28.sp).make().box.width(136.w).make(), + '${_model!.activityAddress}' + .richText + .tap(() {}) + .size(28.sp) + .color(Colors.blue) + .make(), + Spacer(), + ], ), 32.w.heightBox, - BeeDivider.horizontal( - indent: 32.w, - endIndent: 32.w, - ), - InkWell( - onTap: () {}, - child: Container( - padding: EdgeInsets.only( - left: 32.w, right: 32.w, top: 16.w, bottom: 24.w), - child: Row( - children: [ - StackAvatar( - avatars: [], - ), - 16.w.heightBox, - '200' - .richText - .withTextSpanChildren( - ['/1000人参与'.textSpan.size(24.sp).black.make()]) - .color(Colors.blueAccent) - .size(24.sp) - .make(), - Spacer(), - Icon( - CupertinoIcons.chevron_right, - size: 40.w, - ), - ], - ), - ), - ), + BeeDivider.horizontal(), + 16.hb, + AvatarsParticipate( + avatars: _model!.registrationList + .map((e) => ImgModel.first(e.avatarImgList)) + .toList(), + pNum: _model!.registrationNum, + tNum: _model!.registrationNumMax), ], ), ), @@ -256,6 +303,62 @@ class _ActivityDetailPageState extends State { title.text.size(28.sp).make().box.width(136.w).make(), subTitle.text.size(28.sp).make().expand(), ], - ).pSymmetric(h: 32.w); + ); + } +} + +class AvatarsParticipate extends StatelessWidget { + final List avatars; + + //参加人数 + final int pNum; + + //总人数 + final int? tNum; + + final bool? hasIcon; + + const AvatarsParticipate({ + Key? key, + required this.avatars, + required this.pNum, + this.tNum, + this.hasIcon = true, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: () {}, + child: Container( + child: Row( + children: [ + StackAvatar( + avatars: avatars, + ), + 16.w.heightBox, + '${pNum}' + .richText + .withTextSpanChildren([ + '${tNum == null ? '' : '/${tNum}'}人参与' + .textSpan + .size(24.sp) + .black + .make() + ]) + .color(Colors.blueAccent) + .size(24.sp) + .make(), + Spacer(), + !hasIcon! + ? SizedBox() + : Icon( + CupertinoIcons.chevron_right, + size: 40.w, + ), + ], + ), + ), + ); } } diff --git a/lib/ui/community/activity/activity_func.dart b/lib/ui/community/activity/activity_func.dart new file mode 100644 index 00000000..00a3ee54 --- /dev/null +++ b/lib/ui/community/activity/activity_func.dart @@ -0,0 +1,24 @@ +class ActivityFunc { + static String dateCheck(DateTime? date) { + if (date == null) { + return ''; + } + var nowDate = DateTime.now(); + if (date.isBefore(nowDate)) { + return '已结束'; + } else { + var days = date.difference(nowDate).inDays; + if (days > 0) { + return '${days}天后结束'; + } else { + var hours = date.difference(nowDate).inHours; + if (hours > 0) { + return '${hours}小时后结束'; + } else { + var mins = date.difference(nowDate).inMinutes; + return '$mins分钟后结束'; + } + } + } + } +} diff --git a/lib/ui/community/activity/activity_list_page.dart b/lib/ui/community/activity/activity_list_page.dart index f6ab6704..ea2da37b 100644 --- a/lib/ui/community/activity/activity_list_page.dart +++ b/lib/ui/community/activity/activity_list_page.dart @@ -1,16 +1,11 @@ -import 'package:flutter/material.dart'; - -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; - -import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; -import 'package:aku_new_community/model/community/activity_item_model.dart'; +import 'package:aku_new_community/models/home/home_activity_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/ui/community/activity/activity_card.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'activity_detail_page_old.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; class ActivityListPage extends StatefulWidget { ActivityListPage({Key? key}) : super(key: key); @@ -31,24 +26,24 @@ class _ActivityListPageState extends State { @override Widget build(BuildContext context) { return BeeScaffold( - title: '往期精彩', + title: '社区活动', actions: [ - IconButton( - onPressed: () { - Get.to(() => ActivityDetailPage(id: 0)); - }, - icon: Icon(Icons.delete)) + // IconButton( + // onPressed: () { + // Get.to(() => ActivityDetailPage(id: 0)); + // }, + // icon: Icon(Icons.delete)) ], - body: BeeListView( + body: BeeListView( controller: _refreshController, - path: API.community.activityList, + path: SARSAPI.activity.list, convert: (model) => - model.rows.map((e) => ActivityItemModel.fromJson(e)).toList(), + model.rows.map((e) => HomeActivityModel.fromJson(e)).toList(), builder: (items) { return ListView.separated( padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 20.w), itemBuilder: (context, index) { - final ActivityItemModel model = items[index]; + final HomeActivityModel model = items[index]; return ActivityCard(model: model); }, separatorBuilder: (_, __) => 20.hb, diff --git a/lib/ui/community/community_func.dart b/lib/ui/community/community_func.dart index 346db155..30c7a5cc 100644 --- a/lib/ui/community/community_func.dart +++ b/lib/ui/community/community_func.dart @@ -1,12 +1,12 @@ import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/sars_api.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/hot_news_model.dart'; -import 'package:aku_new_community/model/community/swiper_model.dart'; import 'package:aku_new_community/model/good/market_swiper_model.dart'; import 'package:aku_new_community/models/community/dynamic_my_list_body.dart'; import 'package:aku_new_community/models/community/topic_model.dart'; +import 'package:aku_new_community/models/home/home_activity_model.dart'; +import 'package:aku_new_community/models/home/home_announce_model.dart'; +import 'package:aku_new_community/models/home/home_swiper_model.dart'; import 'package:aku_new_community/models/market/goods_popular_model.dart'; import 'package:aku_new_community/models/market/market_all_category_model.dart'; import 'package:aku_new_community/models/market/market_category_model.dart'; @@ -120,38 +120,31 @@ class CommunityFunc { .toList(); } - static Future activity() async { + static Future> activityList() async { BaseListModel model = await NetUtil().getList( - API.community.activityList, - params: {'pageNum': 1, 'size': 5}, - ); - if (model.rows.length == 0) return null; - return ActivityItemModel.fromJson(model.rows.first); - } - - static Future> activityList() async { - BaseListModel model = await NetUtil().getList( - API.community.activityList, + SARSAPI.activity.list, params: {'pageNum': 1, 'size': 5}, ); if (model.rows.length == 0) return []; - return model.rows.map((e) => ActivityItemModel.fromJson(e)).toList(); + return model.rows.map((e) => HomeActivityModel.fromJson(e)).toList(); } - static Future> board() async { + static Future> board() async { BaseListModel model = await NetUtil().getList( - API.community.boardList, + SARSAPI.announce.list, params: {'pageNum': 1, 'size': 5}, ); if (model.rows.length == 0) return []; - return model.rows.map((e) => BoardItemModel.fromJson(e)).toList(); + return model.rows.map((e) => HomeAnnounceModel.fromJson(e)).toList(); } - static Future> swiper() async { + static Future> swiper() async { BaseModel model = await NetUtil().get( - API.community.getSwiper, + SARSAPI.homeCarouse.list, ); if (model.data!.length == 0) return []; - return (model.data as List).map((e) => SwiperModel.fromJson(e)).toList(); + return (model.data as List) + .map((e) => HomeSwiperModel.fromJson(e)) + .toList(); } } diff --git a/lib/ui/community/community_views/topic/topic_community_view.dart b/lib/ui/community/community_views/topic/topic_community_view.dart index cab08364..236b3123 100644 --- a/lib/ui/community/community_views/topic/topic_community_view.dart +++ b/lib/ui/community/community_views/topic/topic_community_view.dart @@ -119,7 +119,7 @@ class TopicCommunityViewState extends State { ), child: Stack( children: [ - BeeImageNetwork(urls: model.imgList), + BeeImageNetwork(imgs: model.imgList), ], ), ), diff --git a/lib/ui/community/notice/notice_card.dart b/lib/ui/community/notice/notice_card.dart index bfca65f5..c3a3bfa6 100644 --- a/lib/ui/community/notice/notice_card.dart +++ b/lib/ui/community/notice/notice_card.dart @@ -1,21 +1,18 @@ -import 'package:flutter/material.dart'; - -import 'package:common_utils/common_utils.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; - -import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:aku_new_community/model/community/board_model.dart'; +import 'package:aku_new_community/models/home/home_announce_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/beeImageNetwork.dart'; import 'package:aku_new_community/widget/picker/bee_image_preview.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'; +@Deprecated('旧设计,暂时弃用') class NoticeCard extends StatelessWidget { - final BoardItemModel model; - final BoardItemModel? preModel; + final HomeAnnounceModel model; + final HomeAnnounceModel? preModel; const NoticeCard({ Key? key, @@ -24,25 +21,26 @@ class NoticeCard extends StatelessWidget { }) : super(key: key); bool get sameDay => - model.releaseDate!.year == (preModel?.releaseDate?.year ?? 0) && - model.releaseDate!.month == (preModel?.releaseDate?.month ?? 0) && - model.releaseDate!.day == (preModel?.releaseDate?.day ?? 0); + model.createDateString?.year == (preModel?.createDateString?.year ?? 0) && + model.createDateString?.month == + (preModel?.createDateString?.month ?? 0) && + model.createDateString?.day == (preModel?.createDateString?.day ?? 0); bool get isYesterday { DateTime now = DateTime.now(); - DateTime yestoday = DateTime(now.year, now.month, now.day - 1); - return yestoday.year == model.releaseDate!.year && - yestoday.month == model.releaseDate!.month && - yestoday.day == model.releaseDate!.day; + DateTime yesterday = DateTime(now.year, now.month, now.day - 1); + return yesterday.year == model.createDateString?.year && + yesterday.month == model.createDateString?.month && + yesterday.day == model.createDateString?.day; } bool get isFirst => preModel == null; bool get notSameYear => - model.releaseDate!.year != (preModel?.releaseDate?.year ?? 0); + model.createDateString?.year != (preModel?.createDateString?.year ?? 0); Widget title() { - if (DateUtil.isToday(model.releaseDate!.millisecond)) + if (DateUtil.isToday(model.createDateString?.millisecond)) return '今天'.text.size(52.sp).bold.make(); if (isYesterday) return '昨天'.text.size(52.sp).bold.make(); @@ -50,8 +48,12 @@ class NoticeCard extends StatelessWidget { return Row( mainAxisSize: MainAxisSize.min, children: [ - model.releaseDate!.day.toString().text.size(52.sp).bold.make(), - '${model.releaseDate!.month}月'.text.size(36.sp).make(), + (model.createDateString?.day.toString() ?? '') + .text + .size(52.sp) + .bold + .make(), + '${model.createDateString?.month}月'.text.size(36.sp).make(), ], ); } @@ -62,8 +64,8 @@ class NoticeCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - (notSameYear && model.releaseDate!.year != DateTime.now().year) - ? '${model.releaseDate!.year}年' + (notSameYear && model.createDateString?.year != DateTime.now().year) + ? '${model.createDateString?.year}年' .text .bold .size(52.sp) @@ -83,14 +85,14 @@ class NoticeCard extends StatelessWidget { alignment: Alignment.topLeft, child: sameDay ? SizedBox() : title(), ), - model.imgUrls!.length == 0 + model.imgList.length == 0 ? SizedBox(height: 152.w) : GestureDetector( onTap: () { BeeImagePreview.toPath( - path: ImgModel.first(model.imgUrls), + path: ImgModel.first(model.imgList), tag: - '${ImgModel.first(model.imgUrls)}${model.hashCode}', + '${ImgModel.first(model.imgList)}${model.hashCode}', ); }, child: Container( @@ -101,19 +103,15 @@ class NoticeCard extends StatelessWidget { ), child: Hero( tag: - '${ImgModel.first(model.imgUrls)}${model.hashCode}', - child: FadeInImage.assetNetwork( - placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: SARSAPI.image(ImgModel.first(model.imgUrls)), - width: 152.w, - height: 152.w, - fit: BoxFit.cover, + '${ImgModel.first(model.imgList)}${model.hashCode}', + child: BeeImageNetwork( + imgs: model.imgList, ), ), ), ), 10.wb, - model.title!.text.make().expand(), + model.title.text.make().expand(), ], ), ), diff --git a/lib/ui/community/notice/notice_detail_page.dart b/lib/ui/community/notice/notice_detail_page.dart index 108e0603..04335ce8 100644 --- a/lib/ui/community/notice/notice_detail_page.dart +++ b/lib/ui/community/notice/notice_detail_page.dart @@ -1,20 +1,17 @@ -import 'package:flutter/material.dart'; - -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; -import 'package:open_file/open_file.dart'; - -import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; -import 'package:aku_new_community/model/community/board_detail_model.dart'; +import 'package:aku_new_community/models/home/announce_detail_model.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'; +import 'package:aku_new_community/widget/beeImageNetwork.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/picker/bee_image_preview.dart'; import 'package:aku_new_community/widget/views/bee_download_view.dart'; import 'package:aku_new_community/widget/views/doc_view.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; +import 'package:open_file/open_file.dart'; class NoticeDetailPage extends StatefulWidget { final int? id; @@ -27,7 +24,7 @@ class NoticeDetailPage extends StatefulWidget { class _NoticeDetailPageState extends State { EasyRefreshController _refreshController = EasyRefreshController(); - BoardDetailModel? model; + AnnounceDetailModel? model; Widget get emptyWidget => Column( children: [], @@ -42,11 +39,11 @@ class _NoticeDetailPageState extends State { header: MaterialHeader(), onRefresh: () async { BaseModel baseModel = await NetUtil().get( - API.community.boardDetail, + SARSAPI.announce.detail, params: {'announcementId': widget.id}, ); if (baseModel.data != null) { - model = BoardDetailModel.fromJson(baseModel.data); + model = AnnounceDetailModel.fromJson(baseModel.data); } setState(() {}); }, @@ -57,9 +54,9 @@ class _NoticeDetailPageState extends State { : ListView( padding: EdgeInsets.all(32.w), children: [ - model!.title!.text.size(32.sp).bold.make(), + model!.title.text.size(32.sp).bold.make(), 50.hb, - ...model!.imgUrls! + ...model!.annexImgList .map( (e) => GestureDetector( onTap: () { @@ -76,10 +73,9 @@ class _NoticeDetailPageState extends State { borderRadius: BorderRadius.circular(8.w), color: Colors.black12, ), - child: FadeInImage.assetNetwork( - placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: SARSAPI.image(e.url), - fit: BoxFit.cover, + child: BeeImageNetwork( + urls: [e.url ?? ''], + fit: BoxFit.fill, ), ), ), @@ -87,17 +83,19 @@ class _NoticeDetailPageState extends State { ) .toList(), 44.hb, - model!.content!.text.size(28.sp).make(), + model!.content.text.size(28.sp).make(), 43.hb, - DocViw( - title: model?.fileDocName ?? '', - onPressed: () async { - String? result = await Get.dialog(BeeDownloadView( - file: model!.fileDocUrl, - )); - if (result != null) OpenFile.open(result); - }, - ), + ...model!.annexImgList + .map((e) => DocViw( + title: e.url ?? '', + onPressed: () async { + String? result = await Get.dialog(BeeDownloadView( + file: SARSAPI.image(e.url), + )); + if (result != null) OpenFile.open(result); + }, + )) + .toList(), ], ), ).material(color: Colors.white), diff --git a/lib/ui/community/notice/notice_page.dart b/lib/ui/community/notice/notice_page.dart index fd1fe65b..0f0377bc 100644 --- a/lib/ui/community/notice/notice_page.dart +++ b/lib/ui/community/notice/notice_page.dart @@ -1,15 +1,13 @@ -import 'package:flutter/material.dart'; - -import 'package:flutter_easyrefresh/easy_refresh.dart'; - -import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; -import 'package:aku_new_community/model/community/board_model.dart'; +import 'package:aku_new_community/models/home/home_announce_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/ui/community/notice/notice_card.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +@Deprecated('暂时弃用') class NoticePage extends StatefulWidget { NoticePage({Key? key}) : super(key: key); @@ -24,17 +22,17 @@ class _NoticePageState extends State { Widget build(BuildContext context) { return BeeScaffold( title: '社区公告', - body: BeeListView( + body: BeeListView( controller: _refreshController, - path: API.community.boardList, + path: SARSAPI.announce.list, convert: (model) => - model.rows.map((e) => BoardItemModel.fromJson(e)).toList(), + model.rows.map((e) => HomeAnnounceModel.fromJson(e)).toList(), builder: (items) { return ListView.separated( padding: EdgeInsets.symmetric(vertical: 32.w), itemBuilder: (context, index) { - final BoardItemModel model = items[index]; - BoardItemModel? preModel; + final HomeAnnounceModel model = items[index]; + HomeAnnounceModel? preModel; if (index >= 1) preModel = items[index - 1]; return NoticeCard( model: model, diff --git a/lib/ui/home/home_notification.dart b/lib/ui/home/home_notification.dart index fc1d6600..f4808711 100644 --- a/lib/ui/home/home_notification.dart +++ b/lib/ui/home/home_notification.dart @@ -1,19 +1,15 @@ +import 'package:aku_new_community/models/home/home_announce_model.dart'; +import 'package:aku_new_community/ui/community/notice/notice_detail_page.dart'; +import 'package:aku_new_community/utils/bee_date_util.dart'; +import 'package:aku_new_community/utils/headers.dart'; +import 'package:carousel_slider/carousel_slider.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; - -import 'package:carousel_slider/carousel_slider.dart'; import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; - -import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/model/community/board_model.dart'; -import 'package:aku_new_community/ui/community/notice/notice_page.dart'; -import 'package:aku_new_community/utils/bee_date_util.dart'; -import 'package:aku_new_community/utils/headers.dart'; class HomeNotification extends StatefulWidget { - final List items; + final List items; HomeNotification({Key? key, required this.items}) : super(key: key); @@ -22,17 +18,15 @@ class HomeNotification extends StatefulWidget { } class _HomeNotificationState extends State { - late BoardItemModel boardItemModel; + late HomeAnnounceModel boardItemModel; bool isDate = true; @override void initState() { super.initState(); - if (widget.items != null) { - if (widget.items.length > 0) { - boardItemModel = widget.items[0]; - } + if (widget.items.length > 0) { + boardItemModel = widget.items[0]; } } @@ -69,10 +63,10 @@ class _HomeNotificationState extends State { ); } - Widget getText(BoardItemModel e) { + Widget getText(HomeAnnounceModel e) { return GestureDetector( onTap: () { - Get.to(() => NoticePage()); + Get.to(() => NoticeDetailPage(id: e.id)); }, child: Container( color: Colors.transparent, @@ -81,7 +75,7 @@ class _HomeNotificationState extends State { Container( constraints: BoxConstraints(maxWidth: 190), child: Text( - e.title ?? '', + e.title, style: TextStyle( color: Color(0xA6000000), fontSize: 22.sp, @@ -93,7 +87,7 @@ class _HomeNotificationState extends State { Spacer(), Container( child: Text( - e.releaseDate != null ? BeeDateUtil(e.releaseDate).timeAgo : '', + BeeDateUtil(DateUtil.getDateTime(e.createDate)).timeAgo, style: TextStyle( color: Color(0x73000000), fontSize: 20.sp, diff --git a/lib/widget/beeImageNetwork.dart b/lib/widget/beeImageNetwork.dart index 5be828e9..475582e9 100644 --- a/lib/widget/beeImageNetwork.dart +++ b/lib/widget/beeImageNetwork.dart @@ -5,28 +5,38 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; class BeeImageNetwork extends StatelessWidget { - final List urls; + final List? imgs; + final List? urls; final double? width; final double? height; + final BoxFit? fit; - const BeeImageNetwork({Key? key, required this.urls, this.width, this.height}) - : super(key: key); + const BeeImageNetwork( + {Key? key, + this.imgs, + this.width, + this.height, + this.urls, + this.fit = BoxFit.cover}) + : assert(imgs != null || urls != null), + super(key: key); @override Widget build(BuildContext context) { return FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: SARSAPI.image(ImgModel.first(urls)), + image: SARSAPI.image(ImgModel.first(imgs)), imageErrorBuilder: (context, obj, stackTrace) { return Image.asset( R.ASSETS_IMAGES_PLACEHOLDER_WEBP, width: width ?? 160.w, - height: 160.w, + height: height ?? 160.w, + fit: BoxFit.fill, ); }, height: height ?? 160.w, width: width ?? 160.w, - fit: BoxFit.cover, + fit: fit, ); } } diff --git a/lib/widget/others/stack_avatar.dart b/lib/widget/others/stack_avatar.dart index 451700cf..3e186509 100644 --- a/lib/widget/others/stack_avatar.dart +++ b/lib/widget/others/stack_avatar.dart @@ -1,9 +1,6 @@ -import 'package:flutter/material.dart'; - -import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/utils/headers.dart'; +import 'package:aku_new_community/widget/beeImageNetwork.dart'; +import 'package:flutter/material.dart'; class StackAvatar extends StatelessWidget { final List avatars; @@ -32,12 +29,10 @@ class StackAvatar extends StatelessWidget { border: Border.all(color: Color(0xFF999999)), ), clipBehavior: Clip.antiAlias, - child: FadeInImage.assetNetwork( - height: 44.w, + child: BeeImageNetwork( width: 44.w, - placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: SARSAPI.image(avatars[index]), - fit: BoxFit.cover, + height: 44.w, + urls: [avatars[index] ?? ''], ), ), ); diff --git a/pubspec.lock b/pubspec.lock index f2a71ab2..16eda024 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,245 +5,245 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "34.0.0" + version: "36.0.0" advance_pdf_viewer: dependency: "direct main" description: name: advance_pdf_viewer - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" amap_flutter_base: dependency: "direct main" description: name: amap_flutter_base - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" amap_flutter_location: dependency: "direct main" description: name: amap_flutter_location - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" amap_flutter_map: dependency: "direct main" description: name: amap_flutter_map - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.2.0" + version: "3.3.1" animated_text_kit: dependency: "direct main" description: name: animated_text_kit - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.2.1" archive: dependency: transitive description: name: archive - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.1.11" + version: "3.2.1" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.8.2" auto_size_text_pk: dependency: transitive description: name: auto_size_text_pk - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" badges: dependency: "direct main" description: name: badges - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" bot_toast: dependency: "direct main" description: name: bot_toast - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.1" build: dependency: transitive description: name: build - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" build_config: dependency: transitive description: name: build_config - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" build_daemon: dependency: transitive description: name: build_daemon - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.1" build_resolvers: dependency: transitive description: name: build_resolvers - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.6" build_runner: dependency: "direct dev" description: name: build_runner - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.7" build_runner_core: dependency: transitive description: name: build_runner_core - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "7.2.3" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "8.1.4" cached_network_image: dependency: "direct main" description: name: cached_network_image - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.0" cached_network_image_platform_interface: dependency: transitive description: name: cached_network_image_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" cached_network_image_web: dependency: transitive description: name: cached_network_image_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" card_swiper: dependency: "direct main" description: name: card_swiper - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" carousel_slider: dependency: "direct main" description: name: carousel_slider - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" cli_util: dependency: transitive description: name: cli_util - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.3.5" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" code_builder: dependency: transitive description: name: code_builder - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.0" collection: dependency: "direct main" description: name: collection - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.15.0" color: dependency: transitive description: name: color - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" common_utils: @@ -259,154 +259,154 @@ packages: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.1" cross_file: dependency: transitive description: name: cross_file - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.3.2" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.1" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.4" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" dartx: dependency: transitive description: name: dartx - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" decimal: dependency: transitive description: name: decimal - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" device_info_plus: dependency: transitive description: name: device_info_plus - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.0" device_info_plus_linux: dependency: transitive description: name: device_info_plus_linux - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" device_info_plus_macos: dependency: transitive description: name: device_info_plus_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.2" device_info_plus_platform_interface: dependency: transitive description: name: device_info_plus_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.0+1" device_info_plus_web: dependency: transitive description: name: device_info_plus_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" device_info_plus_windows: dependency: transitive description: name: device_info_plus_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" dio: dependency: "direct main" description: name: dio - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.4" dotted_border: dependency: "direct main" description: name: dotted_border - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0+2" equatable: dependency: "direct main" description: name: equatable - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.3" expandable: dependency: "direct main" description: name: expandable - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.1" extended_list_library: dependency: transitive description: name: extended_list_library - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.2" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.1.2" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" flutter: @@ -418,42 +418,42 @@ packages: dependency: transitive description: name: flutter_blurhash - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "0.6.0" + version: "0.6.4" flutter_cache_manager: dependency: transitive description: name: flutter_cache_manager - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.3.0" flutter_easyrefresh: dependency: "direct main" description: name: flutter_easyrefresh - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" flutter_gen_core: dependency: transitive description: name: flutter_gen_core - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.5" flutter_gen_runner: dependency: "direct dev" description: name: flutter_gen_runner - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.5" flutter_highlight: dependency: transitive description: name: flutter_highlight - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.7.0" flutter_icons: @@ -474,35 +474,35 @@ packages: dependency: "direct dev" description: name: flutter_native_splash - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.2" flutter_plugin_android_lifecycle: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" flutter_rating_bar: dependency: "direct main" description: name: flutter_rating_bar - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" flutter_screenutil: dependency: "direct main" description: name: flutter_screenutil - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "5.1.1" + version: "5.3.1" flutter_slidable: dependency: "direct main" description: name: flutter_slidable - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.0" flutter_test: @@ -519,483 +519,483 @@ packages: dependency: "direct main" description: name: fluwx - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.6.1+4" frontend_server_client: dependency: transitive description: name: frontend_server_client - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.2" get: dependency: "direct main" description: name: get - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.6.1" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" graphs: dependency: transitive description: name: graphs - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" grinder: dependency: "direct dev" description: name: grinder - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.9.0" highlight: dependency: transitive description: name: highlight - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.7.0" hive: dependency: "direct main" description: name: hive - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.5" + version: "2.0.6" hive_flutter: dependency: "direct main" description: name: hive_flutter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" hive_generator: dependency: "direct dev" description: name: hive_generator - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.2" http: dependency: transitive description: name: http - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.13.4" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.1" + version: "3.2.0" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" image: dependency: transitive description: name: image - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.1.1" + version: "3.1.3" image_picker: dependency: "direct main" description: name: image_picker - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.7.5+4" image_picker_for_web: dependency: transitive description: name: image_picker_for_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.5" + version: "2.1.6" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.3" + version: "2.4.4" import_sorter: dependency: "direct dev" description: name: import_sorter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.6.0" infinite_listview: dependency: transitive description: name: infinite_listview - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" intl: dependency: "direct main" description: name: intl - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.17.0" io: dependency: transitive description: name: io - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.3" jpush_flutter: dependency: "direct main" description: name: jpush_flutter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.2" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.3" json_annotation: dependency: "direct main" description: name: json_annotation - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.4.0" json_serializable: dependency: "direct dev" description: name: json_serializable - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.1.4" logger: dependency: transitive description: name: logger - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.12.11" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.7.0" mime: dependency: transitive description: name: mime - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" nested: dependency: transitive description: name: nested - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" numberpicker: dependency: transitive description: name: numberpicker - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" octo_image: dependency: transitive description: name: octo_image - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" open_file: dependency: "direct main" description: name: open_file - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.1" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" package_info: dependency: "direct main" description: name: package_info - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" package_info_plus: dependency: transitive description: name: package_info_plus - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.0" + version: "1.4.0" package_info_plus_linux: dependency: transitive description: name: package_info_plus_linux - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.3" package_info_plus_macos: dependency: transitive description: name: package_info_plus_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" package_info_plus_web: dependency: transitive description: name: package_info_plus_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.4" package_info_plus_windows: dependency: transitive description: name: package_info_plus_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.4" palette_generator: dependency: "direct main" description: name: palette_generator - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "0.3.2" + version: "0.3.3" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.8.0" path_drawing: dependency: transitive description: name: path_drawing - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" path_parsing: dependency: transitive description: name: path_parsing - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" path_provider: dependency: "direct main" description: name: path_provider - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.8" + version: "2.0.9" path_provider_android: dependency: transitive description: name: path_provider_android - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.11" + version: "2.0.12" path_provider_ios: dependency: transitive description: name: path_provider_ios - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.7" + version: "2.0.8" path_provider_linux: dependency: transitive description: name: path_provider_linux - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.5" path_provider_macos: dependency: transitive description: name: path_provider_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.3" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" pedantic: dependency: transitive description: name: pedantic - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.11.1" permission_handler: dependency: "direct main" description: name: permission_handler - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "7.2.0" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.7.0" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.4.0" pin_input_text_field: dependency: transitive description: name: pin_input_text_field - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.1" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.2" pool: dependency: transitive description: name: pool - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.5.0" power_logger: dependency: "direct main" description: name: power_logger - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.2" process: dependency: transitive description: name: process - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.2.4" provider: dependency: "direct main" description: name: provider - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.0" pub_semver: dependency: "direct dev" description: name: pub_semver - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" pubspec_parse: dependency: transitive description: name: pubspec_parse - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" qr: dependency: transitive description: name: qr - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" qr_code_scanner: dependency: "direct main" description: name: qr_code_scanner - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.0" qr_flutter: dependency: "direct main" description: name: qr_flutter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" random_character: @@ -1011,56 +1011,56 @@ packages: dependency: transitive description: name: rational - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" rxdart: dependency: transitive description: name: rxdart - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.27.3" scroll_to_index: dependency: "direct main" description: name: scroll_to_index - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" share: dependency: "direct main" description: name: share - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.4" shelf: dependency: transitive description: name: shelf - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" shimmer: dependency: "direct main" description: name: shimmer - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" signature: dependency: "direct main" description: name: signature - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.1" sky_engine: @@ -1072,268 +1072,268 @@ packages: dependency: "direct main" description: name: sms_autofill - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.0" source_gen: dependency: transitive description: name: source_gen - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.1" source_helper: dependency: transitive description: name: source_helper - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.8.1" sqflite: dependency: transitive description: name: sqflite - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" sqflite_common: dependency: transitive description: name: sqflite_common - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" synchronized: dependency: transitive description: name: synchronized - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.3" time: dependency: transitive description: name: time - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" timing: dependency: transitive description: name: timing - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" tint: dependency: transitive description: name: tint - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" tobias: dependency: "direct main" description: name: tobias - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.0" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" universal_io: dependency: transitive description: name: universal_io - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.4" url_launcher: dependency: "direct main" description: name: url_launcher - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "6.0.18" + version: "6.0.20" url_launcher_android: dependency: transitive description: name: url_launcher_android - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "6.0.14" + version: "6.0.15" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "6.0.14" + version: "6.0.15" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.3" + version: "3.0.0" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.3" + version: "3.0.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" url_launcher_web: dependency: transitive description: name: url_launcher_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.6" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.2" + version: "3.0.0" uuid: dependency: transitive description: name: uuid - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.5" + version: "3.0.6" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" velocity_x: dependency: "direct main" description: name: velocity_x - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.4.0" vxstate: dependency: transitive description: name: vxstate - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" waterfall_flow: dependency: "direct main" description: name: waterfall_flow - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.2" web_socket_channel: dependency: "direct main" description: name: web_socket_channel - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" win32: dependency: transitive description: name: win32 - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.3.11" + version: "2.4.1" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.0+1" xml: dependency: transitive description: name: xml - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.3.1" yaml: dependency: "direct dev" description: name: yaml - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.0" sdks: dart: ">=2.15.0 <3.0.0" - flutter: ">=2.5.0" + flutter: ">=2.8.0"