From 53b08b0ce3a08f9cc0fa1396b853215b52ce15be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AB=A0=E6=96=87=E8=BD=A9?= <12812285557@qq.com> Date: Tue, 23 Nov 2021 21:46:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9D=80=E6=A8=A1=E5=9D=97=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/icons/icon_address_edit.png | Bin 0 -> 1875 bytes assets/icons/icon_address_isdefault.png | Bin 0 -> 1400 bytes assets/icons/icon_address_not.png | Bin 0 -> 747 bytes lib/const/resource.dart | 16 + ...ProvinceModel.dart => province_model.dart} | 19 +- lib/model/user/province_model.g.dart | 124 ++++++ .../personal/address/address_list_page.dart | 32 +- .../personal/address/address_selector.dart | 57 +-- lib/pages/personal/address/editView.dart | 7 +- .../personal/address/new_address_page.dart | 387 +++++++++++------- lib/pages/personal/item_my_address.dart | 171 +++++--- lib/pages/personal/user_func.dart | 65 ++- lib/pages/splash/splash_page.dart | 20 +- lib/pages/tab_navigator.dart | 21 + lib/provider/app_provider.dart | 1 - lib/utils/hive_store.dart | 17 +- pubspec.lock | 14 + pubspec.yaml | 1 + 18 files changed, 677 insertions(+), 275 deletions(-) create mode 100644 assets/icons/icon_address_edit.png create mode 100644 assets/icons/icon_address_isdefault.png create mode 100644 assets/icons/icon_address_not.png rename lib/model/user/{ProvinceModel.dart => province_model.dart} (80%) create mode 100644 lib/model/user/province_model.g.dart diff --git a/assets/icons/icon_address_edit.png b/assets/icons/icon_address_edit.png new file mode 100644 index 0000000000000000000000000000000000000000..19cf4c9886881bd0052c2d6e46c2c200edcb38ae GIT binary patch literal 1875 zcmYjS2{4;^9F40q>Z<$LqA777RinC^MoS~sP1F^HxaqXYIvN$UQgPGUZQ50~l-la0 zN=ZW}uIegVTUS+G)gTd9?0@H*`Nn@H?|Z-Z-tQ%u`Okb=E>1WJqzV#&KuF;2Y}~-p z?*EUN5Wpa_Gx6XdaLEmK8qv_FHitk6UUzZuumvJGySuwoDwRMW)Ya8tu~@*(%*;YV zLxFBX9u*2M33Rg@uHK02d-40J&fUE{H)2Krn(N(18dL#J~tRBmx&w zKoYnRLN4GS1G&%&;7}U~01ghUL;a8ri%=hvn z5H#$~fN^gOjNtD;85s8xz@Y=hAP(2UBisqaAOs@31rul&vcM06lW-OMb-;y1xC&l} zTzCXM;M#!e0d9_Unr$$+h#%tIoZJxt0)j$9!ongV`$WaW_U}iEiyx4Xl#-T_m6MlO zP*7A-QdU+`QB^yni8`XCjn>mQFf=m8V6oOXI|oN+XBSsDcMk%=)6<*i9~>SL85NU| zn3$B5oP3#*l5*whwQHF)8a+EZCnq<*ps=v0sJQsX-FqdaWo6|Rb#;F}s&8m`{J63C z`ODVVZEbJb-*$F(F&OWd-S1hwgCB~ zvf1pFmDN=am%Gm6ZES3AZf$LE@9gmTeCe&p8U#Y91aD*Q;nlfxXWd=aT8=3tdnw&? zpMGz;Mo@e&n9SD2a*Xjz<-i`834&mhNkXoHT8d|cscDLEnlkN)Z+2W&#-2Xl-9S{`982nLUX07 z`bVY_eIIX|w|K2NV=nZUb)zf0td=TI4xVtmlApMmS!+Xy_2w%dU!PzqMDdK&!zEGQ zIz1OoY@kO2Tz6RP&*_5(ZkXtygB({)-GPJGrcj4g5^}4ADOV}&`i8c;3D_ELuSpFd zU}Hhl-cNnps(bde=X2K(lvCFB(^*Tt6xDArJ{dX8@ytF?pydjpcYN%dntYYSm}_if zYH7(WAHj^gj(ML?jD?Nyu?Lfhm}$DDxO%q7XJx7neK(0_xpC!sKh18d@~G-RVnUl` zu`GTXW&Y{O&i9X&b+l6S9J_D}$4%BGOMmV3Z>4O<7xYIJ<_E1?klOEHWjW6Gr>VYf zG?Rg(fnO3*Tb9*JzAK^D@Ql^{-MEFQyVKMITq%?Lx<7|&B^w_5xDw-#EYaKf0c~cO zp5%j=FSbrRouF4FVr^o)$k((lTev))(vazvG&>2^N6X1Ko*H@>|F%Y7wmAPqs?Dks zQ&~p+-u+YzeWj35#UI55bEW(O;;SigJth?mj&~?XjfzbFP0@N|2Mh)sNQ|H2$V;tv zN;+WX)o44TX;SBRU77=sY(3BIh7y88~&9`Sy87t0YY%&Y-Qhs=ONGQ3~{mu$I znXy@O%9b2AI;2_Q)fINC!}6g8N`-A2#Lag{c_XKat>cVjRR>j-iguW_g$DcBJ!_SI zM`N9jYGBB-j?IINv|$RjofE>+;8>rv_``vUMCMtn7P=SZV2E#!@ef)hHq|uxM3qgc zGX)dx9Q$ws=_>7O(gQVkcGYP;ej|4(rzh6F$n(}YOw(Kh!$``$`fSwVF+<*|B*Td+ zH~XSGG|rJUYM!O1|8a!UYR^k;*LqLZ<33Sw3{_U_a(bd7LU=LJ<(d1etn#pbV-d&d oZQHJp`H+^q?8v(Ifpe(>gCkU$_GP`U|6hlATPK@_(}C�e>J+6aWAK literal 0 HcmV?d00001 diff --git a/assets/icons/icon_address_isdefault.png b/assets/icons/icon_address_isdefault.png new file mode 100644 index 0000000000000000000000000000000000000000..3382a10b25c5b0027438608edbb3e3ae287ef579 GIT binary patch literal 1400 zcmeAS@N?(olHy`uVBq!ia0vp^5g^RL3?$vW53m6##^NA%Cx&(BWL^Tb3?=D z`uaeT7skdffm{OvAorz#!AnEKr$Dx$;R`V1nSsGGeSIK$4pgbH|5Q&8#5OQ^3S4XvHMeUm0nnLcawyp^lhtX;oh)2;)Dj-I-7^~T-%4$-SNnwl1EO!)Hq zzx@-thU;f9O)7Z4XX8v;&fUi8>FHClx-Z-)(n=Qf+V=Ry(x$1Ny8W#o$7guN>6w4l-;G^qV&jV^f5Lt}d-{E| zxzfLi@Y7poPQCLjWctr7*;&@%D3Vi|7JVz+ctzpLvG~UC4|lz+Jh1Zq_Ia|qCnnsow*6}Tf}!&BRCb2a zI?N_Aan9xpCQtjPG|o|sX0=(6(2>BW@xSdGTR`D#m-!!C(vzcDZ~WN) z-SxqRy?m@Tiyp-FDlho)SikVW<%Dvf0_~8!O%(mo0cy_1?~I!~0oPOn0t+ zl6`QyG*9mVw_d&6PqtN-m*fgwcWtk(Kk|K@#2(gfQ-Zui8%_USw6fc{?tC0`mzSm} zvsP8yrQmPgG1o*_u4g)ub?G5jpKML?ah^#nL9e84Tw}fR%|GXL(oWtOZP6;`Wm`U~ zG9`E_&tSUel*LnVvG$J<$H!K=Sp5StqS*3E;(v2E{aILjhj+u8paUDtteh2mq%&Q- zQX718O(c6PRtDxUNv1Lu-+B>g@W{9~Np3?3;|vqNl?)g7mv}B%;MJgaZE3<0)!4U< zlQuOn=3e1*%gGjDZdfbhaNd4y!jZmtyv%(v8*c=4HT{MQ#0n(S-1P~3Xf5x(G^kKj0PQ_k&dWtKlRbb~O-_=Q%mqzC7`VyFv6)QK}bKc)6$IneN{&y<5h}CxKKaQyi zPrH^SrN-?%v?WF}cEgYVx7S&GxwOt=%~tI;+pRNOq;!gO6%VR~#om5fQT%TCTeIzz wcRX+Vt_#$-acj-nPx%rAb6VR9M5cnQLq6KoExa|No`ONJ6xN1~GzY6^q2G5D^4pQZHoAhj?nMSTEUm zzb5;T?95)~9V7R(jVHaJQS%(ft2Kh&B;GzS$lQ6JM4`)-+%QVYfYWiEo2rk~7r~1b zchp)u56(Z&AM3RT)72*1=lMR{tfqsucmC|p{5kO4KaH$*qRsW=P1LELUhwBnfRmsY zR0(FsTfcgo1(o8hAbAj+j~oD;e)@Od)BfqjQT_-xYZh}b+}%&s-LROEW_BMO7irtc zyr9ItoDFjkx3@2ONndXl5j=xq0RKg<$d?ZgUxPCja1(i1i3_;dB{**a z&RR-n?EuaE0z3kUq?96n(Qk0#0HKsr2sp_vZ~*v+vfzUc1V6!ZfTfhy5@3D?=RVL8 z3+e!V{tf;Fs+kRNRs}x4!F6CLRx||a|G^8u+1UZ_9AI$*w}8G_QXgm);1sB&w!mox zNJWgu_?&z;6aZrpQ-p424?HWvXCwitM|51EzMtQ=n%8U}YD)0s_;pofJh{G)xW1 z?1D3(W;|eT7rX~N;{dr`a1J=^dtO z$G_TzMeT~EcPUi6#;RSs^-2Y`;zq9=Q!60VN?yGpUC&lfGeY#N8#S{@&mPk=^z? cityList; ProvinceModel({this.id, this.name, this.cityList}); @@ -28,9 +36,13 @@ class ProvinceModel { } } +@HiveType(typeId: 1) class City { + @HiveField(0) int? id; + @HiveField(1) String? name; + @HiveField(2) List? districts; City({this.id, this.name, this.districts}); @@ -38,8 +50,8 @@ class City { City.fromJson(Map json) { id = json['id']; name = json['name']; - if (json['districts'] != null) { - districts = (json['districts'] as List).map((e) => District.fromJson(e)).toList(); + if (json['cityList'] != null) { + districts = (json['cityList'] as List).map((e) => District.fromJson(e)).toList(); }else districts = []; @@ -56,8 +68,11 @@ class City { } } +@HiveType(typeId: 2) class District { + @HiveField(0) int? id; + @HiveField(1) String? name; District({this.id, this.name}); diff --git a/lib/model/user/province_model.g.dart b/lib/model/user/province_model.g.dart new file mode 100644 index 00000000..64836f1f --- /dev/null +++ b/lib/model/user/province_model.g.dart @@ -0,0 +1,124 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'province_model.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class ProvinceModelAdapter extends TypeAdapter { + @override + final int typeId = 0; + + @override + ProvinceModel read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return ProvinceModel( + id: fields[0] as int?, + name: fields[1] as String?, + cityList: (fields[2] as List?)?.cast(), + ); + } + + @override + void write(BinaryWriter writer, ProvinceModel obj) { + writer + ..writeByte(3) + ..writeByte(0) + ..write(obj.id) + ..writeByte(1) + ..write(obj.name) + ..writeByte(2) + ..write(obj.cityList); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ProvinceModelAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class CityAdapter extends TypeAdapter { + @override + final int typeId = 1; + + @override + City read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return City( + id: fields[0] as int?, + name: fields[1] as String?, + districts: (fields[2] as List?)?.cast(), + ); + } + + @override + void write(BinaryWriter writer, City obj) { + writer + ..writeByte(3) + ..writeByte(0) + ..write(obj.id) + ..writeByte(1) + ..write(obj.name) + ..writeByte(2) + ..write(obj.districts); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is CityAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class DistrictAdapter extends TypeAdapter { + @override + final int typeId = 2; + + @override + District read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return District( + id: fields[0] as int?, + name: fields[1] as String?, + ); + } + + @override + void write(BinaryWriter writer, District obj) { + writer + ..writeByte(2) + ..writeByte(0) + ..write(obj.id) + ..writeByte(1) + ..write(obj.name); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is DistrictAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/lib/pages/personal/address/address_list_page.dart b/lib/pages/personal/address/address_list_page.dart index fbce9875..cff39005 100644 --- a/lib/pages/personal/address/address_list_page.dart +++ b/lib/pages/personal/address/address_list_page.dart @@ -131,16 +131,25 @@ class AddressListPageState extends State super.build(context); return BeeScaffold( title: '我的收货地址', - bottomNavi: MaterialButton( - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - textColor: Colors.white, - child: '新增收货地址'.text.size(28.sp).make(), - onPressed: (){ - Get.to(() => NewAddressPage()); + bottomNavi: GestureDetector( + onTap: ()async{ + bool? result = await Get.to(() => NewAddressPage(isFirstAdd: _addressModels.isEmpty? true:false,)); + if(result!=null){ + if(result) _refreshController.callRefresh(); + } }, - color: Color(0xFFE52E2E), - height: 98.w, - minWidth: double.infinity, + child: Container( + margin: EdgeInsets.only(left: 100.w,right: 100.w,bottom: 100.w), + alignment: Alignment.center, + child: '新增收货地址'.text.size(28.sp).white.make(), + decoration: BoxDecoration( + borderRadius: BorderRadius.horizontal(left: Radius.circular(49.w),right: Radius.circular(49.w)), + color: Color(0xFFE52E2E), + ), + width: 522.w, + height: 98.w, + + ), ), body:EasyRefresh( firstRefresh: true, @@ -148,14 +157,15 @@ class AddressListPageState extends State controller: _refreshController, onRefresh: () async { _addressModels = await Userfunc.getMyAddress(); + _onload =false; setState(() {}); }, child: _onload ? SizedBox() : ListView( + padding: EdgeInsets.all(20.w), children: [ - ..._addressModels.map((e) => MyAddressItem(addressModel: e,setDefaultListener:(){}, - deleteListener:(){},editListener:(){} + ..._addressModels.map((e) => MyAddressItem(addressModel: e,refreshController: _refreshController, )).toList(), // // ..._newItems.map((e) => ChatCard( diff --git a/lib/pages/personal/address/address_selector.dart b/lib/pages/personal/address/address_selector.dart index 9035dd64..f7106640 100644 --- a/lib/pages/personal/address/address_selector.dart +++ b/lib/pages/personal/address/address_selector.dart @@ -6,10 +6,12 @@ * remark : * ==================================================== */ -import 'package:aku_community/model/user/ProvinceModel.dart'; +import 'package:aku_community/base/base_style.dart'; +import 'package:aku_community/model/user/province_model.dart'; import 'package:aku_community/utils/text_utils.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter/material.dart'; +import 'package:aku_community/utils/headers.dart'; typedef AddressSelectorCallback = Function( String province, String city, String disctrict,int? locationId); @@ -44,7 +46,7 @@ class _AddressSelectorState extends State late ProvinceModel _province; late City? _city; late District? _district; - Color _selectedColor = Colors.white; + Color _selectedColor = Colors.black; late BuildContext _context; late bool _tab = true; @@ -63,7 +65,7 @@ class _AddressSelectorState extends State _context = context; return GestureDetector( onTap: () {}, - child: _buildBody(), + child: _buildBody(context), ); } @@ -74,31 +76,32 @@ class _AddressSelectorState extends State super.dispose(); } - Container _buildBody() { + Container _buildBody(BuildContext context) { return Container( - height: 750.w, - padding: EdgeInsets.symmetric(horizontal: 15), + height: 1000.w, + padding: EdgeInsets.symmetric(horizontal: 15.w), decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.vertical(top: Radius.circular(10))), + borderRadius: BorderRadius.vertical(top: Radius.circular(10.w))), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, - children: [_header(), _tabBar(), _list()], + children: [_header(), _tabBar(), 10.hb, _list()], ), ); } Container _header() { return Container( - margin: EdgeInsets.symmetric(vertical: 10), + margin: EdgeInsets.symmetric(vertical: 30.w), child: Row( children: [ + Spacer(), Text( - "配送至", + "请选择所在地区", style: TextStyle( - fontSize: 18 * 2.sp, + fontSize: 32.sp, fontWeight: FontWeight.w500, - color: Colors.black), + color:ktextPrimary), ), Spacer(), GestureDetector( @@ -106,15 +109,15 @@ class _AddressSelectorState extends State _dismiss(); }, child: Container( - padding: EdgeInsets.all(5), + padding: EdgeInsets.all(5.w), decoration:BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20)), - color: Colors.grey[200], + borderRadius: BorderRadius.all(Radius.circular(20.w)), + color: Colors.white, ), child: Icon( - Icons.delete, + Icons.close, color: Colors.grey[500], - size: 12, + size: 40.w, ), ), ) @@ -126,12 +129,12 @@ class _AddressSelectorState extends State TabBar _tabBar() { return TabBar( controller: _tabController, - labelPadding: EdgeInsets.zero, - unselectedLabelColor: Colors.black, + labelPadding: EdgeInsets.only(top: 5.w), + unselectedLabelColor: Color(0xFFE52E2E), isScrollable: true, - indicatorColor: _selectedColor, + indicatorColor: Color(0xFFE52E2E), indicatorSize: TabBarIndicatorSize.label, - indicatorPadding: EdgeInsets.only(left: 0, right: 0), + indicatorPadding: EdgeInsets.only(left: 10.w, right: 10.w,bottom: -5.w), tabs: _tabItems()); } @@ -146,7 +149,7 @@ class _AddressSelectorState extends State } list.add(Container( margin: EdgeInsets.symmetric(horizontal: 5.w), - height: 30.w, + height: 40.w, alignment: Alignment.center, child: Text( TextUtils.isEmpty(_result[i]) ? "请选择" : _result[i], @@ -176,7 +179,8 @@ class _AddressSelectorState extends State child: Container( padding: EdgeInsets.zero, child: Container( - padding: EdgeInsets.symmetric(vertical: 6), + color: Colors.transparent, + padding: EdgeInsets.symmetric(vertical: 10.w), child: Row(children: [ Text( addr, @@ -189,7 +193,8 @@ class _AddressSelectorState extends State offstage: !selected, child: Icon( Icons.check, - size: 16 * 2.sp, + color: Color(0xFFE52E2E), + size: 40.sp, )) ]), ), @@ -297,7 +302,7 @@ class _AddressSelectorState extends State /// 没有次级列表返回 if (city.districts!.length == 0) { _dismiss(); - widget.callback(_province.name??'', _city?.name??'', '',_province.id??null); + widget.callback(_province.name??'', _city?.name??'', '',_city?.id??null); return; } @@ -317,7 +322,7 @@ class _AddressSelectorState extends State _result[2] = _district?.name??''; _indexs[2] = index; _dismiss(); - widget.callback(_province.name??'', _city?.name??'', _district?.name??'',_province.id??null); + widget.callback(_province.name??'', _city?.name??'', _district?.name??'',_district?.id??null); } } } diff --git a/lib/pages/personal/address/editView.dart b/lib/pages/personal/address/editView.dart index bcc6f09d..fd5cd10d 100644 --- a/lib/pages/personal/address/editView.dart +++ b/lib/pages/personal/address/editView.dart @@ -65,7 +65,7 @@ class _EditTileState extends State { }, child: Container( constraints: widget.constraints, - padding: EdgeInsets.symmetric(vertical: 2, horizontal: 15), + padding: EdgeInsets.symmetric(vertical: 2.w, horizontal: 20.w), color: Colors.white, child: widget.direction == Axis.horizontal ? _horizontal() : _vertical(), @@ -77,7 +77,7 @@ class _EditTileState extends State { return Row( children: [ Container( - width: 80.w, + width: 120.w, child: Text( widget.title, style: widget.titleStyle, @@ -85,6 +85,7 @@ class _EditTileState extends State { ), Expanded( child: InputView( + padding: EdgeInsets.symmetric(horizontal: 0), focusNode: _focusNode, controller: _controller, maxLength: widget.maxLength, @@ -113,7 +114,7 @@ class _EditTileState extends State { Expanded( child: InputView( focusNode: _focusNode, - padding: EdgeInsets.symmetric(horizontal: 3), + padding: EdgeInsets.symmetric(horizontal: 0), maxLines: widget.maxLines, maxLength: widget.maxLength, controller: _controller, diff --git a/lib/pages/personal/address/new_address_page.dart b/lib/pages/personal/address/new_address_page.dart index 86438ca0..e8552a28 100644 --- a/lib/pages/personal/address/new_address_page.dart +++ b/lib/pages/personal/address/new_address_page.dart @@ -1,13 +1,14 @@ import 'dart:convert'; import 'dart:ui'; - -import 'package:aku_community/model/user/ProvinceModel.dart'; +import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/model/user/adress_model.dart'; +import 'package:aku_community/model/user/province_model.dart'; import 'package:aku_community/pages/personal/user_func.dart'; import 'package:aku_community/utils/hive_store.dart'; import 'package:aku_community/utils/text_utils.dart'; import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -23,17 +24,21 @@ import 'editView.dart'; class NewAddressPage extends StatefulWidget { final bool? isFirstAdd; final AddressModel? addressModel; - NewAddressPage({Key? key, this.isFirstAdd, this.addressModel}) : super(key: key); + final EasyRefreshController? refreshController; + + NewAddressPage({Key? key, this.isFirstAdd, this.addressModel, this.refreshController}) + : super(key: key); @override _NewAddressPageState createState() => _NewAddressPageState(); } -class _NewAddressPageState extends State{ +class _NewAddressPageState extends State { EasyRefreshController _refreshController = EasyRefreshController(); late AddressModel _address = AddressModel.empty(); late List _cityJsonModels = []; late StateSetter _addressStateSetter; + bool isDefault = false; @override void initState() { @@ -43,224 +48,306 @@ class _NewAddressPageState extends State{ } } - @override Widget build(BuildContext context) { - - return BeeScaffold( - title: '新建收货地址', - body:_buildBody(context), + return BeeScaffold( + title:widget.addressModel==null? '新建收货地址':'修改收货地址', + body: _buildBody(context), ); - - - - } + _buildBody(BuildContext context) { return GestureDetector( onTap: () { //FocusScope.of(context).requestFocus(new FocusNode()); }, - child: Container( - child:ListView( - children: [ - Container( - height: 10, - ), - EditTile( - constraints: BoxConstraints.tight(Size(double.infinity, 45)), - title: "收货人", - value: _address.name??'', - hint: "请填写收货人姓名", - textChanged: (value) { - _address.name = value; - }, - ), - Container( - height: 3, + child: ListView( + children: [ + Container( + clipBehavior: Clip.antiAlias, + margin: EdgeInsets.all(20.w), + padding: EdgeInsets.only(top: 10.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(24.w)), ), - EditTile( - constraints: BoxConstraints.tight(Size(double.infinity, 45)), - title: "手机号码", - value: _address.tel??'', - hint: "请填写收货人手机号码", - maxLength: 11, - textChanged: (value) { - _address.tel = value; - }, + child: Column( + children: [ + EditTile( + constraints: BoxConstraints.tight(Size(double.infinity, 45)), + title: "收货人", + titleStyle: TextStyle(fontSize: 28.sp, color: ktextPrimary), + hintStyle: TextStyle(fontSize: 28.sp, color: Color(0xFFBBBBBB)), + textStyle: TextStyle(fontSize: 28.sp, color: ktextSubColor), + value: _address.name ?? '', + hint: "请填写收货人姓名", + textChanged: (value) { + _address.name = value; + }, + ), + Container( + height: 2.w, + color: Color(0xFFD9D9D9), + margin: EdgeInsets.symmetric(horizontal: 24.w)), + EditTile( + constraints: BoxConstraints.tight(Size(double.infinity, 100.w)), + title: "手机号码", + titleStyle: TextStyle(fontSize: 28.sp, color: ktextPrimary), + hintStyle: TextStyle(fontSize: 28.sp, color: Color(0xFFBBBBBB)), + textStyle: TextStyle(fontSize: 28.sp, color: ktextSubColor), + value: _address.tel ?? '', + hint: "请填写收货人手机号码", + maxLength: 11, + textChanged: (value) { + _address.tel = value; + }, + ), + Container( + height: 2.w, + color: Color(0xFFD9D9D9), + margin: EdgeInsets.symmetric(horizontal: 24.w)), + _addressView(), + Container( + height: 2.w, + color: Color(0xFFD9D9D9), + margin: EdgeInsets.symmetric(horizontal: 24.w)), + + Container( + height: 20.w, + ), + EditTile( + title: "详细地址", + hint: "街道门牌号等", + titleStyle: TextStyle(fontSize: 28.sp, color: ktextPrimary), + hintStyle: TextStyle(fontSize: 28.sp, color: Color(0xFFBBBBBB)), + textStyle: TextStyle(fontSize: 28.sp, color: ktextSubColor), + value: _address.addressDetail ?? '', + maxLength: 100, + maxLines: 3, + direction: Axis.vertical, + constraints: BoxConstraints(maxHeight: 100), + textChanged: (value) { + _address.addressDetail = value; + }, + ), + Container( + height: 2.w, + color: Color(0xFFD9D9D9), + margin: EdgeInsets.symmetric(horizontal: 24.w)), + Container( + height: 30.w, + ), + ], ), - Container( - height: 3, - ), - _addressView(), - Container( - height: 3, - ), - EditTile( - title: "详细地址", - hint: "街道门牌号等", - value: _address.addressDetail??'', - maxLength: 100, - maxLines: 3, - direction: Axis.vertical, - constraints: BoxConstraints(maxHeight: 100), - textChanged: (value) { - _address.addressDetail = value; - }, - ), - Container( - height: 30, - ), - // _defaultAddressTile(), - Container( - height: 100, - ), - _saveButton(context) - ], - ) + ), + _defaultAddressTile(), + // _defaultAddressTile(), + Container( + height: 100, + ), + _saveButton(context) + ], ), ); } Container _saveButton(BuildContext context) { return Container( - margin: EdgeInsets.symmetric(horizontal: 15), - child: GestureDetector( - onTap: (){ - - _saveAddress(context); + margin: EdgeInsets.symmetric(horizontal: 100.w), + child: GestureDetector( + onTap: () { + _saveAddress(context); }, child: Container( + alignment: Alignment.center, decoration: BoxDecoration( color: Colors.red, - borderRadius: BorderRadius.all(Radius.circular(8.w)), + borderRadius: BorderRadius.horizontal( + left: Radius.circular(40.w), right: Radius.circular(40.w)), ), - height: 45.w, + height: 80.w, padding: EdgeInsets.symmetric(vertical: 8.w), child: Text( - "保存地址",style: TextStyle( - color: Colors.white, - fontSize: 17 * 2.sp, - ), + "保存并使用", + style: TextStyle( + color: Colors.white, + fontSize:28.sp, + ), ), - ), ), ); } _addressView() { - return StatefulBuilder( - builder: (BuildContext context, StateSetter setSta) { - _addressStateSetter = setSta; - return GestureDetector( - onTap: () { - print('1'); - if (_cityJsonModels.isEmpty) { - print('2'); - getCityList().then((success) { - if (success) { - _selectAddress(context); - } + return StatefulBuilder( + builder: (BuildContext context, StateSetter setSta) { + _addressStateSetter = setSta; + return GestureDetector( + onTap: () { + print('1'); + if (_cityJsonModels.isEmpty) { + print('2'); + getCityList().then((success) { + if (success) { + _selectAddress(context); } - ); - return; - } - _selectAddress(context); - }, - child: Container( - padding: EdgeInsets.symmetric(vertical: 12, horizontal: 15), - decoration: BoxDecoration( - color: Colors.red, - border: Border( - bottom: BorderSide(color: Colors.grey, width: 0.5))), - child: Row( - children: [ - Container( - width: 80.w, + }); + return; + } + _selectAddress(context); + }, + child: Container( + padding: EdgeInsets.symmetric(vertical: 30.w, horizontal: 24.w), + child: Row( + children: [ + Container( + width: 120.w, + child: Text("所在地区", + style: TextStyle(fontSize: 28.sp, color: ktextPrimary)), + ), + Expanded( child: Text( - "所在地区", - style:TextStyle(fontSize: 15.sp,) - ), - ), - Expanded( - child: Text( - TextUtils.isEmpty(_address.locationName??'') - ? "选择地址" - : "${_address.locationName} : ""}", - textAlign: TextAlign.end, - style: TextStyle(fontSize: 14.sp, fontWeight: FontWeight.w500), - )), - Icon( - Icons.navigate_next, - size: 16, - color: Colors.black, - ) - ], - ), + TextUtils.isEmpty(_address.locationName ?? '') + ? "选择地址" + : "${_address.locationName}", + textAlign: TextAlign.end, + style: TextStyle(fontSize: 28.sp, color: Color(0xFFBBBBBB)), + )), + Icon( + Icons.navigate_next, + size: 40.w, + color: ktextThirdColor, + ) + ], ), - ); - }, - + ), + ); + }, ); } - - /// 弹出地址选择 _selectAddress(BuildContext context) { AddressSelectorHelper.show(context, models: _cityJsonModels, province: _address.province, city: _address.city, - district: _address.district, - callback: (String province, String city, String district,int? locationId) { - _address.locationName= province+city+district; - _address.id = locationId??null; - _addressStateSetter(() {}); - print("$province - $city -$district"); - }); + district: _address.district, callback: + (String province, String city, String district, int? locationId) { + _address.province = province; + _address.city = city; + _address.district = district; + _address.locationName = province + city + district; + _address.location = locationId ?? null; + _addressStateSetter(() {}); + print("$province - $city -$district"); + }); } Future getCityList() async { - _cityJsonModels = await HiveStore.appBox?.get('cityList')??[]; + _cityJsonModels = await (HiveStore.appBox?.get('cityList') ?? []) + .cast() + .toList(); return true; } /// 保存地址 _saveAddress(BuildContext context) async { - if (TextUtils.isEmpty(_address.name??"")) { + if (TextUtils.isEmpty(_address.name ?? "")) { BotToast.showText(text: '收货人不能为空'); return; } - if (TextUtils.isEmpty(_address.tel??'') || + if (TextUtils.isEmpty(_address.tel ?? '') || !TextUtils.verifyPhone(_address.tel)) { BotToast.showText(text: '手机号格式不正确'); return; } - if (TextUtils.isEmpty(_address.province??'')) { + if (_address.location==null) { BotToast.showText(text: '所在地区不能为空'); return; } - if (TextUtils.isEmpty(_address.addressDetail??'')) { + if (TextUtils.isEmpty(_address.addressDetail ?? '')) { BotToast.showText(text: '详细地址不能为空'); return; } - - if (_address.id != null) { - Userfunc.insertAddress( _address.name??'', _address.tel??'', - _address.location??null, _address.addressDetail??'', _address.isDefault??null); + if (_address.id == null) { + Userfunc.insertAddress( + _address.name ?? '', + _address.tel ?? '', + _address.location ?? null, + _address.addressDetail ?? '', + _address.isDefault ?? null); } else { - Userfunc.updateAddress(_address.id!, _address.name??'', _address.tel??'', - _address.location??null, _address.addressDetail??'', _address.isDefault??null); + Userfunc.updateAddress( + _address.id!, + _address.name ?? '', + _address.tel ?? '', + _address.location ?? null, + _address.addressDetail ?? '', + _address.isDefault ?? null); } - Navigator.maybePop(context, _address); + //Navigator.maybePop(context, _address); + Get.back(result: true); + } + + _defaultAddressTile() { + + if (widget.isFirstAdd != null) + if(_address.isDefault ==1){ + isDefault = true; + }else{ + isDefault = false; + widget.isFirstAdd! ? _address.isDefault = 1 : _address.isDefault = 0; + } + + return Container( + clipBehavior: Clip.antiAlias, + margin: EdgeInsets.all(20.w), + padding: EdgeInsets.only(top: 24.w,bottom: 24.w,left: 24.w,right: 24.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(24.w)), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '设置为默认地址'.text.size(28.sp).color(ktextPrimary).make(), + 5.hb, + '提醒:每次下单灰默认推荐使用该地址'.text.size(24.sp).color(Color(0xFFBBBBBB)).make(), + ], + ), + Spacer(), + CupertinoSwitch( + value: isDefault, + onChanged: (value) { + if (value) { + isDefault = value; + _address.isDefault = 1; + print(1); + } else { + isDefault = value; + _address.isDefault = 0; + print(0); + } + setState(() {}); + }) + ], + ), + ); + + } + } diff --git a/lib/pages/personal/item_my_address.dart b/lib/pages/personal/item_my_address.dart index 3c0f17b6..94227e9e 100644 --- a/lib/pages/personal/item_my_address.dart +++ b/lib/pages/personal/item_my_address.dart @@ -9,102 +9,174 @@ import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/model/user/adress_model.dart'; +import 'package:aku_community/pages/personal/user_func.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:aku_community/utils/headers.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; + +import 'address/new_address_page.dart'; // ignore: must_be_immutable -class MyAddressItem extends StatelessWidget { +class MyAddressItem extends StatefulWidget { final AddressModel addressModel; - final VoidCallback setDefaultListener; - final VoidCallback deleteListener; - final VoidCallback editListener; + final EasyRefreshController? refreshController; Color _titleColor = Colors.black; - MyAddressItem( - {required this.addressModel, - required this.deleteListener, - required this.editListener, - required this.setDefaultListener}) + MyAddressItem({required this.addressModel, +this.refreshController}) : assert(addressModel != null); + _MyAddressItemState createState() => _MyAddressItemState(); +} +class _MyAddressItemState extends State { @override Widget build(BuildContext context) { return Container( - color: Colors.white, + clipBehavior: Clip.antiAlias, + margin: EdgeInsets.only(bottom:20.w), + padding: EdgeInsets.only(top: 22.w,bottom: 24.w,left: 24.w,right: 20.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(24.w)), + ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ GestureDetector( - onTap: (){ - this.setDefaultListener; + onTap: () async{ + bool? result = await Userfunc.setIsDefaultAddress(widget.addressModel.id!); + if(result!=null){ + if(result) widget.refreshController!.callRefresh(); + } }, child: Container( - child: Image.asset(R.ASSETS_ICONS_ICON_MY_SETTING_PNG,width: 40.w,height: 40.w,), + child: widget.addressModel.isDefault==1? + Image.asset(R.ASSETS_ICONS_ICON_ADDRESS_ISDEFAULT_PNG,width: 40.w,height: 40.w,): + Image.asset(R.ASSETS_ICONS_ICON_ADDRESS_NOT_PNG,width: 40.w,height: 40.w,), ), ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: + EdgeInsets.symmetric(horizontal: 20.w, vertical:6.w), + child: SizedBox( + width: 520.w, + child: Text( + widget.addressModel.locationName??'', + style:TextStyle(fontSize: 24.sp,color: ktextPrimary), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + ), + Padding( + padding: + EdgeInsets.symmetric(horizontal: 20.w, vertical:6.w), + child: SizedBox( + width: 520.w, + child: Text( + ( widget.addressModel.addressDetail??''), + style:TextStyle(fontSize: 32.sp,color: ktextPrimary), + maxLines: 1, + overflow: TextOverflow.ellipsis, - Padding( - padding: - EdgeInsets.symmetric(horizontal: 20.w, vertical:6.w), - child: Text( - addressModel.locationName??'', - style:TextStyle(fontSize: 24.sp,color: ktextPrimary) - ), - ), - Padding( - padding: - EdgeInsets.symmetric(horizontal: 20.w, vertical:6.w), - child: Text( - addressModel.addressDetail??'', - style:TextStyle(fontSize: 32.sp,color: ktextPrimary) - ), - ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 20.w), - child: Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text( - addressModel.name??'', - style: TextStyle(fontSize: 24.sp,color: ktextPrimary) + ), ), - 30.wb, - Text( - addressModel.tel??'', - style: TextStyle(fontSize: 24.sp,color: ktextPrimary) + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 20.w, vertical:6.w), + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + widget.addressModel.name??'', + style: TextStyle(fontSize: 24.sp,color: ktextPrimary) + ), + 30.wb, + Text( + widget.addressModel.tel??'', + style: TextStyle(fontSize: 24.sp,color: ktextPrimary) + ), + ], ), - ], - ), + ), + ], ), + Spacer(), GestureDetector( + onTap: () async{ + + bool? result = await Get.to(() => NewAddressPage(isFirstAdd:false,addressModel: widget.addressModel, + )); + if(result!=null){ + if(result) widget.refreshController!.callRefresh(); + } + + }, child: Container( - child: Image.asset(R.ASSETS_ICONS_ICON_MY_SETTING_PNG,width: 40.w,height: 40.w,), + child: Image.asset(R.ASSETS_ICONS_ICON_ADDRESS_EDIT_PNG,width: 40.w,height: 40.w,), ), ) ], ), - - + 20.hb, Container( height: 1, color: Colors.grey[200], ), + 20.hb, Row( + crossAxisAlignment: CrossAxisAlignment.center, children: [ + 10.wb, Text( - addressModel.isDefault == 0 ? "" : "默认地址", + widget.addressModel.isDefault == 0 ? "" : "默认地址", style: TextStyle(fontSize: 28.sp,color: ktextSubColor), ), Spacer(), GestureDetector( - onTap: (){ - this.setDefaultListener; + onTap: () async{ + // bool? result = await Userfunc.deleteAddress(widget.addressModel.id!); + // if(result!=null){ + // if(result) widget.refreshController!.callRefresh(); + // } + bool? result = + await Get.dialog(CupertinoAlertDialog( + title: '您确定要删除该地址吗?'.text.isIntrinsic.size(30.sp).make(), + actions: [ + CupertinoDialogAction( + child: '取消'.text.black.isIntrinsic.make(), + onPressed: () => Get.back(), + ), + CupertinoDialogAction( + child: '确定' + .text + .color(Colors.orange) + .isIntrinsic + .make(), + onPressed: () => Get.back(result: true), + ), + ], + )); + + if (result == true) { + bool? result = await Userfunc.deleteAddress(widget.addressModel.id!); + if(result!=null){ + if(result) widget.refreshController!.callRefresh(); + } + }; }, child: Container( + width: 70.w, + height: 40.w, child:Text( "删除", style: TextStyle(fontSize: 28.sp,color: ktextSubColor), @@ -118,4 +190,5 @@ class MyAddressItem extends StatelessWidget { ), ); } + } diff --git a/lib/pages/personal/user_func.dart b/lib/pages/personal/user_func.dart index 6ee38e01..b6c9d37e 100644 --- a/lib/pages/personal/user_func.dart +++ b/lib/pages/personal/user_func.dart @@ -11,6 +11,7 @@ import 'package:aku_community/models/market/order/goods_home_model.dart'; import 'package:aku_community/utils/network/base_list_model.dart'; import 'package:aku_community/utils/network/base_model.dart'; import 'package:aku_community/utils/network/net_util.dart'; +import 'package:bot_toast/bot_toast.dart'; class Userfunc { @@ -30,47 +31,85 @@ class Userfunc { ///添加收货地址 static Future insertAddress(String name,String tel,int? location, String addressDetail,int? isDefault) async { - BaseModel model = await NetUtil().get( + BaseModel model = await NetUtil().post( API.user.insertAddress, params: {'name':name,'tel':tel,'location':location, 'addressDetail':addressDetail,'isDefault':isDefault}, - showMessage: true + showMessage: false ); - if (model.message! == "请求成功") - return true; - else + if (model.status??false) + { + BotToast.showText(text: '添加成功'); + return true; + } + + else{ + BotToast.showText(text: '添加失败'); return false; + } + } ///修改收货地址 static Future updateAddress(int id,String name,String tel,int? location, String addressDetail,int? isDefault) async { - BaseModel model = await NetUtil().get( + BaseModel model = await NetUtil().post( API.user.updateAddress, params: {'id': id,'name':name,'tel':tel,'location':location, 'addressDetail':addressDetail,'isDefault':isDefault}, - showMessage: true + showMessage: false ); - if (model.message! == "请求成功") + if (model.status??false) + { + BotToast.showText(text: '修改成功'); return true; - else + } + + else{ + BotToast.showText(text: '修改失败'); return false; + } } ///删除收货地址 static Future deleteAddress(int addressId) async { - BaseModel model = await NetUtil().get( + BaseModel model = await NetUtil().post( API.user.deleteAddress, params: {'addressId': addressId}, - showMessage: true + showMessage: false ); - if (model.message! == "请求成功") + if (model.status??false) + { + BotToast.showText(text: '删除成功'); return true; - else + } + + else{ + BotToast.showText(text: '删除失败'); return false; + } } + ///设置默认收货地址 + static Future setIsDefaultAddress(int addressId) async { + BaseModel model = await NetUtil().post( + API.user.settingDefaultAddress, + params: {'addressId': addressId}, + showMessage: false + ); + if (model.status??false) + { + BotToast.showText(text: '设置成功'); + return true; + } + + else{ + BotToast.showText(text: '设置失败'); + return false; + } + } + diff --git a/lib/pages/splash/splash_page.dart b/lib/pages/splash/splash_page.dart index ebb72747..3d43e1fc 100644 --- a/lib/pages/splash/splash_page.dart +++ b/lib/pages/splash/splash_page.dart @@ -2,8 +2,8 @@ import 'dart:io'; import 'package:aku_community/const/resource.dart'; import 'package:aku_community/constants/api.dart'; -import 'package:aku_community/model/user/ProvinceModel.dart'; import 'package:aku_community/main_initialize.dart'; +import 'package:aku_community/model/user/province_model.dart'; import 'package:aku_community/pages/setting_page/agreement_page/agreement_page.dart'; import 'package:aku_community/pages/setting_page/agreement_page/privacy_page.dart'; import 'package:aku_community/pages/tab_navigator.dart'; @@ -115,23 +115,7 @@ class _SplashPageState extends State { context, debug: DeveloperUtil.dev, ); - Future.delayed(Duration(milliseconds: 0), () async { - 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(); - print(_province); - HiveStore.appBox!.put('cityList', _province); - } - } - }); + Future.delayed(Duration(milliseconds: 0), () async { await _originOp(); diff --git a/lib/pages/tab_navigator.dart b/lib/pages/tab_navigator.dart index 7b2733a7..17eec659 100644 --- a/lib/pages/tab_navigator.dart +++ b/lib/pages/tab_navigator.dart @@ -1,8 +1,13 @@ import 'package:aku_community/const/resource.dart'; +import 'package:aku_community/constants/api.dart'; +import 'package:aku_community/model/user/province_model.dart'; import 'package:aku_community/pages/property/property_page.dart'; import 'package:aku_community/pages/sign/sign_in_page.dart'; import 'package:aku_community/ui/community/community_views/community_page.dart'; import 'package:aku_community/ui/market/market_page.dart'; +import 'package:aku_community/utils/hive_store.dart'; +import 'package:aku_community/utils/network/base_model.dart'; +import 'package:aku_community/utils/network/net_util.dart'; import 'package:aku_community/utils/websocket/web_socket_util.dart'; import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/others/user_tool.dart'; @@ -38,6 +43,22 @@ class _TabNavigatorState extends State @override void initState() { super.initState(); + Future.delayed(Duration(milliseconds: 0), () async { + 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(), diff --git a/lib/provider/app_provider.dart b/lib/provider/app_provider.dart index c23bf682..0ba224d4 100644 --- a/lib/provider/app_provider.dart +++ b/lib/provider/app_provider.dart @@ -6,7 +6,6 @@ import 'package:aku_community/constants/config.dart'; import 'package:aku_community/model/common/real_time_weather_model.dart'; import 'package:aku_community/model/community/hot_topic_model.dart'; import 'package:aku_community/model/message/message_center_model.dart'; -import 'package:aku_community/model/user/ProvinceModel.dart'; import 'package:aku_community/model/user/car_parking_model.dart'; import 'package:aku_community/models/user/passed_house_list_model.dart'; import 'package:aku_community/utils/hive_store.dart'; diff --git a/lib/utils/hive_store.dart b/lib/utils/hive_store.dart index 143ac72d..1f068589 100644 --- a/lib/utils/hive_store.dart +++ b/lib/utils/hive_store.dart @@ -1,9 +1,22 @@ +import 'package:aku_community/model/user/province_model.dart'; +import 'package:flutter/foundation.dart'; import 'package:hive/hive.dart'; +import 'package:path_provider/path_provider.dart'; class HiveStore { static Box? _appBox; static Box? get appBox => _appBox; - static init() async { - _appBox = await Hive.openBox('app'); + static Future init() async { + if (!kIsWeb) { + var dir = await getApplicationDocumentsDirectory(); + Hive.init(dir.path); + Hive.registerAdapter(ProvinceModelAdapter()); + Hive.registerAdapter(CityAdapter()); + Hive.registerAdapter(DistrictAdapter()); + _appBox = await Hive.openBox('app'); + } + + } + } diff --git a/pubspec.lock b/pubspec.lock index ded7d741..0d1ec43c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -590,6 +590,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" + hive_generator: + dependency: "direct dev" + description: + name: hive_generator + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.1" http: dependency: transitive description: @@ -1087,6 +1094,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.0.3" + source_helper: + dependency: transitive + description: + name: source_helper + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.3.0" source_span: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index bad244df..ac79709d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -119,6 +119,7 @@ dev_dependencies: sdk: flutter #导入包整理 import_sorter: ^4.5.1 + hive_generator: ^1.1.0 #脚本工具 grinder: ^0.9.0 flutter_native_splash: ^1.1.8+4