diff --git a/lib/community/community_child_list.dart b/lib/community/community_child_list.dart index fff9cd45..37d7d4df 100644 --- a/lib/community/community_child_list.dart +++ b/lib/community/community_child_list.dart @@ -45,7 +45,9 @@ class _CommunityChildList extends State { if(isLoadMore){ pageNum += 1; isLoadMore = false; - }else pageNum = 1; + } else { + pageNum = 1; + } BaseData>? baseData = await apiService?.trendList({ "onlyFollow": widget.typeStr == "关注" ? true : false, "onlyMe": false, @@ -55,8 +57,8 @@ class _CommunityChildList extends State { }).catchError((error) { refreshController.refreshFailed(); refreshController.loadFailed(); + return BaseData>()..isSuccess = false; }); - refreshController.refreshCompleted(); refreshController.loadComplete(); if (baseData?.isSuccess ?? false) { diff --git a/lib/community/community_child_page.dart b/lib/community/community_child_page.dart index 4dc20952..53db887a 100644 --- a/lib/community/community_child_page.dart +++ b/lib/community/community_child_page.dart @@ -53,7 +53,7 @@ class CommunityChildPageState extends State widget.onScroll(); if (sc.offset >= 500) { _currentIndex =1; - }else if(sc.offset <= 500){ + } else if(sc.offset <= 500) { _currentIndex = 0; } }); @@ -98,8 +98,10 @@ class CommunityChildPageState extends State AppUtils.dioErrorTypeToString(error.type), alignment: Alignment.center, ); - return Future.value(null); + refreshController.refreshFailed(); + return BaseData>()..isSuccess = false; }); + refreshController.refreshCompleted(); if (baseData?.isSuccess ?? false) { if (baseData?.data?.list?.isNotEmpty ?? false) articles.forEach((element) { @@ -120,7 +122,7 @@ class CommunityChildPageState extends State setState(() {}); } }); - } + } isLoadingData = false; } diff --git a/lib/community/community_course.dart b/lib/community/community_course.dart index 0d28fbf8..7050596d 100644 --- a/lib/community/community_course.dart +++ b/lib/community/community_course.dart @@ -97,8 +97,7 @@ class _CommunityCourse extends State ///课程分类列表 classListAsync() async { - BaseListData? baseData = - await apiService?.categoryList().catchError((onError) { + BaseListData? baseData = await apiService?.categoryList().catchError((onError) { return BaseListData()..isSuccess = false; }); if (baseData?.isSuccess ?? false) { @@ -183,47 +182,35 @@ class _CommunityCourse extends State @override Widget build(BuildContext context) { super.build(context); - return Stack( - children: [ - Positioned( + return SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + setState(() { + _onRefresh(); + }); + }, + physics: BouncingScrollPhysics(), + scrollController: scrollController, + child: Container( + child: SingleChildScrollView( + physics: NeverScrollableScrollPhysics(), child: Container( - child: SmartRefresher( - controller: refreshController, - enablePullDown: true, - enablePullUp: false, - header: MyHeader(), - footer: CustomFooter( - builder: (context, mode) { - return MyFooter(mode); - }, - ), - onRefresh: () { - setState(() { - _onRefresh(); - }); - }, - physics: BouncingScrollPhysics(), - scrollController: scrollController, - child: Container( - child: SingleChildScrollView( - physics: NeverScrollableScrollPhysics(), - child: Container( - color: Color(0xFFF7F7F7), - margin: EdgeInsets.only(top: 16.h), - child: Column( - children: classChildItem(), - ), - ), - ), - ), + color: Color(0xFFF7F7F7), + margin: EdgeInsets.only(top: 16.h), + child: Column( + children: classChildItem(), ), ), - bottom: 0, - top: 0, - left: 0, - right: 0, ), - ], + ), ); } diff --git a/lib/community/community_view/class_list_view.dart b/lib/community/community_view/class_list_view.dart index 9d3ee953..f2009cb7 100644 --- a/lib/community/community_view/class_list_view.dart +++ b/lib/community/community_view/class_list_view.dart @@ -28,64 +28,34 @@ class _ClassListView extends State { fontSize: 16.sp, margin: EdgeInsets.only(left: 60.w, right: 60.w, bottom: 30), ) - : - // GridView.builder( - // itemCount:widget.classList == null ? 0 : widget.classList.length, - // padding: EdgeInsets.only( - // left: 16.w, - // right: 16.w, - // top: 13.h, - // bottom: 16.h, - // ), - // shrinkWrap: true, - // physics: NeverScrollableScrollPhysics(), - // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - // //一行的Widget数量 - // crossAxisCount:2, - // //水平子Widget之间间距 - // crossAxisSpacing: 11.w, - // //垂直子Widget之间间距 - // mainAxisSpacing: 16.w, - // //子Widget宽高比例 0.59 - // childAspectRatio: - // 225 / (281 / 2 + (281 / 2) * AppUtils.textScale(context)), - // ), - // itemBuilder: (context, index) { - // return GestureDetector( - // onTap: () { - // Navigator.of(context).pushNamed('/router/class_details', - // arguments: {"id": widget.classList[index].id}) - // .then((value) => {widget.classList[index].viewers = value != null?value:widget.classList[index].viewers+1}); - // }, - // child: classListItem(widget.classList[index]), - // ); - // }, - // ); - StaggeredGrid.count( - crossAxisCount: 2, - mainAxisSpacing: 8, - crossAxisSpacing: 8, - children: widget.classList.map((e) { - return GestureDetector( - onTap: () { - Navigator.of(context).pushNamed( - '/router/class_details', - arguments: {"id": e.id}, - ).then((value) => - {e.viewers = (value as int?) ?? (e.viewers ?? 0) + 1}); - }, - child: classListItem(e), - ); - }).toList(), + : Container( + padding: EdgeInsets.symmetric( + horizontal: 8, + vertical: 8, + ), + child: StaggeredGrid.count( + crossAxisCount: 2, + mainAxisSpacing: 8, + crossAxisSpacing: 8, + children: widget.classList.map((e) { + return GestureDetector( + onTap: () { + Navigator.of(context).pushNamed( + '/router/class_details', + arguments: {"id": e.id}, + ).then((value) => {e.viewers = (value as int?) ?? (e.viewers ?? 0) + 1}); + }, + child: classListItem(e), + ); + }).toList(), + ), ); } Widget classListItem(Course classList) { return Container( decoration: BoxDecoration( - borderRadius: BorderRadius.vertical( - bottom: Radius.circular(4), - ), + borderRadius: BorderRadius.circular(8), boxShadow: [ BoxShadow( color: Colors.black.withAlpha(10), @@ -96,44 +66,27 @@ class _ClassListView extends State { ], color: Colors.white, ), - margin: EdgeInsets.symmetric( - vertical: 3, - ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Stack( alignment: Alignment(0.9, 0.9), children: [ - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(10), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - color: Color.fromARGB(90, 0, 0, 0), - ), - child: ClipRRect( - child: Opacity( - opacity: 0.7, - child: MImage( - classList.coverImg ?? "", - width: double.infinity, - height: 220.h, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ), - ), - borderRadius: BorderRadius.vertical( - top: Radius.circular(4), + ClipRRect( + child: Opacity( + opacity: 1, + child: MImage( + classList.coverImg ?? "", + width: double.infinity, + height: 220.h, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", ), ), + borderRadius: BorderRadius.vertical( + top: Radius.circular(8), + ), ), Container( padding: EdgeInsets.only(left: 4), diff --git a/lib/community/community_view/class_title_tab.dart b/lib/community/community_view/class_title_tab.dart index 824a7b32..f4593687 100644 --- a/lib/community/community_view/class_title_tab.dart +++ b/lib/community/community_view/class_title_tab.dart @@ -16,8 +16,7 @@ class ClassTitleTab extends StatefulWidget { } } -class _ClassTitleTab extends State - with SingleTickerProviderStateMixin,AutomaticKeepAliveClientMixin { +class _ClassTitleTab extends State with SingleTickerProviderStateMixin,AutomaticKeepAliveClientMixin { TabController? tabController; @override @@ -29,37 +28,45 @@ class _ClassTitleTab extends State @override Widget build(BuildContext context) { + super.build(context); return Container( - alignment: Alignment.centerLeft, - child: DefaultTabController( - length: widget.classSelectList?.length ?? 0, - child: TabBar( - isScrollable: true, - //可滚动 - indicatorColor: Color(0xff39B54A), - labelColor: Color(0xff32A060), - labelStyle: TextStyle( - fontSize: 14.sp, - fontWeight: FontWeight.bold, - ), - unselectedLabelStyle: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - ), - controller: tabController, - //未选中文字颜色 - unselectedLabelColor: Color(0xff4D4D4D), - indicatorSize: TabBarIndicatorSize.label, - onTap: (index){ - widget.notifyClassSelectList(index); - }, - //指示器与文字等宽 - tabs: widget.classSelectList?.map((e) => MyTab(text: "${e.name}")).toList() ?? [], - ), - ), - ); + alignment: Alignment.centerLeft, + child: DefaultTabController( + length: widget.classSelectList.length, + child: TabBar( + isScrollable: true, + //可滚动 + indicatorColor: Color(0xff39B54A), + labelColor: Color(0xff32A060), + labelStyle: TextStyle( + fontSize: 14.sp, + fontWeight: FontWeight.bold, + ), + tabAlignment: TabAlignment.start, + padding: EdgeInsets.symmetric( + horizontal: 5.w, + ), + dividerHeight: 0, + dividerColor: Colors.transparent, + unselectedLabelStyle: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + controller: tabController, + //未选中文字颜色 + unselectedLabelColor: Color(0xff4D4D4D), + indicatorSize: TabBarIndicatorSize.label, + onTap: (index){ + widget.notifyClassSelectList(index); + }, + //指示器与文字等宽 + tabs: widget.classSelectList.map((e) => MyTab(text: "${e.name}")).toList(), + ), + ), + ); } @override bool get wantKeepAlive => true; + } diff --git a/lib/community/community_view/home_class.dart b/lib/community/community_view/home_class.dart index f5bad18d..ff0ef95d 100644 --- a/lib/community/community_view/home_class.dart +++ b/lib/community/community_view/home_class.dart @@ -26,11 +26,6 @@ class _HomeClass extends State { final TextEditingController editingController = TextEditingController(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return ListView.builder( @@ -48,7 +43,6 @@ class _HomeClass extends State { Widget collectItem(CollectClass collectList) { return Container( margin: EdgeInsets.symmetric( - horizontal: 6.w, vertical: 10.h, ), child: Column( @@ -68,26 +62,30 @@ class _HomeClass extends State { Container( height: 195.h, margin: EdgeInsets.only(top: 10.h), - child: ListView.builder( + child: ListView.separated( scrollDirection: Axis.horizontal, physics: BouncingScrollPhysics(), - padding: EdgeInsets.symmetric(horizontal: 10.w), + padding: EdgeInsets.symmetric(horizontal: 10), itemCount: widget.collectMap[collectList.id]?.length ?? 0, itemBuilder: (context, position) { return GestureDetector( onTap: () { Navigator.of(context).pushNamed( - '/router/class_details', - arguments: { - "id": widget.collectMap[collectList.id]![position].id - }).then((value) { - int viewer = widget.collectMap[collectList.id]![position].viewers ?? 0; - widget.collectMap[collectList.id]![position].viewers = value != null ? int.parse("${value}") : (viewer + 1); - }); + '/router/class_details', + arguments: { + "id": widget.collectMap[collectList.id]![position].id + }, + ).then((value) { + int viewer = widget.collectMap[collectList.id]![position].viewers ?? 0; + widget.collectMap[collectList.id]![position].viewers = value != null ? int.parse("${value}") : (viewer + 1); + }); }, child: classItem(widget.collectMap[collectList.id]![position]), ); }, + separatorBuilder: (BuildContext context, int index) { + return SizedBox(width: 10); + }, ), ), ], @@ -112,9 +110,6 @@ class _HomeClass extends State { ], color: Colors.white, ), - margin: EdgeInsets.symmetric( - horizontal: 6.w, - ), child: Column( children: [ Stack( @@ -123,37 +118,17 @@ class _HomeClass extends State { Stack( alignment: Alignment(0.9, 0.9), children: [ - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(4), - topRight: Radius.circular(4), - ), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(10), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - color: Color.fromARGB(90, 0, 0, 0), + ClipRRect( + child: MImage( + collect.coverImg ?? "", + width: double.infinity, + height: 120.h, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", ), - child: ClipRRect( - child: Opacity( - opacity: 0.7, - child: MImage( - collect.coverImg ?? "", - width: double.infinity, - height: 120.h, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ), - ), - borderRadius: BorderRadius.vertical( - top: Radius.circular(4), - ), + borderRadius: BorderRadius.vertical( + top: Radius.circular(4), ), ), Container( @@ -276,4 +251,5 @@ class _HomeClass extends State { ), ); } + } diff --git a/lib/constant.dart b/lib/constant.dart index f8b60273..40f9668d 100644 --- a/lib/constant.dart +++ b/lib/constant.dart @@ -20,7 +20,8 @@ const serviceMiniBaseUrl = "https://pos.api.yixinhuixiang.com/app/"; ///线下 /// app接口的请求地址 -const localBaseUrl = "http://192.168.10.54:8766/app/"; ///本地 +// const localBaseUrl = "http://192.168.10.54:8766/app/"; ///本地 +const localBaseUrl = "https://pos.platform.yixinhuixiang.com/app/"; ///本地 ///线上 const serviceBaseUrl = "https://pos.platform.yixinhuixiang.com/app/"; diff --git a/lib/data/home_rank.dart b/lib/data/home_rank.dart index b16852fe..32c53131 100644 --- a/lib/data/home_rank.dart +++ b/lib/data/home_rank.dart @@ -6,9 +6,9 @@ part 'home_rank.g.dart'; @JsonSerializable(explicitToJson: true) class HomeRank { - List? commodityList = []; - List? commodityZone = []; - String? commodityListImg = ''; + List? CommodityList = []; + List? CommodityZone = []; + String? CommodityListImg = ''; HomeRank(); @@ -19,16 +19,16 @@ class HomeRank { } @JsonSerializable(explicitToJson: true) -class CommodityList { +class Commoditys { List? goodList = []; String? typeName = ''; - CommodityList(); - factory CommodityList.fromJson(Map json) => _$CommodityListFromJson(json); - Map toJson() => _$CommodityListToJson(this); + Commoditys(); + factory Commoditys.fromJson(Map json) => _$CommoditysFromJson(json); + Map toJson() => _$CommoditysToJson(this); } @JsonSerializable(explicitToJson: true) -class CommodityZone { +class CommodityZones { String? productImg = ''; List? productSkuVOList = []; String? thumbnailImg = ''; @@ -45,11 +45,11 @@ class CommodityZone { String? storeId = ''; String? tenantCode = ''; - CommodityZone(); + CommodityZones(); - factory CommodityZone.fromJson(Map json) => _$CommodityZoneFromJson(json); + factory CommodityZones.fromJson(Map json) => _$CommodityZonesFromJson(json); - Map toJson() => _$CommodityZoneToJson(this); + Map toJson() => _$CommodityZonesToJson(this); } diff --git a/lib/data/home_rank.g.dart b/lib/data/home_rank.g.dart index c8ea1136..ddf6f67a 100644 --- a/lib/data/home_rank.g.dart +++ b/lib/data/home_rank.g.dart @@ -7,35 +7,34 @@ part of 'home_rank.dart'; // ************************************************************************** HomeRank _$HomeRankFromJson(Map json) => HomeRank() - ..commodityList = (json['commodityList'] as List?) - ?.map((e) => CommodityList.fromJson(e as Map)) + ..CommodityList = (json['CommodityList'] as List?) + ?.map((e) => Commoditys.fromJson(e as Map)) .toList() - ..commodityZone = (json['commodityZone'] as List?) - ?.map((e) => CommodityZone.fromJson(e as Map)) + ..CommodityZone = (json['CommodityZone'] as List?) + ?.map((e) => CommodityZones.fromJson(e as Map)) .toList() - ..commodityListImg = json['commodityListImg'] as String?; + ..CommodityListImg = json['CommodityListImg'] as String?; Map _$HomeRankToJson(HomeRank instance) => { - 'commodityList': instance.commodityList?.map((e) => e.toJson()).toList(), - 'commodityZone': instance.commodityZone?.map((e) => e.toJson()).toList(), - 'commodityListImg': instance.commodityListImg, + 'CommodityList': instance.CommodityList?.map((e) => e.toJson()).toList(), + 'CommodityZone': instance.CommodityZone?.map((e) => e.toJson()).toList(), + 'CommodityListImg': instance.CommodityListImg, }; -CommodityList _$CommodityListFromJson(Map json) => - CommodityList() - ..goodList = (json['goodList'] as List?) - ?.map((e) => GoodList.fromJson(e as Map)) - .toList() - ..typeName = json['typeName'] as String?; +Commoditys _$CommoditysFromJson(Map json) => Commoditys() + ..goodList = (json['goodList'] as List?) + ?.map((e) => GoodList.fromJson(e as Map)) + .toList() + ..typeName = json['typeName'] as String?; -Map _$CommodityListToJson(CommodityList instance) => +Map _$CommoditysToJson(Commoditys instance) => { 'goodList': instance.goodList?.map((e) => e.toJson()).toList(), 'typeName': instance.typeName, }; -CommodityZone _$CommodityZoneFromJson(Map json) => - CommodityZone() +CommodityZones _$CommodityZonesFromJson(Map json) => + CommodityZones() ..productImg = json['productImg'] as String? ..productSkuVOList = (json['productSkuVOList'] as List?) ?.map((e) => ProductSkuVOList.fromJson(e as Map)) @@ -54,7 +53,7 @@ CommodityZone _$CommodityZoneFromJson(Map json) => ..storeId = json['storeId'] as String? ..tenantCode = json['tenantCode'] as String?; -Map _$CommodityZoneToJson(CommodityZone instance) => +Map _$CommodityZonesToJson(CommodityZones instance) => { 'productImg': instance.productImg, 'productSkuVOList': diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 6c691d6d..1c1e12c3 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -176,6 +176,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { dioErrorType = onError.type; refreshController.loadFailed(); refreshController.refreshFailed(); + return BaseData>()..isSuccess = false; }); if (baseData?.isSuccess ?? false) { bannerData = baseData?.data?.records ?? []; @@ -191,7 +192,9 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { try { BaseData>? baseData = await apiService?.queryBanner({ "model": {"type": "HOME_STORE_PAGE"}, - }).catchError((onError) {}); + }).catchError((onError) { + return BaseData>()..isSuccess = false; + }); if (baseData?.isSuccess ?? false) { activityBannerData = baseData!.data?.records ?? []; } @@ -206,7 +209,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { _loadCount = 0; SmartDialog.dismiss(); String toastText = AppUtils.dioErrorTypeToString(dioErrorType); - if (toastText.isNotEmpty ?? false) { + if (toastText.isNotEmpty) { SmartDialog.showToast(toastText, alignment: Alignment.center); } if (refreshController.isRefresh) refreshController.refreshCompleted(); @@ -217,8 +220,9 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { ///推荐排行 queryRecommendRank() async { try { - BaseData? rank = - await apiService?.recommendRank().catchError((onError) {}); + BaseData? rank = await apiService?.recommendRank().catchError((onError) { + return BaseData()..isSuccess = false; + }); if (rank?.isSuccess ?? false) { homeRank = rank!.data; } @@ -230,15 +234,16 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { ///积分商城商品分類列表 queryGoodsCategory() async { try { - BaseData>? dataCategory = - await apiService?.goodsCategory({ + BaseData>? dataCategory = await apiService?.goodsCategory({ "current": 1, "map": {}, "model": {"pageNum": 1, "pageSize": 20, "searchKey": ""}, "order": "descending", "size": 20, "sort": "sortOrder" - }).catchError((onError) {}); + }).catchError((onError) { + return BaseData>()..isSuccess = false; + }); if ((dataCategory?.isSuccess ?? false) && (dataCategory!.data?.records?.isNotEmpty ?? false)) { gooodsCategorys.clear(); @@ -265,8 +270,10 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { "pageSize": 100, "state": 1 }; - BaseData>? pageGoods = - await apiService?.creditGoods(param).catchError((onError) {}); + BaseData>? pageGoods = await apiService?.creditGoods(param) + .catchError((onError) { + return BaseData>()..isSuccess = false; + }); if (pageGoods?.isSuccess ?? false) { goods = pageGoods?.data?.list ?? []; } @@ -283,8 +290,9 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { ///查询会员信息 queryUserBalance() async { try { - BaseData? baseData = - await apiService?.queryInfo().catchError((onError) {}); + BaseData? baseData = await apiService?.queryInfo().catchError((onError) { + return BaseData()..isSuccess = false; + }); if (baseData?.isSuccess ?? false) { userInfo = baseData!.data; mRaiseMoney = double.tryParse("${userInfo?.raiseMoney}") ?? 0; @@ -318,8 +326,9 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { ///活动弹窗 queryActivity() async { - BaseData? baseData = - await apiService?.appPopup().catchError((onError) {}); + BaseData? baseData = await apiService?.appPopup().catchError((onError) { + return BaseData()..isSuccess = false; + }); if (baseData?.isSuccess ?? false) { if (baseData!.data?.enabled ?? true) posterShowAlertDialog(baseData.data, widget.firstLoginCouponList); @@ -337,8 +346,9 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { ); }); } - BaseData? baseData = - await apiService?.wiped(memberCouponId).catchError((onError) {}); + BaseData? baseData = await apiService?.wiped(memberCouponId).catchError((onError) { + return BaseData()..isSuccess = false; + }); if (baseData?.isSuccess ?? false) { SmartDialog.showToast("核销成功", alignment: Alignment.center); } else { @@ -354,7 +364,9 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { "pageSize": 10, "searchKey": "", "state": 0 - }).catchError((onError) {}); + }).catchError((onError) { + return BaseData>()..isSuccess = false; + }); if (baseData?.isSuccess ?? false) { coupons = baseData!.data?.list ?? []; } @@ -390,81 +402,6 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { super.build(context); return Column( children: [ - // MyAppBar( - // title: "首页", - // leading: false, - // actions: [ - // Container( - // height: 24, - // alignment: Alignment.center, - // margin: EdgeInsets.only( - // right: 12.w, - // ), - // child: GestureDetector( - // onTap: () { - // Navigator.of(context).pushNamed('/router/system_msg_page').then((value) { - // setState(() { - // totalMsg = 0; - // }); - // }); - // // Navigator.of(context).pushNamed('/router/web_turntable_activity'); - // }, - // child: Container( - // height: 24, - // alignment:Alignment.center, - // child:Stack( - // children: [ - // SvgPicture.asset( - // "assets/svg/tixing.svg", - // width: 24, - // height: 24, - // ), - // if(totalMsg != 0) - // Container( - // width:36, - // alignment: Alignment.topRight, - // child:Container( - // width:22, - // height:14, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(100), - // border: Border.all( - // width: 1, - // color: Colors.white, - // style: BorderStyle.solid, - // ), - // color:Color(0xFFFF441A), - // ), - // child:RoundButton( - // text:totalMsg.toString(), - // textColor: Colors.white, - // fontWeight: MyFontWeight.regular, - // backgroup: Color(0xFFFF441A), - // fontSize:8.sp, - // radius: 100, - // ) - // ), - // ) - // ], - // ), - // ) - // ) - // ), - // Container( - // margin: EdgeInsets.only(right: 16.w), - // child: GestureDetector( - // onTap: () { - // toScan(); - // }, - // child: SvgPicture.asset( - // "assets/svg/saoyisao.svg", - // width: 24, - // height: 24, - // ), - // ), - // ), - // ], - // ), Expanded( child: Container( child: SmartRefresher( @@ -505,10 +442,10 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { if (coupons.length != 0) DiscountZone(coupons), ///特惠专区-推荐商品展示 - if (homeRank?.commodityZone?.isNotEmpty ?? false) + if (homeRank?.CommodityZone?.isNotEmpty ?? false) HomeRecommendGoods(homeRank), - if (homeRank?.commodityZone?.isEmpty ?? true) + if (homeRank?.CommodityZone?.isEmpty ?? true) SizedBox( height: 20.h, ), @@ -521,7 +458,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { WelfareCore(), ///吃喝玩商品热销榜 - if (homeRank?.commodityList?.isNotEmpty ?? false) + if (homeRank?.CommodityList?.isNotEmpty ?? false) TopSellingList(homeRank), // ///店铺推荐 @@ -558,7 +495,8 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { }, ), ], - )), + ), + ), ), ), ), @@ -595,13 +533,12 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { onTap: () { bannerClick(bannerData[position]); }, - child: Container( - child: MImage( - bannerData[position].imgUrl ?? "", - fit: BoxFit.cover, - errorSrc: "assets/image/default_2_1.webp", - fadeSrc: "assets/image/default_2_1.webp", - ), + child: MImage( + bannerData[position].imgUrl ?? "", + fit: BoxFit.cover, + aspectRatio: 1.25, + errorSrc: "assets/image/default_2_1.webp", + fadeSrc: "assets/image/default_2_1.webp", ), ); }, diff --git a/lib/home/home_view/home_recommend_goods.dart b/lib/home/home_view/home_recommend_goods.dart index 7f2bbb22..3b5e6bde 100644 --- a/lib/home/home_view/home_recommend_goods.dart +++ b/lib/home/home_view/home_recommend_goods.dart @@ -44,32 +44,31 @@ class _HomeRecommendGoods extends State { child: ListView.builder( scrollDirection: Axis.horizontal, physics: BouncingScrollPhysics(), - itemCount: widget.homeRank?.commodityZone?.length ?? 0, + itemCount: widget.homeRank?.CommodityZone?.length ?? 0, itemBuilder: (context, position) { return GestureDetector( onTap: () { - String storeId = widget.homeRank!.commodityZone![position].storeId ?? ""; + String storeId = widget.homeRank!.CommodityZone![position].storeId ?? ""; miniLogin(apiService!, storeId, (token) { Navigator.of(context).pushNamed( '/router/store_order', arguments: { - "id": widget.homeRank!.commodityZone![position].storeId, - "tenant": widget.homeRank!.commodityZone![position].tenantCode, + "id": widget.homeRank!.CommodityZone![position].storeId, + "tenant": widget.homeRank!.CommodityZone![position].tenantCode, "storeName": "", "miniToken": token, }, ); }); }, - child: - recommendGoodsItem(widget.homeRank!.commodityZone![position]), + child: recommendGoodsItem(widget.homeRank!.CommodityZone![position]), ); }, ), ); } - Widget recommendGoodsItem(CommodityZone commodityZone) { + Widget recommendGoodsItem(CommodityZones commodityZone) { return Container( width: 158.w, margin: EdgeInsets.only( diff --git a/lib/home/home_view/top_selling_list.dart b/lib/home/home_view/top_selling_list.dart index 69aedf12..53ca1a2f 100644 --- a/lib/home/home_view/top_selling_list.dart +++ b/lib/home/home_view/top_selling_list.dart @@ -37,7 +37,7 @@ class _TopSellingList extends State { decoration: BoxDecoration( borderRadius: BorderRadius.circular(6), image: DecorationImage( - image: NetworkImage(widget.homeRank?.commodityListImg ?? ""), + image: NetworkImage(widget.homeRank?.CommodityListImg ?? ""), fit: BoxFit.cover, ), ), @@ -70,12 +70,12 @@ class _TopSellingList extends State { child: ListView.builder( scrollDirection: Axis.horizontal, physics: BouncingScrollPhysics(), - itemCount: widget.homeRank?.commodityList?.length ?? 0, + itemCount: widget.homeRank?.CommodityList?.length ?? 0, itemBuilder: (context, position) { return GestureDetector( onTap: () {}, child: hotSaleItem( - widget.homeRank!.commodityList![position], position), + widget.homeRank!.CommodityList![position], position), ); }, ), @@ -85,9 +85,8 @@ class _TopSellingList extends State { ); } - Widget hotSaleItem(CommodityList commodityList, index) { - int itemLength = - (widget.homeRank?.commodityList?[index].goodList?.length ?? 0); + Widget hotSaleItem(Commoditys commodityList, index) { + int itemLength = (widget.homeRank?.CommodityList?[index].goodList?.length ?? 0); return Container( width: 290.w, decoration: BoxDecoration( @@ -121,15 +120,15 @@ class _TopSellingList extends State { itemBuilder: (context, position) { return GestureDetector( onTap: () { - String storeId = widget.homeRank!.commodityList![index] + String storeId = widget.homeRank!.CommodityList![index] .goodList![position].storeId ?? ""; miniLogin(apiService!, storeId, (token) { Navigator.of(context).pushNamed( '/router/store_order', arguments: { - "id": widget.homeRank!.commodityList![index] + "id": widget.homeRank!.CommodityList![index] .goodList![position].storeId, - "tenant": widget.homeRank!.commodityList![index] + "tenant": widget.homeRank!.CommodityList![index] .goodList![position].tenantCode, "storeName": "", "miniToken": token, @@ -137,10 +136,7 @@ class _TopSellingList extends State { ); }); }, - child: rankingItem( - widget - .homeRank!.commodityList![index].goodList![position], - position), + child: rankingItem(widget.homeRank!.CommodityList![index].goodList![position], position), ); }, ), diff --git a/lib/home/home_view/union_entry.dart b/lib/home/home_view/union_entry.dart index 3a268a22..bde90cfb 100644 --- a/lib/home/home_view/union_entry.dart +++ b/lib/home/home_view/union_entry.dart @@ -27,7 +27,6 @@ class _UnionEntry extends State { @override Widget build(BuildContext context) { return Container( - height: 120.h, width: double.infinity, margin: EdgeInsets.only( top: 14.h, @@ -35,140 +34,151 @@ class _UnionEntry extends State { right: 9.w, left: 9.w, ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: GestureDetector( - onTap: () { - widget.goToOrder(1); - }, - child: Container( - margin: EdgeInsets.symmetric(horizontal: 5), - decoration: BoxDecoration( - color: Color(0xFFFFFFFF), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - borderRadius: BorderRadius.circular(6.r), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset( - "assets/image/home_chi.webp", - fit: BoxFit.fill, - width: 53.w, - height: 52.h, - ), - SizedBox(height: 8.h), - Text( - S.of(context).chijiankang, - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 15.sp, - color: Color(0xFF0D0D0D), - ), + child: IntrinsicHeight( + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: GestureDetector( + onTap: () { + widget.goToOrder(1); + }, + child: Container( + margin: EdgeInsets.symmetric(horizontal: 5), + decoration: BoxDecoration( + color: Color(0xFFFFFFFF), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(6.r), + ), + child: AspectRatio( + aspectRatio: 1, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + "assets/image/home_chi.webp", + fit: BoxFit.fill, + width: 53.w, + height: 52.h, + ), + SizedBox(height: 8.h), + Text( + S.of(context).chijiankang, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 15.sp, + color: Color(0xFF0D0D0D), + ), + ), + ], ), - ], + ), ), ), ), - ), - Expanded( - child: GestureDetector( - onTap: () { - widget.goToOrder(2); - }, - child: Container( - margin: EdgeInsets.symmetric(horizontal: 5), - decoration: BoxDecoration( - color: Color(0xFFFFFFFF), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - borderRadius: BorderRadius.circular(6.r), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset( - "assets/image/home_he.webp", - fit: BoxFit.fill, - width: 36.w, - height: 56.h, + Expanded( + child: GestureDetector( + onTap: () { + widget.goToOrder(2); + }, + child: Container( + margin: EdgeInsets.symmetric(horizontal: 5), + decoration: BoxDecoration( + color: Color(0xFFFFFFFF), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(6.r), + ), + child: AspectRatio( + aspectRatio: 1, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + "assets/image/home_he.webp", + fit: BoxFit.fill, + width: 36.w, + height: 56.h, + ), + SizedBox(height: 8.h), + Text( + S.of(context).hejiankang, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 15.sp, + color: Color(0xFF0D0D0D), + ), + ), + ], ), - SizedBox(height: 8.h), - Text( - S.of(context).hejiankang, - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 15.sp, - color: Color(0xFF0D0D0D), - ), - ), - ], + ), ), ), ), - ), - Expanded( - child: GestureDetector( - onTap: () { - widget.goToOrder(3); - }, - child: Container( - margin: EdgeInsets.symmetric(horizontal: 5), - decoration: BoxDecoration( - color: Color(0xFFFFFFFF), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ), - ], - borderRadius: BorderRadius.circular(6.r), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset( - "assets/image/home_wan.webp", - fit: BoxFit.fill, - width: 58.w, - height: 52.h, - ), - SizedBox(height: 8.h), - Text( - S.of(context).wanjiankang, - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 15.sp, - color: Color(0xFF0D0D0D), + Expanded( + child: GestureDetector( + onTap: () { + widget.goToOrder(3); + }, + child: Container( + margin: EdgeInsets.symmetric(horizontal: 5), + decoration: BoxDecoration( + color: Color(0xFFFFFFFF), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, ), + ], + borderRadius: BorderRadius.circular(6.r), + ), + child: AspectRatio( + aspectRatio: 1, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + "assets/image/home_wan.webp", + fit: BoxFit.fill, + width: 58.w, + height: 52.h, + ), + SizedBox(height: 8.h), + Text( + S.of(context).wanjiankang, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 15.sp, + color: Color(0xFF0D0D0D), + ), + ), + ], ), - ], + ), ), ), ), - ), - ], + ], + ), ), ); } diff --git a/lib/im/chat_details_page.dart b/lib/im/chat_details_page.dart index 5b830a8c..18093ab5 100644 --- a/lib/im/chat_details_page.dart +++ b/lib/im/chat_details_page.dart @@ -902,7 +902,6 @@ class _ChatDetailsPage extends State showMessageMenu(context, _buttonKey, messages[position]); }, onTap: () { - debugPrint("imageUrl: ${imageUrl}"); if (imageUrl.contains(messages[position].attach)) { ImagePickers.previewImages(imageUrl, imageUrl.indexOf(messages[position].attach)); } diff --git a/lib/im/im_view/im_page.dart b/lib/im/im_view/im_page.dart index b61b58b8..5f9a14f9 100644 --- a/lib/im/im_view/im_page.dart +++ b/lib/im/im_view/im_page.dart @@ -435,7 +435,7 @@ class _IMPage extends State implements OnChatMessage { }, child: Container( margin: EdgeInsets.fromLTRB(16.w, 0, 16.w, 16.h), - padding: EdgeInsets.symmetric(vertical: 13.h), + padding: EdgeInsets.symmetric(vertical: 10.h), decoration: BoxDecoration( color: Color(0xFFFDFCFC), borderRadius: BorderRadius.circular(4), @@ -460,7 +460,8 @@ class _IMPage extends State implements OnChatMessage { ), ), ], - )), + ), + ), ); } diff --git a/lib/mine/mine_vip/mine_vip_core.dart b/lib/mine/mine_vip/mine_vip_core.dart index 1776db0e..7712f4c3 100644 --- a/lib/mine/mine_vip/mine_vip_core.dart +++ b/lib/mine/mine_vip/mine_vip_core.dart @@ -110,7 +110,7 @@ class _MineVipCore extends State { await apiService?.rankList().catchError((onError) { refreshController.refreshFailed(); refreshController.loadFailed(); - return Future.value(null); + return BaseListData()..isSuccess = false; }); if (rankData?.isSuccess ?? false) { ranks.clear(); @@ -138,7 +138,7 @@ class _MineVipCore extends State { await apiService?.benefitList().catchError((onError) { refreshController.refreshFailed(); refreshController.loadFailed(); - return Future.value(null); + return BaseListData()..isSuccess = false; }); if (baseData?.isSuccess ?? false) { setState(() { @@ -158,7 +158,7 @@ class _MineVipCore extends State { await apiService?.vipBenefit().catchError((onError) { refreshController.refreshFailed(); refreshController.loadFailed(); - return Future.value(null); + return BaseData()..isSuccess = false; }); if (baseData?.isSuccess ?? false) { setState(() { @@ -181,8 +181,9 @@ class _MineVipCore extends State { // } // } - BaseData? baseData = await apiService?.rankBuy( - {"buyType": 2, "rankId": ranks[checkIndex].id}).catchError((onError) { + BaseData? baseData = await apiService?.rankBuy({ + "buyType": 2, "rankId": ranks[checkIndex].id, + }).catchError((onError) { return BaseData()..isSuccess = false; }); if (baseData?.isSuccess ?? false) { @@ -248,6 +249,7 @@ class _MineVipCore extends State { SizedBox(height: 40.h), Container( child: Row( + crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: GestureDetector( @@ -278,13 +280,13 @@ class _MineVipCore extends State { ), Container( alignment: Alignment.center, - margin: EdgeInsets.only(right: 16.w), + margin: EdgeInsets.only(right: 16.w, bottom: 10.h), child: GestureDetector( onTap: () { // Navigator.of(context).pushNamed('/router/integral_detailed_page'); }, child: Text( - "${S.of(context).dangqianzhukadengji} : ${userInfo?.masterCardRankName}", + "${S.of(context).dangqianzhukadengji} : ${userInfo?.masterCardRankName ?? userInfo?.memberRankVo?.rankName ?? ""}", style: TextStyle( color: Colors.white, fontSize: 16.sp, @@ -297,320 +299,315 @@ class _MineVipCore extends State { ), ), Expanded( - child: SmartRefresher( - controller: refreshController, - enablePullDown: true, - enablePullUp: false, - header: MyHeader( - color: Colors.white, - ), - footer: CustomFooter( - builder: (context, mode) { - return MyFooter(mode); + child: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader( + color: Colors.white, + ), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + _onRefresh(); }, - ), - onRefresh: () { - _onRefresh(); - }, - physics: BouncingScrollPhysics(), - scrollController: ScrollController(), - child: SingleChildScrollView( physics: BouncingScrollPhysics(), - child: Column( - children: [ - ///会员卡 - if (ranks.length > 0) - Container( - height: (MediaQuery.of(context).size.width) / - 1.78 * - AppUtils.textScale(context), - child: Swiper( - viewportFraction: 0.95, - loop: false, - physics: BouncingScrollPhysics(), - index: checkIndex, - controller: controller, - onIndexChanged: (index) { - setState(() { - checkIndex = index; - }); - }, - itemBuilder: (context, position) { - return vipCar(position); - // MineVipView( - // vipLevel: !(ranks != null && ranks.isNotEmpty) - // ? widget.arguments["rankLevel"] - // : position + 1, - // curLevel: widget.arguments["rankLevel"], - // tag: (widget.arguments["rankLevel"] == (position + 1) || - // !(ranks != null && ranks.isNotEmpty)) - // ? "vip" - // : "", - // padding: 6.w, - // // rank: !(ranks != null && ranks.isNotEmpty) - // // ? 0 - // // : widget.arguments["expendAmount"] ?? 0, - // rankMax: !(ranks != null && ranks.isNotEmpty) - // ? 0 - // : ranks[position].rankOrigin, - // createTime: widget.arguments["createTime"], - // showRank: false, - // price: !(ranks != null && ranks.isNotEmpty) - // ? "0" - // : ranks[position].price, - // ); - }, - itemCount: (ranks.isNotEmpty) ? ranks.length : 1, + scrollController: ScrollController(), + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + ///会员卡 + if (ranks.length > 0) + Container( + height: (MediaQuery.of(context).size.width) / + 1.78 * + AppUtils.textScale(context), + child: Swiper( + viewportFraction: 0.95, + loop: false, + physics: BouncingScrollPhysics(), + index: checkIndex, + controller: controller, + onIndexChanged: (index) { + setState(() { + checkIndex = index; + }); + }, + itemBuilder: (context, position) { + return vipCar(position); + // MineVipView( + // vipLevel: !(ranks != null && ranks.isNotEmpty) + // ? widget.arguments["rankLevel"] + // : position + 1, + // curLevel: widget.arguments["rankLevel"], + // tag: (widget.arguments["rankLevel"] == (position + 1) || + // !(ranks != null && ranks.isNotEmpty)) + // ? "vip" + // : "", + // padding: 6.w, + // // rank: !(ranks != null && ranks.isNotEmpty) + // // ? 0 + // // : widget.arguments["expendAmount"] ?? 0, + // rankMax: !(ranks != null && ranks.isNotEmpty) + // ? 0 + // : ranks[position].rankOrigin, + // createTime: widget.arguments["createTime"], + // showRank: false, + // price: !(ranks != null && ranks.isNotEmpty) + // ? "0" + // : ranks[position].price, + // ); + }, + itemCount: (ranks.isNotEmpty) ? ranks.length : 1, + ), ), - ), - - ///会员权益 - Container( - margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), - padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - topRight: Radius.circular(8), + ///会员权益 + Container( + margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), ), - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - width: 4.w, - height: 18.h, - decoration: BoxDecoration( - gradient: new LinearGradient( - begin: Alignment.bottomCenter, - end: Alignment.topCenter, - colors: [ - Color(0xFF000000), - Color(0xFF585858), - ], + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + width: 4.w, + height: 18.h, + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.bottomCenter, + end: Alignment.topCenter, + colors: [ + Color(0xFF000000), + Color(0xFF585858), + ], + ), ), ), - ), - SizedBox( - width: 4.w, - ), - Text( - S.of(context).huiyuanquanyi, - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 16.sp, - color: Colors.black, + SizedBox( + width: 4.w, ), - ), - ], - ), - SizedBox( - height: 12.h, - ), - vipLegalRight(), - ], - ), - ), - - ///会员规则说明 - Container( - margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), - padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - topRight: Radius.circular(8), - ), - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - width: 4.w, - height: 18.h, - decoration: BoxDecoration( - gradient: new LinearGradient( - begin: Alignment.bottomCenter, - end: Alignment.topCenter, - colors: [ - Color(0xFF000000), - Color(0xFF585858), - ], + Text( + S.of(context).huiyuanquanyi, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 16.sp, + color: Colors.black, ), ), - ), - SizedBox( - width: 4.w, - ), - Text( - S.of(context).huiyuanguize, - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 16.sp, - color: Colors.black, - ), - ), - ], - ), - SizedBox( - height: 12.h, - ), - if (vipRuleDetails?.qa?.isNotEmpty ?? false) - Container( - color: Colors.white, - padding: EdgeInsets.only(left: 8.w), - child: Html( - data: vipRuleDetails?.qa ?? "", - ), + ], ), - ], - ), - ), - - ///会员级别对照表 - Container( - margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), - padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - topRight: Radius.circular(8), + SizedBox( + height: 12.h, + ), + vipLegalRight(), + ], ), ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - width: 4.w, - height: 18.h, - decoration: BoxDecoration( - gradient: new LinearGradient( - begin: Alignment.bottomCenter, - end: Alignment.topCenter, - colors: [ - Color(0xFF000000), - Color(0xFF585858), - ], + ///会员规则说明 + Container( + margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + width: 4.w, + height: 18.h, + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.bottomCenter, + end: Alignment.topCenter, + colors: [ + Color(0xFF000000), + Color(0xFF585858), + ], + ), ), ), - ), - SizedBox( - width: 4.w, - ), - Text( - S.of(context).huiyuanjibieduizhao, - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 16.sp, - color: Colors.black, + SizedBox( + width: 4.w, + ), + Text( + S.of(context).huiyuanguize, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 16.sp, + color: Colors.black, + ), + ), + ], + ), + SizedBox( + height: 12.h, + ), + if (vipRuleDetails?.qa?.isNotEmpty ?? false) + Container( + color: Colors.white, + padding: EdgeInsets.only(left: 8.w), + child: Html( + data: vipRuleDetails?.qa ?? "", ), ), - ], - ), - SizedBox( - height: 12.h, - ), - MImage( - vipRuleDetails?.contrast ?? "", - width: double.infinity, - height: 281.h, - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ), - SizedBox( - height: 16.h, - ), - ], - ), - ), - - ///会员如何获得积分 - Container( - margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - topRight: Radius.circular(8), + ], ), ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - padding: - EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, + ///会员级别对照表 + Container( + margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( children: [ - Row( - children: [ - Container( - width: 4.w, - height: 18.h, - decoration: BoxDecoration( - gradient: new LinearGradient( - begin: Alignment.bottomCenter, - end: Alignment.topCenter, - colors: [ - Color(0xFF000000), - Color(0xFF585858), - ], - ), - ), - ), - SizedBox( - width: 4.w, + Container( + width: 4.w, + height: 18.h, + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.bottomCenter, + end: Alignment.topCenter, + colors: [ + Color(0xFF000000), + Color(0xFF585858), + ], ), - Text( - S.of(context).huiyuanhuodejifen, - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 16.sp, - color: Colors.black, - ), - ), - ], + ), ), SizedBox( - height: 12.h, + width: 4.w, ), - if (vipRuleDetails?.rule?.isNotEmpty ?? false) - Container( - color: Colors.white, - child: Html( - data: vipRuleDetails?.rule ?? "", - ), + Text( + S.of(context).huiyuanjibieduizhao, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 16.sp, + color: Colors.black, ), + ), ], ), + SizedBox( + height: 12.h, + ), + MImage( + vipRuleDetails?.contrast ?? "", + width: double.infinity, + height: 281.h, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + SizedBox( + height: 16.h, + ), + ], + ), + ), + ///会员如何获得积分 + Container( + margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), ), - ], + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: + EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + width: 4.w, + height: 18.h, + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.bottomCenter, + end: Alignment.topCenter, + colors: [ + Color(0xFF000000), + Color(0xFF585858), + ], + ), + ), + ), + SizedBox( + width: 4.w, + ), + Text( + S.of(context).huiyuanhuodejifen, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 16.sp, + color: Colors.black, + ), + ), + ], + ), + SizedBox( + height: 12.h, + ), + if (vipRuleDetails?.rule?.isNotEmpty ?? false) + Container( + color: Colors.white, + child: Html( + data: vipRuleDetails?.rule ?? "", + ), + ), + ], + ), + ), + ], + ), ), - ), - ], + ], + ), ), ), - )), + ), ], ), - if (ranks.length > checkIndex && - widget.arguments["rankLevel"] < ranks[checkIndex].level && - ranks[checkIndex].price != "0.00") + if (ranks.length > checkIndex && widget.arguments["rankLevel"] < ranks[checkIndex].level && ranks[checkIndex].price != "0.00") Align( alignment: Alignment.bottomCenter, child: InkWell( @@ -651,11 +648,9 @@ class _MineVipCore extends State { Widget vipCar(int position) { return Container( - margin: EdgeInsets.fromLTRB(16.w, 16.h, 8.w, 8.h), - width: MediaQuery.of(context).size.width - 32.w, - height: ((MediaQuery.of(context).size.width - 32.w) / - 2.11 * - AppUtils.textScale(context)), + margin: EdgeInsets.fromLTRB(12.w, 8.h, 12.w, 8.h), + width: MediaQuery.of(context).size.width - 24.w, + height: ((MediaQuery.of(context).size.width - 16.w) / 2.11 * AppUtils.textScale(context)), decoration: BoxDecoration( gradient: LinearGradient( colors: [ @@ -678,14 +673,13 @@ class _MineVipCore extends State { ], ), child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - height: 86.w, + height: 86, child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, @@ -718,10 +712,7 @@ class _MineVipCore extends State { child: Text( "VIP ${ranks[position].rankName ?? ""}", style: TextStyle( - color: Color(int.parse( - (ranks[position].textColor ?? "") - .replaceAll("#", "FF"), - radix: 16)), + color: Color(int.parse((ranks[position].textColor ?? "").replaceAll("#", "FF"), radix: 16)), fontWeight: MyFontWeight.semi_bold, fontSize: 22.sp, ), @@ -731,11 +722,11 @@ class _MineVipCore extends State { ), ), Container( - margin: EdgeInsets.only(right: 11.w, bottom: 9.h), + margin: EdgeInsets.only(right: 11.w, bottom: 9), child: Image.asset( "assets/image/icon_mine_huixiang_logo.webp", - width: 86.w, - height: 86.w, + width: 86, + height: 86, fit: BoxFit.contain, ), ), @@ -749,151 +740,123 @@ class _MineVipCore extends State { bottom: 12.h, ), child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - if (userInfo?.memberRankVo?.rankName != - ranks[position].rankName || - (userInfo?.memberRankVo?.rankName == "共创会员" && - ranks[position].rankName == "共创会员")) + if (userInfo?.memberRankVo?.rankName != ranks[position].rankName || (userInfo?.memberRankVo?.rankName == "共创会员" && ranks[position].rankName == "共创会员")) Align( alignment: Alignment.centerRight, child: Text( - (ranks[position].rankName == "共创会员") - ? (userInfo?.memberRankVo?.rankName == "共创会员" - ? "永久VIP" - : "¥${AppUtils.calculateDouble(double.tryParse("${ranks[position].price}") ?? 0)}/永久") + (ranks[position].rankName == "共创会员") ? (userInfo?.memberRankVo?.rankName == "共创会员" ? "永久VIP" + : "¥${AppUtils.calculateDouble(double.tryParse("${ranks[position].price}") ?? 0)}/永久") : (ranks[position].originScore ?? 0).toString(), overflow: TextOverflow.ellipsis, style: TextStyle( - color: Color(int.parse( - (ranks[position].textColor ?? "") - .replaceAll("#", "FF"), - radix: 16)), - fontWeight: ranks[position].rankName == "共创会员" - ? MyFontWeight.regular - : MyFontWeight.bold, - fontSize: ranks[position].rankName == "共创会员" - ? 14.sp - : 20.sp, + color: Color(int.parse((ranks[position].textColor ?? "").replaceAll("#", "FF"), radix: 16)), + fontWeight: ranks[position].rankName == "共创会员" ? MyFontWeight.regular : MyFontWeight.bold, + fontSize: ranks[position].rankName == "共创会员" ? 14.sp : 20.sp, ), ), ), - if (userInfo?.memberRankVo?.rankName == - ranks[position].rankName && - (userInfo?.memberRankVo?.rankName != "共创会员" && - ranks[position].rankName != "共创会员")) - Padding( - padding: EdgeInsets.only(bottom: 12.h), - child: Row( - children: [ - Expanded( - child: Text( - "消费满 ¥${userInfo?.memberRankVo?.nextOrigin ?? "0"} 升级为 ${userInfo?.memberRankVo?.nextName ?? ""}", - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Color(int.parse( - (ranks[position].textColor ?? "") - .replaceAll("#", "FF"), - radix: 16)), - fontWeight: MyFontWeight.regular, - fontSize: 14.sp, + if (userInfo?.memberRankVo?.rankName == ranks[position].rankName && (userInfo?.memberRankVo?.rankName != "共创会员" && ranks[position].rankName != "共创会员")) ... [ + Padding( + padding: EdgeInsets.only(bottom: 8), + child: Row( + children: [ + Expanded( + child: Text( + "消费满 ¥${userInfo?.memberRankVo?.nextOrigin ?? "0"} 升级为 ${userInfo?.memberRankVo?.nextName ?? ""}", + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Color(int.parse( + (ranks[position].textColor ?? "") + .replaceAll("#", "FF"), + radix: 16)), + fontWeight: MyFontWeight.regular, + fontSize: 14.sp, + ), ), ), - ), - Text.rich( - TextSpan( - children: [ - TextSpan( - text: - "${AppUtils.calculateDouble(double.tryParse("${userInfo?.expendAmount}") ?? 0)}", - style: TextStyle( - fontSize: 24.sp, - fontWeight: MyFontWeight.medium, - color: Color(int.parse( - (ranks[position].textColor ?? "") - .replaceAll("#", "FF"), - radix: 16)), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: + "${AppUtils.calculateDouble(double.tryParse("${userInfo?.expendAmount}") ?? 0)}", + style: TextStyle( + fontSize: 24.sp, + fontWeight: MyFontWeight.medium, + color: Color(int.parse( + (ranks[position].textColor ?? "") + .replaceAll("#", "FF"), + radix: 16)), + ), ), - ), - TextSpan( - text: - "/${userInfo?.memberRankVo?.nextOrigin ?? "0"}", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - color: Color(int.parse( - (ranks[position].textColor ?? "") - .replaceAll("#", "FF"), - radix: 16)), + TextSpan( + text: + "/${userInfo?.memberRankVo?.nextOrigin ?? "0"}", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(int.parse( + (ranks[position].textColor ?? "") + .replaceAll("#", "FF"), + radix: 16)), + ), ), - ), - ], + ], + ), ), - ), - ], + ], + ), ), - ), - if (userInfo?.memberRankVo?.rankName == - ranks[position].rankName && - (userInfo?.memberRankVo?.rankName != "共创会员" && - ranks[position].rankName != "共创会员")) - Container( - height: 8.h, - child: ClipRRect( - borderRadius: BorderRadius.circular(6.5), - child: LinearProgressIndicator( - value: (userInfo?.memberRankVo?.nextOrigin ?? 0) > - ((double.tryParse( - "${userInfo?.expendAmount}") ?? - 0) - .toInt()) - ? ((checkIndex < (rankNameIndex ?? 0)) - ? (userInfo?.memberRankVo?.nextOrigin ?? 0) / - (userInfo?.memberRankVo?.nextOrigin ?? 0) - : ((double.tryParse( - "${userInfo?.expendAmount}") ?? - 0) - .toInt()) / - (userInfo?.memberRankVo?.nextOrigin ?? 0)) - : 0, - backgroundColor: Colors.white, - color: AppUtils.getLighterColor( - ranks[position].color ?? ""), + Container( + height: 8, + child: ClipRRect( + borderRadius: BorderRadius.circular(6.5), + child: LinearProgressIndicator( + value: (userInfo?.memberRankVo?.nextOrigin ?? 0) > + ((double.tryParse( + "${userInfo?.expendAmount}") ?? + 0) + .toInt()) + ? ((checkIndex < (rankNameIndex ?? 0)) + ? (userInfo?.memberRankVo?.nextOrigin ?? 0) / + (userInfo?.memberRankVo?.nextOrigin ?? 0) + : ((double.tryParse( + "${userInfo?.expendAmount}") ?? + 0) + .toInt()) / + (userInfo?.memberRankVo?.nextOrigin ?? 0)) + : 0, + backgroundColor: Colors.white, + color: AppUtils.getLighterColor( + ranks[position].color ?? ""), + ), ), ), - ), - Row( + ], + Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Text( - S.of(context).kaitongriqi( - (widget.arguments["createTime"] != null && - widget.arguments["createTime"] != "") - ? widget.arguments["createTime"].split(" ")[0] - : widget.arguments["createTime"]), + S.of(context).kaitongriqi((widget.arguments["createTime"] != null && widget.arguments["createTime"] != "") ? widget.arguments["createTime"].split(" ")[0] : widget.arguments["createTime"]), style: TextStyle( fontWeight: MyFontWeight.regular, fontSize: 12.sp, - color: Color(int.parse( - ("${ranks[position].textColor}") - .replaceAll("#", "FF"), - radix: 16))), + color: Color(int.parse(("${ranks[position].textColor}").replaceAll("#", "FF"), radix: 16)), + ), ), Icon( Icons.qr_code, size: 24, - color: Color(int.parse( - ("${ranks[position].textColor}") - .replaceAll("#", "FF"), - radix: 16)), + color: Color(int.parse(("${ranks[position].textColor}").replaceAll("#", "FF"), radix: 16)), ), ], ), ], ), ), - flex: 1, ), ], ), diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index cac95132..b8be6150 100644 --- a/lib/retrofit/min_api.g.dart +++ b/lib/retrofit/min_api.g.dart @@ -14,7 +14,7 @@ class _MinApiService implements MinApiService { this.baseUrl, this.errorLogger, }) { - baseUrl ??= 'https://pos.api.yixinhuixiang.com/app/'; + baseUrl ??= 'http://192.168.10.54:8765/app/'; } final Dio _dio; diff --git a/lib/view_widget/custom_image.dart b/lib/view_widget/custom_image.dart index e956e785..830566cc 100644 --- a/lib/view_widget/custom_image.dart +++ b/lib/view_widget/custom_image.dart @@ -16,13 +16,13 @@ class MImage extends StatelessWidget { final bool isCircle; final bool noCompress;//不压缩图片 - double scaleIndex = 2.5; + double scaleIndex = 1.5; MImage( this.src, { this.errorSrc = "assets/image/default_2_1.webp", this.fadeSrc = "assets/image/default_2_1.webp", - this.aspectRatio = 1, + this.aspectRatio = 0, this.width, this.height, this.fit = BoxFit.cover, @@ -38,57 +38,45 @@ class MImage extends StatelessWidget { double getImageWidth(context, double widgetWidth) { double width = MediaQuery.of(context).size.width; - if (widgetWidth < (width / 3)) { - return 300; - } else if (widgetWidth < (width / 2)) { + if (widgetWidth > 700) { + return width; + } else if (widgetWidth > 300) { return 700; } else { - return width; + return 300; } } - double getImageHeiget(context, double widgetHeiget) { - double height = MediaQuery.of(context).size.height; - if (widgetHeiget < (height / 3)) { - return 600; - } else if (widgetHeiget < (height / 2)) { - return 1400; + double getImageHeight(context, double widgetHeight) { + if (widgetHeight > 700) { + return 1000; + } else if (widgetHeight > 300) { + return 700; } else { - return height; + return 300; } } @override Widget build(BuildContext context) { Widget image = LayoutBuilder( - builder: (context, constraints) { + builder: (ctx, constraints) { String? imageUrl = ""; ///压缩图片 - // if (src != null && src != "" && src.startsWith("http")) { - // String oper = src.contains("?") ? "" :"?"; - // imageUrl = - // "$src$oper/imageMogr2/thumbnail/${constraints.constrainWidth() * scaleIndex}" - // "x${constraints.constrainHeight() * scaleIndex}/format/webp/quality/100"; - // } - int _w = ((constraints.constrainWidth()==double.infinity - ? MediaQuery.of(context).size.width - : getImageWidth(context, constraints.constrainWidth())) * scaleIndex).toInt(); - int _h = ((constraints.constrainHeight()==double.infinity - ? MediaQuery.of(context).size.height - : getImageHeiget(context, constraints.constrainHeight())) * scaleIndex).toInt(); + int _w = ((getImageWidth(ctx, constraints.constrainWidth())) * scaleIndex).toInt(); + int _h = ((getImageHeight(ctx, constraints.constrainHeight())) * scaleIndex).toInt(); ///压缩图片 if (src.startsWith("http")) { - if(noCompress) + if (noCompress) { imageUrl = src; - else - imageUrl = "$src?imageView2/1/w/${_w}/h/${_h}/format/jpg/q/75"; + } else { + imageUrl = "$src?imageView2/0/w/${_w}/format/jpg/q/100"; + } } - // print("imageUrl:$imageUrl"); - // print("constrainWidth: ${constraints.constrainWidth()}"); - // print("constrainHeight: ${constraints.constrainHeight()}"); + debugPrint("imageUrl: $imageUrl"); - if (imageUrl?.isEmpty ?? true) { + if (imageUrl.isEmpty) { return Image.asset( "assets/image/default_2_1.webp", fit: fit, @@ -97,7 +85,7 @@ class MImage extends StatelessWidget { Widget? cachedNetworkImage; if (src.startsWith("http")) { cachedNetworkImage = Image( - image: ResizeImage(NetworkToFileImage( + image: NetworkToFileImage( url: imageUrl, file: fileFromDocsDir("resize${(noCompress?"noCompress":"$_w$_h")}${src.replaceAll("https:", "") .replaceAll("http:", "") @@ -105,8 +93,6 @@ class MImage extends StatelessWidget { .replaceAll("/", "")}"), debug: true, ), - width: _w, - height: _h), errorBuilder: (context, error, stackTrace) { return Image.asset( errorSrc, @@ -133,7 +119,6 @@ class MImage extends StatelessWidget { ); }, ); - var clipRRect; if (isCircle) { clipRRect = ClipOval(clipBehavior: Clip.antiAlias, child: image); @@ -143,7 +128,7 @@ class MImage extends StatelessWidget { child: image, ); } - if (aspectRatio != null && aspectRatio > 0) { + if (aspectRatio > 0) { return SizedBox( width: width, height: height, diff --git a/pubspec.yaml b/pubspec.yaml index e9ae6559..b8a35a2b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -34,9 +34,9 @@ dependencies: intl: ^0.18.1 - fluwx: ^4.5.0 + fluwx: ^4.6.3 get: ^4.6.6 - tobias: ^3.3.1 + tobias: ^3.3.2 #pdf展示 flutter_pdfview: ^1.4.0 @@ -63,7 +63,7 @@ dependencies: permission_handler: ^11.3.0 - geolocator: ^7.0.0 + geolocator: ^7.7.1 # location: ^3.2.4 dio: ^5.7.0 @@ -92,7 +92,7 @@ dependencies: barcode_widget: ^2.0.4 qr_flutter: any - url_launcher: ^6.2.5 + url_launcher: ^6.3.1 #多图, 裁剪 image_pickers: 2.0.4+8 @@ -101,7 +101,7 @@ dependencies: # qrscan: ^0.3.1 scan: ^1.6.0 - path_provider: ^2.1.2 + path_provider: ^2.1.4 network_to_file_image: ^7.0.0 image_gallery_saver: ^2.0.3 @@ -137,9 +137,9 @@ dependencies: flutter_slidable: ^3.0.1 - emoji_picker_flutter: ^2.1.0 + emoji_picker_flutter: ^2.1.1 - mqtt_client: ^10.2.0 + mqtt_client: ^10.3.0 shimmer: ^3.0.0 @@ -153,16 +153,16 @@ dependencies: widgetpicker: ^0.1.1 # floor: ^1.4.2 sqflite: ^2.3.3+1 - webview_flutter: ^4.7.0 + webview_flutter: ^4.8.0 syncfusion_flutter_datepicker: ^24.2.9 protobuf: ^3.1.0 dev_dependencies: flutter_test: sdk: flutter - retrofit_generator: ^8.1.0 - build_runner: ^2.4.8 - json_serializable: ^6.7.1 + retrofit_generator: ^8.2.1 + build_runner: ^2.4.9 + json_serializable: ^6.8.0 flutter: