Browse Source

Merge branch 'master' into dev

master
w-R 3 years ago
parent
commit
e3bd41045f
  1. 2
      ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
  2. 5
      lib/address/address_map_page.dart
  3. 76
      lib/home/activity_list_page.dart
  4. 335
      lib/home/home_page.dart
  5. 69
      lib/home/huixiang_brand_page.dart
  6. 235
      lib/home/points_mall_page.dart
  7. 2
      lib/integral/integral_detailed_page.dart
  8. 12
      lib/integral/integral_page.dart
  9. 7
      lib/login/login_page.dart
  10. 20
      lib/main.dart
  11. 17
      lib/main_page.dart
  12. 197
      lib/mine/mine_page.dart
  13. 51
      lib/mine/mine_vip_level_page.dart
  14. 93
      lib/order/order_history_page.dart
  15. 7
      lib/order/store_selector_page.dart
  16. 37
      lib/retrofit/data/base_data.g.dart
  17. 13
      lib/retrofit/retrofit_api.dart
  18. 3
      lib/union/store_details_page.dart
  19. 582
      lib/union/union_details_page.dart
  20. 56
      lib/union/union_page.dart
  21. 8
      lib/utils/location.dart
  22. 67
      lib/view_widget/classic_header.dart
  23. 14
      pubspec.lock
  24. 3
      pubspec.yaml

2
ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

@ -40,7 +40,7 @@
</Testables> </Testables>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Debug" buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0" launchStyle = "0"

5
lib/address/address_map_page.dart

@ -15,6 +15,7 @@ import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart';
import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart'; import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart';
import 'package:flutter_bmflocation/flutter_baidu_location_android_option.dart'; import 'package:flutter_bmflocation/flutter_baidu_location_android_option.dart';
import 'package:flutter_bmflocation/flutter_baidu_location_ios_option.dart'; import 'package:flutter_bmflocation/flutter_baidu_location_ios_option.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/address.dart'; import 'package:huixiang/retrofit/data/address.dart';
@ -199,10 +200,10 @@ class _AddressMapPage extends State<AddressMapPage> {
if (await Permission.location.isPermanentlyDenied) { if (await Permission.location.isPermanentlyDenied) {
requestDialog(); requestDialog();
} else if (await Permission.location.isGranted) { } else if (await Permission.location.isGranted) {
SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai, animationDurationTemp: Duration(seconds: 1)); EasyLoading.show(status: S.of(context).zhengzaijiazai);
aMapFlutterLocation.startLocation(); aMapFlutterLocation.startLocation();
Future.delayed(Duration(seconds: 6), () { Future.delayed(Duration(seconds: 6), () {
SmartDialog.dismiss(); EasyLoading.dismiss();
}); });
} else if (await Permission.location.isUndetermined) { } else if (await Permission.location.isUndetermined) {
await Permission.location.request(); await Permission.location.request();

76
lib/home/activity_list_page.dart

@ -30,11 +30,6 @@ class _ActivityListPage extends State<ActivityListPage>
@override @override
void initState() { void initState() {
super.initState(); super.initState();
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
context: context, token: value.getString('token')),
queryActivity(),
});
eventBus.on<EventType>().listen((event) { eventBus.on<EventType>().listen((event) {
if (event.type < 3) { if (event.type < 3) {
@ -46,6 +41,8 @@ class _ActivityListPage extends State<ActivityListPage>
List<Activity> activityList; List<Activity> activityList;
queryActivity() async { queryActivity() async {
final SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(Dio(), context: context, token: value.getString('token'));
BaseData<PageInfo<Activity>> baseData = await apiService.informationList({ BaseData<PageInfo<Activity>> baseData = await apiService.informationList({
"pageNum": 1, "pageNum": 1,
"pageSize": 10, "pageSize": 10,
@ -57,9 +54,7 @@ class _ActivityListPage extends State<ActivityListPage>
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
_refreshController.refreshCompleted(); _refreshController.refreshCompleted();
setState(() { activityList = baseData.data.list;
activityList = baseData.data.list;
});
} }
} }
@ -88,40 +83,45 @@ class _ActivityListPage extends State<ActivityListPage>
}, },
), ),
onRefresh: queryActivity, onRefresh: queryActivity,
child: ListView.builder( child: FutureBuilder(
itemCount: activityList == null ? 0 : activityList.length, future: queryActivity(),
physics: NeverScrollableScrollPhysics(), builder: (context, snapshot) {
itemBuilder: (context, position) { return ListView.builder(
return InkWell( itemCount: activityList == null ? 0 : activityList.length,
onTap: () { physics: NeverScrollableScrollPhysics(),
Navigator.of(context).pushNamed('/router/store_detail_page', itemBuilder: (context, position) {
arguments: {"activityId": activityList[position].id}); return InkWell(
}, onTap: () {
child: FrameSeparateWidget( Navigator.of(context).pushNamed('/router/store_detail_page',
child: activityItem(activityList[position]), arguments: {"activityId": activityList[position].id});
placeHolder: AspectRatio( },
aspectRatio: 1.34, child: FrameSeparateWidget(
child: Container( child: activityItem(activityList[position]),
margin: EdgeInsets.only( placeHolder: AspectRatio(
left: 16.w, right: 16.w, top: 8.h, bottom: 8.h), aspectRatio: 1.34,
decoration: BoxDecoration( child: Container(
color: Colors.white, margin: EdgeInsets.only(
boxShadow: [ left: 16.w, right: 16.w, top: 8.h, bottom: 8.h),
BoxShadow( decoration: BoxDecoration(
color: Colors.black.withAlpha(12), color: Colors.white,
offset: Offset(0, 3), boxShadow: [
blurRadius: 14, BoxShadow(
spreadRadius: 0, color: Colors.black.withAlpha(12),
) offset: Offset(0, 3),
], blurRadius: 14,
borderRadius: BorderRadius.circular(8), spreadRadius: 0,
)
],
borderRadius: BorderRadius.circular(8),
),
),
), ),
), ),
), );
), },
); );
}, },
), )
), ),
), ),
); );

335
lib/home/home_page.dart

@ -1,6 +1,7 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
@ -46,14 +47,6 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
void initState() { void initState() {
super.initState(); super.initState();
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
context: context,
token: value.getString('token'),
showLoading: false),
queryHome(),
});
eventBus.on<EventType>().listen((event) { eventBus.on<EventType>().listen((event) {
if (event.type < 3) { if (event.type < 3) {
setState(() {}); setState(() {});
@ -84,9 +77,13 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
Founder founder; Founder founder;
queryHome() async { queryHome() async {
SmartDialog.showLoading( // SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai);
msg: S.of(context).zhengzaijiazai, EasyLoading.show(status: S.of(context).zhengzaijiazai);
animationDurationTemp: Duration(seconds: 1));
final SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(Dio(), context: context,
token: value.getString('token'), showLoading: false);
BaseData<PageInfo<BannerData>> baseData = await apiService.queryBanner({ BaseData<PageInfo<BannerData>> baseData = await apiService.queryBanner({
"model": {"type": "HOME_PAGE"}, "model": {"type": "HOME_PAGE"},
}).catchError((onError) { }).catchError((onError) {
@ -95,10 +92,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
bannerData.clear(); bannerData.clear();
bannerData.addAll(baseData.data.records); bannerData.addAll(baseData.data.records);
setState(() { if (bannerData.length > 0) controller.move(0, animation: false);
if (bannerData.length > 0)
controller.move(0, animation: false);
});
} }
BaseData brand = await apiService.queryHomeBrand().catchError((onError) { BaseData brand = await apiService.queryHomeBrand().catchError((onError) {
@ -137,10 +131,10 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
gooods.clear(); gooods.clear();
gooods.addAll(goodsData.data.list); gooods.addAll(goodsData.data.list);
} }
SmartDialog.dismiss(); // SmartDialog.dismiss();
EasyLoading.dismiss();
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
refreshController.refreshCompleted(); refreshController.refreshCompleted();
if (mounted) setState(() {});
} else { } else {
refreshController.refreshFailed(); refreshController.refreshFailed();
} }
@ -167,142 +161,147 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
onRefresh: queryHome, onRefresh: queryHome,
child: SingleChildScrollView( child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
child: Column( child: FutureBuilder(
children: [ future: queryHome(),
banner(), builder: (context, snapshot) {
SizedBox( return Column(
height: 20.h, children: [
), banner(),
ItemTitle( SizedBox(
text: S.of(context).jinrihuiyuanrenwu, height: 20.h,
imgPath: "assets/image/icon_today_task.png", ),
moreText: S.of(context).renwuzhongxin, ItemTitle(
onTap: () { text: S.of(context).jinrihuiyuanrenwu,
SharedPreferences.getInstance().then((value) { imgPath: "assets/image/icon_today_task.png",
if (value.getString('token') == null || moreText: S.of(context).renwuzhongxin,
value.getString('token') == "") { onTap: () {
loginTips(); SharedPreferences.getInstance().then((value) {
} else { if (value.getString('token') == null ||
Navigator.of(context).pushNamed('/router/integral_page'); value.getString('token') == "") {
} loginTips();
}); } else {
}, Navigator.of(context).pushNamed('/router/integral_page');
), }
InkWell( });
onTap: () { },
SharedPreferences.getInstance().then((value) { ),
if (value.getString('token') == null || InkWell(
value.getString('token') == "") { onTap: () {
loginTips(); SharedPreferences.getInstance().then((value) {
} else { if (value.getString('token') == null ||
Navigator.of(context).pushNamed('/router/integral_page'); value.getString('token') == "") {
} loginTips();
}); } else {
}, Navigator.of(context).pushNamed('/router/integral_page');
child: signIn(), }
), });
SizedBox( },
height: 12.h, child: signIn(),
), ),
ItemTitle( SizedBox(
text: S.of(context).huixiangtoutiao, height: 12.h,
imgPath: "assets/image/icon_today_video.png", ),
moreText: S.of(context).chakangengduo, ItemTitle(
onTap: () { text: S.of(context).huixiangtoutiao,
Navigator.of(context).pushNamed('/router/hot_article_page'); imgPath: "assets/image/icon_today_video.png",
}, moreText: S.of(context).chakangengduo,
), onTap: () {
hotList(), Navigator.of(context).pushNamed('/router/hot_article_page');
ItemTitle( },
text: S.of(context).chuangshirendegushi1, ),
imgPath: "assets/image/icon_founder.png", hotList(),
), ItemTitle(
GestureDetector( text: S.of(context).chuangshirendegushi1,
onTap: () { imgPath: "assets/image/icon_founder.png",
Navigator.of(context).pushNamed('/router/founder_story_page'); ),
}, GestureDetector(
child: founderStore(), onTap: () {
), Navigator.of(context).pushNamed('/router/founder_story_page');
ItemTitle( },
text: S.of(context).pinpaijieshao, child: founderStore(),
imgPath: "assets/image/icon_brand_introduction.png", ),
), ItemTitle(
brands(), text: S.of(context).pinpaijieshao,
// ban(), imgPath: "assets/image/icon_brand_introduction.png",
Container( ),
margin: EdgeInsets.only( brands(),
left: 16.5.w, right: 16.5.w, bottom: 40.h, top: 10.h), // ban(),
padding: EdgeInsets.only(bottom: 10.h, top: 16.h), Container(
decoration: BoxDecoration( margin: EdgeInsets.only(
borderRadius: BorderRadius.circular(4), left: 16.5.w, right: 16.5.w, bottom: 40.h, top: 10.h),
boxShadow: [ padding: EdgeInsets.only(bottom: 10.h, top: 16.h),
BoxShadow( decoration: BoxDecoration(
color: Colors.black.withAlpha(12), borderRadius: BorderRadius.circular(4),
offset: Offset(0, 3), boxShadow: [
blurRadius: 14, BoxShadow(
spreadRadius: 0, color: Colors.black.withAlpha(12),
) offset: Offset(0, 3),
], blurRadius: 14,
color: Colors.white, spreadRadius: 0,
), )
child: Column( ],
children: [ color: Colors.white,
Row( ),
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Row(
flex: 1, mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: ItemTitle( crossAxisAlignment: CrossAxisAlignment.center,
text: S.of(context).jifenshangcheng, children: [
imgPath: "assets/image/icon_points_mall.png", Expanded(
), flex: 1,
), child: ItemTitle(
GestureDetector( text: S.of(context).jifenshangcheng,
onTap: callback, imgPath: "assets/image/icon_points_mall.png",
child: Container( ),
padding: EdgeInsets.symmetric(
vertical: 3.h, horizontal: 8.w),
margin: EdgeInsets.only(right: 16.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(11.5),
color: Color(0xFF32A060),
), ),
child: Row( GestureDetector(
children: [ onTap: callback,
Text( child: Container(
"GO", padding: EdgeInsets.symmetric(
style: TextStyle( vertical: 3.h, horizontal: 8.w),
fontSize: 14.sp, margin: EdgeInsets.only(right: 16.w),
fontWeight: FontWeight.bold, decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(11.5),
), color: Color(0xFF32A060),
), ),
Icon( child: Row(
Icons.chevron_right, children: [
color: Colors.white, Text(
size: 18, "GO",
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
Icon(
Icons.chevron_right,
color: Colors.white,
size: 18,
),
],
), ),
], ),
), ),
), ],
),
SizedBox(
height: 14.h,
),
Divider(
// indent: 0.0,
thickness: 1,
color: Color(0xffF2F2F2),
), ),
integralStore(),
], ],
), ),
SizedBox( ),
height: 14.h, // integralStore(),
), ],
Divider( );
// indent: 0.0, },
thickness: 1,
color: Color(0xffF2F2F2),
),
integralStore(),
],
),
),
// integralStore(),
],
), ),
), ),
), ),
@ -597,14 +596,14 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
return Container( return Container(
height: 90.h, height: 90.h,
margin: EdgeInsets.only(bottom: 18.h), margin: EdgeInsets.only(bottom: 18.h),
child: ListView.builder( child: Swiper(
padding: EdgeInsets.only(left: 10.w, right: 10.w),
scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
viewportFraction: 0.32,
scale: 0.7,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return Container( return Container(
height: 60.h, // height: 60.h,
width: 120.w, // width: 120.w,
margin: EdgeInsets.symmetric(horizontal: 3.w, vertical: 15.h), margin: EdgeInsets.symmetric(horizontal: 3.w, vertical: 15.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -630,6 +629,38 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
itemCount: itemCount:
(brandData != null && brandData.length > 0) ? brandData.length : 0, (brandData != null && brandData.length > 0) ? brandData.length : 0,
), ),
// child: ListView.builder(
// padding: EdgeInsets.only(left: 10.w, right: 10.w),
// scrollDirection: Axis.horizontal,
// physics: BouncingScrollPhysics(),
// itemBuilder: (context, position) {
// return Container(
// height: 60.h,
// width: 120.w,
// margin: EdgeInsets.symmetric(horizontal: 3.w, vertical: 15.h),
// decoration: BoxDecoration(
// color: Colors.white,
// boxShadow: [
// BoxShadow(
// color: Colors.black.withAlpha(37),
// offset: Offset(0, 2),
// blurRadius: 5,
// spreadRadius: 0,
// )
// ],
// borderRadius: BorderRadius.circular(8),
// ),
// child: MImage(
// brandData != null ? brandData[position].image : "",
// radius: BorderRadius.circular(8),
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_2_1.png",
// fadeSrc: "assets/image/default_2_1.png",
// ),
// );
// },
// itemCount: (brandData != null && brandData.length > 0) ? brandData.length : 0,
// ),
); );
} }
@ -673,7 +704,9 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
), ),
); );
}, },
itemCount: (bannerData != null && bannerData.length > 0) ? bannerData.length : 1, itemCount: (bannerData != null && bannerData.length > 0)
? bannerData.length
: 1,
), ),
), ),
); );

69
lib/home/huixiang_brand_page.dart

@ -3,6 +3,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_html/image_render.dart'; import 'package:flutter_html/image_render.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
@ -32,7 +33,9 @@ class BrandPage extends StatefulWidget {
class _BrandPage extends State<BrandPage> class _BrandPage extends State<BrandPage>
with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin { with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin {
ScrollController scrollController = ScrollController();
final ScrollController scrollController = ScrollController();
final RefreshController refreshController = RefreshController();
ApiService apiService; ApiService apiService;
List<Brand> brands = []; List<Brand> brands = [];
@ -40,11 +43,19 @@ class _BrandPage extends State<BrandPage>
List<GlobalKey> globaKeys = []; List<GlobalKey> globaKeys = [];
List<BannerData> bannerData = []; List<BannerData> bannerData = [];
// List<String> brandText = [];
var isShowMore = false; var isShowMore = false;
queryHome() async { Future queryHome() async {
BaseData<BrandData> baseData = await apiService.queryHome().catchError((error) { EasyLoading.show(status: S
.of(context)
.zhengzaijiazai);
final SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(Dio(), context: context,
token: value.getString('token'), showLoading: false);
BaseData<BrandData> baseData = await apiService.queryHome().catchError((
error) {
refreshController.refreshFailed(); refreshController.refreshFailed();
}); });
BaseData<PageInfo<BannerData>> banner = await apiService.queryBanner({ BaseData<PageInfo<BannerData>> banner = await apiService.queryBanner({
@ -55,9 +66,7 @@ class _BrandPage extends State<BrandPage>
bannerData.clear(); bannerData.clear();
bannerData.addAll(banner.data.records); bannerData.addAll(banner.data.records);
BaseData brand = await apiService.queryHomeBrand().catchError((onError) { BaseData brand = await apiService.queryHomeBrand().catchError((error) {
refreshController.refreshFailed();
}).catchError((onError) {
refreshController.refreshFailed(); refreshController.refreshFailed();
}); });
if (brand != null && brand.isSuccess) { if (brand != null && brand.isSuccess) {
@ -69,30 +78,27 @@ class _BrandPage extends State<BrandPage>
brands.forEach((element) { brands.forEach((element) {
globaKeys.add(GlobalKey()); globaKeys.add(GlobalKey());
}); });
setState(() {});
} else { } else {
refreshController.refreshFailed(); refreshController.refreshFailed();
} }
EasyLoading.dismiss();
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
refreshController.refreshCompleted(); refreshController.refreshCompleted();
brandData = baseData.data; brandData = baseData.data;
setState(() {});
} else { } else {
refreshController.refreshFailed(); refreshController.refreshFailed();
} }
} }
@override
void didChangeDependencies() {
super.didChangeDependencies();
}
@override @override
void initState() { void initState() {
super.initState(); super.initState();
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
context: context, token: value.getString('token')),
queryHome(),
});
eventBus.on<EventType>().listen((event) { eventBus.on<EventType>().listen((event) {
print("object: BrandPage"); print("object: BrandPage");
if (event.type < 3) { if (event.type < 3) {
@ -101,14 +107,15 @@ class _BrandPage extends State<BrandPage>
}); });
} }
RefreshController refreshController = RefreshController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
toolbarHeight: 40.h - MediaQuery.of(context).padding.top, toolbarHeight: 40.h - MediaQuery
.of(context)
.padding
.top,
backgroundColor: Colors.white, backgroundColor: Colors.white,
elevation: 0, elevation: 0,
), ),
@ -132,8 +139,14 @@ class _BrandPage extends State<BrandPage>
child: Container( child: Container(
color: Color(0xFFF7F7F7), color: Color(0xFFF7F7F7),
margin: EdgeInsets.only(top: 16.h), margin: EdgeInsets.only(top: 16.h),
child: Column( child: FutureBuilder(
children: homeChildItem(), future: queryHome(),
builder: (context, snapshot) {
//ConnectionState
return Column(
children: homeChildItem(),
);
},
), ),
), ),
), ),
@ -252,7 +265,7 @@ class _BrandPage extends State<BrandPage>
TextSpan(children: [ TextSpan(children: [
TextSpan( TextSpan(
text: text:
brandData == null ? "" : brandData.originator, brandData == null ? "" : brandData.originator,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14.sp, fontSize: 14.sp,
@ -260,7 +273,9 @@ class _BrandPage extends State<BrandPage>
), ),
), ),
TextSpan( TextSpan(
text: " ${S.of(context).jituanchuangbanren}", text: " ${S
.of(context)
.jituanchuangbanren}",
style: TextStyle( style: TextStyle(
fontSize: 10.sp, fontSize: 10.sp,
color: Colors.black, color: Colors.black,
@ -293,7 +308,9 @@ class _BrandPage extends State<BrandPage>
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: [ children: [
Text( Text(
S.of(context).gengduo, S
.of(context)
.gengduo,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: Colors.black, color: Colors.black,
@ -353,7 +370,9 @@ class _BrandPage extends State<BrandPage>
height: 40.h, height: 40.h,
), ),
Text( Text(
S.of(context).linian, S
.of(context)
.linian,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,

235
lib/home/points_mall_page.dart

@ -3,6 +3,7 @@ import 'dart:ui';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
@ -58,31 +59,16 @@ class _PointsMallPage extends State<PointsMallPage>
void initState() { void initState() {
super.initState(); super.initState();
refreshUserInfo();
eventBus.on<EventType>().listen((event) { eventBus.on<EventType>().listen((event) {
if (event.type < 3) { if (event.type < 3) {
setState(() {}); setState(() {});
} }
if (event.type == 3) { if (event.type == 3) {
refreshUserInfo(); creditGoods();
} }
}); });
} }
refreshUserInfo() {
if (mounted)
SharedPreferences.getInstance().then((value) => {
client = ApiService(Dio(),
context: context,
token: value.getString('token'),
showLoading: false),
SmartDialog.showLoading(msg: S.current.zhengzaijiazai),
creditGoods(categoryId),
queryUser(),
});
}
int pageNum = 1; int pageNum = 1;
//1-2-3- //1-2-3-
@ -103,7 +89,6 @@ class _PointsMallPage extends State<PointsMallPage>
if (banner != null) { if (banner != null) {
bannerData.clear(); bannerData.clear();
bannerData.addAll(banner.data.records); bannerData.addAll(banner.data.records);
setState(() {});
} }
BaseData<UserInfo> baseData = await client.queryInfo(); BaseData<UserInfo> baseData = await client.queryInfo();
@ -112,11 +97,18 @@ class _PointsMallPage extends State<PointsMallPage>
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
value.setString('user', jsonEncode(baseData.data)), value.setString('user', jsonEncode(baseData.data)),
}); });
setState(() {});
} }
} }
creditGoods(categoryId) async { creditGoods() async {
EasyLoading.show(status: S.current.zhengzaijiazai);
final SharedPreferences value = await SharedPreferences.getInstance();
client = ApiService(Dio(),
context: context, token: value.getString('token'), showLoading: false);
await queryUser();
BaseData<PageInfo<GoodsCategory>> dataCategory = BaseData<PageInfo<GoodsCategory>> dataCategory =
await client.goodsCategory({ await client.goodsCategory({
"current": 1, "current": 1,
@ -149,21 +141,19 @@ class _PointsMallPage extends State<PointsMallPage>
_refreshController.loadFailed(); _refreshController.loadFailed();
_refreshController.refreshFailed(); _refreshController.refreshFailed();
}); });
SmartDialog.dismiss(); EasyLoading.dismiss();
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
if (pageNum == 1) { if (pageNum == 1) {
goods.clear(); goods.clear();
} }
goods.addAll(baseData.data.list); goods.addAll(baseData.data.list);
setState(() { _refreshController.refreshCompleted();
_refreshController.refreshCompleted(); _refreshController.loadComplete();
_refreshController.loadComplete(); if (baseData.data.pageNum == baseData.data.pages) {
if (baseData.data.pageNum == baseData.data.pages) { _refreshController.loadNoData();
_refreshController.loadNoData(); } else {
} else { pageNum += 1;
pageNum += 1; }
}
});
} else { } else {
_refreshController.loadFailed(); _refreshController.loadFailed();
_refreshController.refreshFailed(); _refreshController.refreshFailed();
@ -174,26 +164,12 @@ class _PointsMallPage extends State<PointsMallPage>
_refresh() { _refresh() {
pageNum = 1; pageNum = 1;
SmartDialog.showLoading(msg: S.current.zhengzaijiazai); creditGoods();
creditGoods(categoryId);
queryUser();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
List<DropdownMenuItem<String>> sortItems = [];
sortString.forEach((element) {
sortItems.add(DropdownMenuItem(
value: element,
child: Text(
element,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w500,
color: Color(0xff353535)),
)));
});
return SmartRefresher( return SmartRefresher(
enablePullDown: true, enablePullDown: true,
enablePullUp: true, enablePullUp: true,
@ -208,85 +184,103 @@ class _PointsMallPage extends State<PointsMallPage>
controller: _refreshController, controller: _refreshController,
onRefresh: _refresh, onRefresh: _refresh,
onLoading: () { onLoading: () {
SmartDialog.showLoading(msg: S.current.zhengzaijiazai); creditGoods();
creditGoods(categoryId);
}, },
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
color: Color(0xFFFAFAFA), color: Color(0xFFFAFAFA),
child: Column( child: FutureBuilder(
children: [ future: creditGoods(),
banner(), builder: (context, snapshot) {
userItem(), return Column(
ItemTitle( children: [
text: S.of(context).jifenshangcheng, banner(),
imgPath: "assets/image/icon_points_mall.png", userItem(),
moreText: _itemText, ItemTitle(
moreType: 1, text: S.of(context).jifenshangcheng,
items: sortItems, imgPath: "assets/image/icon_points_mall.png",
onChanged: _sortChange, moreText: _itemText,
), moreType: 1,
Container( items: sortString
alignment: Alignment.centerLeft, .map((e) => DropdownMenuItem(
child: DefaultTabController( value: e,
length: gooodsCategorys == null ? 0 : gooodsCategorys.length, child: Text(
child: TabBar( e,
isScrollable: true, style: TextStyle(
// fontSize: 12.sp,
indicatorColor: Color(0xff39B54A), fontWeight: FontWeight.w500,
labelColor: Color(0xff32A060), color: Color(0xff353535)),
labelStyle: ),
TextStyle(fontSize: 14.sp, fontWeight: FontWeight.bold), ),
unselectedLabelStyle: TextStyle( )
fontSize: 14.sp, .toList(),
fontWeight: FontWeight.w400, onChanged: _sortChange,
), ),
// controller: tabController, Container(
// alignment: Alignment.centerLeft,
unselectedLabelColor: Color(0xff4D4D4D), child: DefaultTabController(
indicatorSize: TabBarIndicatorSize.label, length: gooodsCategorys == null
// ? 0
tabs: gooodsCategorys == null : gooodsCategorys.length,
? [] child: TabBar(
: gooodsCategorys isScrollable: true,
.map((e) => Tab(text: e.name)) //
.toList(), indicatorColor: Color(0xff39B54A),
onTap: (index) { labelColor: Color(0xff32A060),
categoryId = gooodsCategorys[index].id; labelStyle: TextStyle(
pageNum = 1; fontSize: 14.sp, fontWeight: FontWeight.bold),
creditGoods(categoryId); unselectedLabelStyle: TextStyle(
}, fontSize: 14.sp,
), fontWeight: FontWeight.w400,
), ),
), // controller: tabController,
GridView.builder( //
itemCount: goods == null ? 0 : goods.length, unselectedLabelColor: Color(0xff4D4D4D),
padding: EdgeInsets.only( indicatorSize: TabBarIndicatorSize.label,
left: 16.w, right: 16.w, top: 13.h, bottom: 16.h), //
shrinkWrap: true, tabs: gooodsCategorys == null
physics: NeverScrollableScrollPhysics(), ? []
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( : gooodsCategorys
//Widget数量 .map((e) => Tab(text: e.name))
crossAxisCount: 2, .toList(),
//Widget之间间距 onTap: (index) {
crossAxisSpacing: 11.w, categoryId = gooodsCategorys[index].id;
//Widget之间间距 pageNum = 1;
mainAxisSpacing: 16.w, creditGoods();
//Widget宽高比例 0.59 },
childAspectRatio: 166 / ),
(281 / 2 + (281 / 2) * AppUtils.textScale(context)), ),
), ),
itemBuilder: (contetx, index) { GridView.builder(
return GestureDetector( itemCount: goods == null ? 0 : goods.length,
onTap: () { padding: EdgeInsets.only(
_toDetails(index); left: 16.w, right: 16.w, top: 13.h, bottom: 16.h),
}, shrinkWrap: true,
child: buildItem(goods[index]), physics: NeverScrollableScrollPhysics(),
); gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
}) //Widget数量
], crossAxisCount: 2,
), //Widget之间间距
), crossAxisSpacing: 11.w,
//Widget之间间距
mainAxisSpacing: 16.w,
//Widget宽高比例 0.59
childAspectRatio: 166 /
(281 / 2 +
(281 / 2) * AppUtils.textScale(context)),
),
itemBuilder: (contetx, index) {
return GestureDetector(
onTap: () {
_toDetails(index);
},
child: buildItem(goods[index]),
);
})
],
);
},
)),
), ),
); );
} }
@ -323,8 +317,7 @@ class _PointsMallPage extends State<PointsMallPage>
orderDesc = false; orderDesc = false;
break; break;
} }
SmartDialog.showLoading(msg: S.current.zhengzaijiazai); creditGoods();
creditGoods(categoryId);
setState(() { setState(() {
_itemText = item; _itemText = item;
}); });

2
lib/integral/integral_detailed_page.dart

@ -62,7 +62,7 @@ class _IntegralDetailedPage extends State<IntegralDetailedPage>
void initState() { void initState() {
super.initState(); super.initState();
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), token: value.getString("token")), apiService = ApiService(Dio(), context: context, token: value.getString("token")),
userInfo = UserInfo.fromJson(jsonDecode(value.getString('user'))), userInfo = UserInfo.fromJson(jsonDecode(value.getString('user'))),
queryDetail("bill_cate_point_get"), queryDetail("bill_cate_point_get"),
}); });

12
lib/integral/integral_page.dart

@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
@ -43,9 +44,7 @@ class _IntegralPage extends State<IntegralPage> {
token: value.getString("token"), token: value.getString("token"),
showLoading: false); showLoading: false);
userinfo = UserInfo.fromJson(jsonDecode(value.getString("user"))); userinfo = UserInfo.fromJson(jsonDecode(value.getString("user")));
SmartDialog.showLoading( EasyLoading.show(status: S.of(context).zhengzaijiazai);
msg: S.of(context).zhengzaijiazai,
animationDurationTemp: Duration(seconds: 1));
querySignInfo(); querySignInfo();
}); });
} }
@ -67,7 +66,8 @@ class _IntegralPage extends State<IntegralPage> {
.indexWhere((element) => element.id == userinfo.memberRankVo.id) + .indexWhere((element) => element.id == userinfo.memberRankVo.id) +
1); 1);
} }
SmartDialog.dismiss(closeType: 3); // SmartDialog.dismiss(closeType: 3);
EasyLoading.dismiss();
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
signInfo = baseData.data; signInfo = baseData.data;
setState(() {}); setState(() {});
@ -509,7 +509,7 @@ class _IntegralPage extends State<IntegralPage> {
SmartDialog.showToast("今日已签到了", alignment: Alignment.center); SmartDialog.showToast("今日已签到了", alignment: Alignment.center);
return; return;
} }
SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai);
BaseData baseData = await apiService.signIn(); BaseData baseData = await apiService.signIn();
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
querySignInfo(); querySignInfo();
@ -517,7 +517,7 @@ class _IntegralPage extends State<IntegralPage> {
widget: SignInWidget("${signInfo.signInList.length + 1}", widget: SignInWidget("${signInfo.signInList.length + 1}",
"${signInfo.rewardList[signInfo.signInList.length]}")); "${signInfo.rewardList[signInfo.signInList.length]}"));
} else { } else {
SmartDialog.dismiss(); EasyLoading.dismiss();
} }
} }

7
lib/login/login_page.dart

@ -3,6 +3,7 @@ import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'dart:ui'; import 'dart:ui';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/main.dart'; import 'package:huixiang/main.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
@ -68,7 +69,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
sharedPreferences.getString("token") != "") { sharedPreferences.getString("token") != "") {
Navigator.of(context).popAndPushNamed('/router/main_page'); Navigator.of(context).popAndPushNamed('/router/main_page');
} else { } else {
client = ApiService(Dio()); client = ApiService(Dio(), context: context);
isShowLogin = true; isShowLogin = true;
setState(() {}); setState(() {});
} }
@ -274,13 +275,13 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
"capcha": code, "capcha": code,
"mobile": mobile, "mobile": mobile,
}; };
SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai);
BaseData value = await client.memberLogin(param).catchError((error) { BaseData value = await client.memberLogin(param).catchError((error) {
print(error); print(error);
SmartDialog.showToast("$error", alignment: Alignment.center); SmartDialog.showToast("$error", alignment: Alignment.center);
}); });
Future.delayed(Duration(seconds: 2), () { Future.delayed(Duration(seconds: 2), () {
SmartDialog.dismiss(); EasyLoading.dismiss();
if (value.isSuccess) { if (value.isSuccess) {
saveUserJson(value.data); saveUserJson(value.data);
eventBus.fire(EventType(3)); eventBus.fire(EventType(3));

20
lib/main.dart

@ -6,6 +6,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart'; import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/address/address_map_page.dart'; import 'package:huixiang/address/address_map_page.dart';
import 'package:huixiang/address/edit_address_page.dart'; import 'package:huixiang/address/edit_address_page.dart';
@ -167,14 +168,17 @@ class MyApp extends StatelessWidget {
supportedLocales: S.delegate.supportedLocales, supportedLocales: S.delegate.supportedLocales,
home: (isFirst ?? true) ? GuidePage() : LoginPage(), home: (isFirst ?? true) ? GuidePage() : LoginPage(),
// home: MainPage(), // home: MainPage(),
builder: (context, widget) { //EasyLoading.init();
return MediaQuery( builder: EasyLoading.init(
data: MediaQuery.of(context).copyWith( builder: (context, widget) {
textScaleFactor: AppUtils.textScale(context), return MediaQuery(
), data: MediaQuery.of(context).copyWith(
child: FlutterSmartDialog(child: widget), textScaleFactor: AppUtils.textScale(context),
); ),
}, child: FlutterSmartDialog(child: widget),
);
},
),
onGenerateRoute: (settings) { onGenerateRoute: (settings) {
final String name = settings.name; final String name = settings.name;
final Function pageContentBuilder = routers[name]; final Function pageContentBuilder = routers[name];

17
lib/main_page.dart

@ -2,6 +2,7 @@ import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/home/huixiang_brand_page.dart'; import 'package:huixiang/home/huixiang_brand_page.dart';
import 'package:huixiang/home/main_home_page.dart'; import 'package:huixiang/home/main_home_page.dart';
@ -57,6 +58,20 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
super.initState(); super.initState();
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
EasyLoading.instance
..indicatorType = EasyLoadingIndicatorType.circle
// ..indicatorType = EasyLoadingIndicatorType.wave
// ..indicatorType = EasyLoadingIndicatorType.threeBounce
..loadingStyle = EasyLoadingStyle.dark
..indicatorSize = 35.0
..backgroundColor = Colors.white
..progressColor = Colors.green
..progressWidth = 3.0
..userInteractions = false
..dismissOnTap = false;
pushRoute(); pushRoute();
_widgetOptions = <Widget>[ _widgetOptions = <Widget>[
@ -189,7 +204,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
} }
} }
PageController pageController = PageController(initialPage: 1); final PageController pageController = PageController(initialPage: 1);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

197
lib/mine/mine_page.dart

@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/main.dart'; import 'package:huixiang/main.dart';
@ -29,6 +30,10 @@ class MinePage extends StatefulWidget {
class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin { class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
ApiService apiService; ApiService apiService;
UserInfo userinfo;
int rankLevel = 1;
List<Rank> ranks = [];
final RefreshController _refreshController = RefreshController();
_toUserInfo() async { _toUserInfo() async {
SharedPreferences shared = await SharedPreferences.getInstance(); SharedPreferences shared = await SharedPreferences.getInstance();
@ -64,45 +69,30 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
refreshUserInfo();
eventBus.on<EventType>().listen((event) { eventBus.on<EventType>().listen((event) {
print("EventType: ${event.type}"); print("EventType: ${event.type}");
if (event.type < 3) { if (event.type < 3) {
setState(() {}); setState(() {});
} }
if (event.type == 3) { if (event.type == 3) {
refreshUserInfo(); queryUserInfo();
} }
}); });
} }
refreshUserInfo() { queryUserInfo() async {
if (mounted) EasyLoading.show(status: S.of(context).zhengzaijiazai);
SharedPreferences.getInstance().then(
(value) => {
apiService = ApiService(Dio(),
context: context,
token: value.getString('token'),
showLoading: false),
if (value.containsKey('user') &&
value.getString('user') != null &&
value.getString('user') != "")
{
userinfo = UserInfo.fromJson(jsonDecode(value.getString('user'))),
},
queryUserInfo()
},
);
}
UserInfo userinfo; final SharedPreferences value = await SharedPreferences.getInstance();
int rankLevel = 1; if (value.containsKey('user') &&
List<Rank> ranks = []; value.getString('user') != null &&
value.getString('user') != "") {
userinfo = UserInfo.fromJson(jsonDecode(value.getString('user')));
}
apiService = ApiService(Dio(), context: context,
token: value.getString('token'), showLoading: false);
queryUserInfo() async {
SmartDialog.showLoading(
msg: S.of(context).zhengzaijiazai,
animationDurationTemp: Duration(seconds: 1));
BaseData<List<Rank>> rankData = await apiService.rankList(); BaseData<List<Rank>> rankData = await apiService.rankList();
if (rankData != null && rankData.isSuccess) { if (rankData != null && rankData.isSuccess) {
ranks.clear(); ranks.clear();
@ -129,12 +119,9 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
} else { } else {
_refreshController.refreshFailed(); _refreshController.refreshFailed();
} }
SmartDialog.dismiss(); EasyLoading.dismiss();
if (mounted) setState(() {});
} }
RefreshController _refreshController = RefreshController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
@ -155,82 +142,90 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
child: Stack( child: Stack(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
children: [ children: [
Column( FutureBuilder(
children: [ future: queryUserInfo(),
Container( builder: (context, snapshot) {
margin: EdgeInsets.only(right: 16.w), return Column(
alignment: Alignment.centerRight,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
// Container( Container(
// margin: EdgeInsets.all(8.h), margin: EdgeInsets.only(right: 16.w),
// child: Image.asset( alignment: Alignment.centerRight,
// "assets/image/icon_notices.png", child: Row(
// width: 24.w, mainAxisAlignment: MainAxisAlignment.end,
// height: 24.h, children: [
// ), // Container(
// ), // margin: EdgeInsets.all(8.h),
// child: Image.asset(
// "assets/image/icon_notices.png",
// width: 24.w,
// height: 24.h,
// ),
// ),
InkWell(
onTap: () {},
child: Container(
margin: EdgeInsets.all(8.h),
child: Image.asset(
"assets/image/icon_scan_qr_code.png",
width: 24.w,
height: 24.h,
),
),
),
],
),
),
InkWell( InkWell(
onTap: () {}, onTap: _toUserInfo,
child: Container( child: mineView(),
margin: EdgeInsets.all(8.h), ),
child: Image.asset( SizedBox(
"assets/image/icon_scan_qr_code.png", height: 22.h,
width: 24.w, ),
height: 24.h, GestureDetector(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
loginTips();
return;
}
Navigator.of(context).pushNamed(
'/router/mine_vip_level_page',
arguments: {
"rankLevel": rankLevel,
"createTime": (userinfo != null)
? "${userinfo.createTime}"
: "",
"points": (userinfo != null)
? int.tryParse(userinfo.points)
: 0,
});
});
},
child: Hero(
tag: "vip",
child: MineVipView(
rankLevel,
curLevel: rankLevel,
rank: (userinfo != null)
? int.tryParse(userinfo.points)
: 0,
rankMax: (userinfo != null &&
userinfo.memberRankVo != null)
? userinfo.memberRankVo.rankOrigin
: 0,
createTime: (userinfo != null)
? userinfo.createTime
: "",
), ),
), ),
), ),
orderOrCard(),
mineList(context),
], ],
), );
), }),
InkWell(
onTap: _toUserInfo,
child: mineView(),
),
SizedBox(
height: 22.h,
),
GestureDetector(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
loginTips();
return;
}
Navigator.of(context).pushNamed(
'/router/mine_vip_level_page',
arguments: {
"rankLevel": rankLevel,
"createTime": (userinfo != null)
? "${userinfo.createTime}"
: "",
"points": (userinfo != null)
? int.tryParse(userinfo.points)
: 0,
});
});
},
child: MineVipView(
rankLevel,
curLevel: rankLevel,
rank: (userinfo != null)
? int.tryParse(userinfo.points)
: 0,
rankMax: (userinfo != null &&
userinfo.memberRankVo != null)
? userinfo.memberRankVo.rankOrigin
: 0,
createTime:
(userinfo != null) ? userinfo.createTime : "",
),
),
orderOrCard(),
mineList(context),
],
),
// buildNotice(), // buildNotice(),
], ],
), ),

51
lib/mine/mine_vip_level_page.dart

@ -1,4 +1,3 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
@ -68,23 +67,41 @@ class _MineVipLevelPage extends State<MineVipLevelPage> {
child: Column( child: Column(
children: [ children: [
Container( Container(
height: 224.h , height: 224.h,
child: Swiper( child: Swiper(
viewportFraction: 0.95, viewportFraction: 0.95,
loop: false, loop: false,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
controller: controller, controller: controller,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return MineVipView( if (widget.arguments["rankLevel"] == (position + 1) || !(ranks != null && ranks.isNotEmpty)) {
position + 1, return Hero(
curLevel: widget.arguments["rankLevel"], tag: "vip",
padding: 6.w, child: MineVipView(
rank: widget.arguments["points"], !(ranks != null && ranks.isNotEmpty) ? widget.arguments["rankLevel"] : position + 1,
rankMax: (position < (ranks.length - 1)) ? ranks[position + 1].rankOrigin : ranks[position].rankOrigin, curLevel: widget.arguments["rankLevel"],
createTime: widget.arguments["createTime"], padding: 6.w,
); rank: !(ranks != null && ranks.isNotEmpty) ? 0 : widget.arguments["points"],
rankMax: !(ranks != null && ranks.isNotEmpty) ? 0 : (position < (ranks.length - 1))
? ranks[position + 1].rankOrigin
: ranks[position].rankOrigin,
createTime: widget.arguments["createTime"],
),
);
} else {
return MineVipView(
position + 1,
curLevel: widget.arguments["rankLevel"],
padding: 6.w,
rank: widget.arguments["points"],
rankMax: (position < (ranks.length - 1))
? ranks[position + 1].rankOrigin
: ranks[position].rankOrigin,
createTime: widget.arguments["createTime"],
);
}
}, },
itemCount: (ranks != null && ranks.isNotEmpty) ? ranks.length : 0, itemCount: (ranks != null && ranks.isNotEmpty) ? ranks.length : 1,
), ),
), ),
Container( Container(
@ -180,11 +197,13 @@ class _MineVipLevelPage extends State<MineVipLevelPage> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: ranks != null children: ranks != null
? ranks.map((e) { ? ranks.map((e) {
return levelItem( return levelItem(
e, ranks[ranks.indexOf(e)].rankOrigin, e,
ranks.indexOf(e) == (ranks.length - 1) ranks[ranks.indexOf(e)].rankOrigin,
? 0 : ranks[ranks.indexOf(e) + 1].rankOrigin); ranks.indexOf(e) == (ranks.length - 1)
}).toList() ? 0
: ranks[ranks.indexOf(e) + 1].rankOrigin);
}).toList()
: [], : [],
), ),
SizedBox( SizedBox(

93
lib/order/order_history_page.dart

@ -201,7 +201,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
super.initState(); super.initState();
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), token: value.getString("token")), apiService = ApiService(Dio(), context: context, token: value.getString("token")),
queryOrder(), queryOrder(),
}); });
} }
@ -210,16 +210,17 @@ class _OrderHistoryList extends State<OrderHistoryList>
return Container( return Container(
margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 8.h), margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 8.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withAlpha(25), color: Colors.black.withAlpha(25),
offset: Offset(0, 1), offset: Offset(0, 1),
blurRadius: 12, blurRadius: 12,
spreadRadius: 0, spreadRadius: 0,
) )
]), ],
),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -429,37 +430,49 @@ class _OrderHistoryList extends State<OrderHistoryList>
orderInfo.sendStatus, orderInfo.sendStatus,
orderInfo.refundStatus, orderInfo.refundStatus,
orderInfo.dayFlowCode, (type) { orderInfo.dayFlowCode, (type) {
if (type == 0) { if (type == 0) {
String storeId = String storeId = (orderInfo != null &&
(orderInfo != null && orderInfo.storeVO != null) orderInfo.storeVO != null)
? (orderInfo.storeVO.id ?? "") ? (orderInfo.storeVO.id ?? "")
: ""; : "";
aginOrder(storeId); aginOrder(storeId);
} else if (type == 1) { } else if (type == 1) {
SmartDialog.show(widget: Tips((){ SmartDialog.show(
widget: Tips(
() {
SmartDialog.dismiss(); SmartDialog.dismiss();
}, text: "暂不支持此功能",)); },
} else if (type == 2) { text: "暂不支持此功能",
SmartDialog.show(widget: Tips((){ ));
} else if (type == 2) {
SmartDialog.show(
widget: Tips(
() {
SmartDialog.dismiss(); SmartDialog.dismiss();
}, text: "暂不支持此功能",)); },
} else if (type == 3) { text: "暂不支持此功能",
SmartDialog.show(widget: Tips((){ ));
} else if (type == 3) {
SmartDialog.show(
widget: Tips(
() {
SmartDialog.dismiss(); SmartDialog.dismiss();
}, text: "暂不支持此功能",)); },
} else if (type == 4) { text: "暂不支持此功能",
Navigator.of(context).pushNamed( ));
'/router/logistics_information_page', } else if (type == 4) {
arguments: { Navigator.of(context).pushNamed(
"logisticsNum": orderInfo.logisticsNum, '/router/logistics_information_page',
"logisticsName": orderInfo.logisticsName, arguments: {
"shipperCode": orderInfo.shipperCode, "logisticsNum": orderInfo.logisticsNum,
"productNum": orderInfo.productList.length, "logisticsName": orderInfo.logisticsName,
"skuImg": orderInfo.productList.length > 0 "shipperCode": orderInfo.shipperCode,
"productNum": orderInfo.productList.length,
"skuImg": orderInfo.productList.length > 0
? orderInfo.productList[0].skuImg ? orderInfo.productList[0].skuImg
: "" : ""
}); });
} }
}) })
: [], : [],
), ),
@ -473,8 +486,8 @@ class _OrderHistoryList extends State<OrderHistoryList>
} }
aginOrder(storeId) { aginOrder(storeId) {
Navigator.of(context).pushNamed('/router/union_detail_page', Navigator.of(context)
arguments: {"id": storeId}); .pushNamed('/router/union_detail_page', arguments: {"id": storeId});
} }
String totalPrice(orderInfo) { String totalPrice(orderInfo) {

7
lib/order/store_selector_page.dart

@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart';
import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart'; import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
@ -119,12 +120,10 @@ class _StoreSelectorPage extends State<StoreSelectorPage> {
if (await Permission.location.isPermanentlyDenied) { if (await Permission.location.isPermanentlyDenied) {
requestDialog(); requestDialog();
} else if (await Permission.location.isGranted) { } else if (await Permission.location.isGranted) {
SmartDialog.showLoading( EasyLoading.show(status: S.of(context).zhengzaijiazai);
msg: S.of(context).zhengzaijiazai,
animationDurationTemp: Duration(seconds: 1));
aMapFlutterLocation.startLocation(); aMapFlutterLocation.startLocation();
Future.delayed(Duration(seconds: 6), () { Future.delayed(Duration(seconds: 6), () {
SmartDialog.dismiss(); EasyLoading.dismiss();
}); });
} else if (await Permission.location.isUndetermined) { } else if (await Permission.location.isUndetermined) {
await Permission.location.request(); await Permission.location.request();

37
lib/retrofit/data/base_data.g.dart

@ -1,37 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'base_data.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BaseData<T> _$BaseDataFromJson<T>(
Map<String, dynamic> json,
T Function(Object json) fromJsonT,
) {
return BaseData<T>()
..code = json['code'] as int
..data = fromJsonT(json['data'])
..extra = json['extra']
..isError = json['isError'] as bool
..isSuccess = json['isSuccess'] as bool
..msg = json['msg'] as String
..path = json['path'] as String
..timestamp = json['timestamp'] as String;
}
Map<String, dynamic> _$BaseDataToJson<T>(
BaseData<T> instance,
Object Function(T value) toJsonT,
) =>
<String, dynamic>{
'code': instance.code,
'data': toJsonT(instance.data),
'extra': instance.extra,
'isError': instance.isError,
'isSuccess': instance.isSuccess,
'msg': instance.msg,
'path': instance.path,
'timestamp': instance.timestamp,
};

13
lib/retrofit/retrofit_api.dart

@ -5,6 +5,7 @@ import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/activity.dart';
@ -65,9 +66,9 @@ abstract class ApiService {
debugPrint("method = ${options.method.toString()}"); debugPrint("method = ${options.method.toString()}");
debugPrint("url = ${options.uri.toString()}"); debugPrint("url = ${options.uri.toString()}");
debugPrint("headers = ${options.headers}"); debugPrint("headers = ${options.headers}");
if (showLoading) { if (showLoading && !EasyLoading.isShow) {
//loading //loading
SmartDialog.showLoading(msg: S.current.zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai);
} }
if (options.data is FormData) { if (options.data is FormData) {
debugPrint("params data = FormData"); debugPrint("params data = FormData");
@ -76,8 +77,8 @@ abstract class ApiService {
} }
debugPrint("params queryParameters = ${options.queryParameters}"); debugPrint("params queryParameters = ${options.queryParameters}");
}, onResponse: (Response response) { }, onResponse: (Response response) {
if (showLoading) { if (showLoading && EasyLoading.isShow) {
SmartDialog.dismiss(); EasyLoading.dismiss();
} }
debugPrint("\n====================== 响应数据开始 ====================="); debugPrint("\n====================== 响应数据开始 =====================");
debugPrint("code = ${response.statusCode}"); debugPrint("code = ${response.statusCode}");
@ -107,8 +108,8 @@ abstract class ApiService {
} }
debugPrint("======================= 响应数据结束 =======================\n"); debugPrint("======================= 响应数据结束 =======================\n");
}, onError: (DioError e) { }, onError: (DioError e) {
if (showLoading) { if (EasyLoading.isShow) {
SmartDialog.dismiss(); EasyLoading.dismiss();
} }
debugPrint("\n=======================错误响应数据 ========================"); debugPrint("\n=======================错误响应数据 ========================");
debugPrint("type = ${e.type}"); debugPrint("type = ${e.type}");

3
lib/union/store_details_page.dart

@ -283,7 +283,8 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
commentTextController.text = ""; commentTextController.text = "";
queryMemberCommentList(); await queryMemberCommentList();
toComment();
} }
} }

582
lib/union/union_details_page.dart

@ -5,6 +5,7 @@ import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
@ -49,21 +50,14 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
refreshController.dispose(); refreshController.dispose();
} }
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
context: context, token: value.getString('token')),
queryStoreInfo(),
});
}
StoreInfo storeInfo; StoreInfo storeInfo;
List<Activity> activitys; List<Activity> activitys;
queryStoreInfo() async { queryStoreInfo() async {
final SharedPreferences value = await SharedPreferences.getInstance();
apiService =
ApiService(Dio(), context: context, token: value.getString('token'));
BaseData baseData = await apiService BaseData baseData = await apiService
.queryStoreInfo(widget.arguments["id"]) .queryStoreInfo(widget.arguments["id"])
.catchError((error) { .catchError((error) {
@ -75,278 +69,293 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
activitys = storeInfo.informationVOPageVO.list activitys = storeInfo.informationVOPageVO.list
.map((e) => Activity.fromJson(e)) .map((e) => Activity.fromJson(e))
.toList(); .toList();
if (mounted) setState(() {});
} else { } else {
refreshController.refreshFailed(); refreshController.refreshFailed();
} }
} }
RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: MyAppBar( appBar: MyAppBar(
background: Color(0xFFF7F7F7), background: Color(0xFFF7F7F7),
title: storeInfo == null ? "" : storeInfo.storeName, title: storeInfo == null ? widget.arguments["storeName"] : storeInfo.storeName,
titleColor: Colors.black87, titleColor: Colors.black87,
titleSize: 18.sp, titleSize: 18.sp,
leadingColor: Colors.black, leadingColor: Colors.black,
), ),
body: Column( body: FutureBuilder(
children: [ future: queryStoreInfo(),
Expanded( builder: (context, snapshot) {
child: SmartRefresher( return Column(
controller: refreshController, children: [
enablePullDown: true, Expanded(
enablePullUp: false, child: SmartRefresher(
header: MyHeader(), controller: refreshController,
physics: BouncingScrollPhysics(), enablePullDown: true,
onRefresh: queryStoreInfo, enablePullUp: false,
child: SingleChildScrollView( header: MyHeader(),
physics: NeverScrollableScrollPhysics(), physics: BouncingScrollPhysics(),
child: Column( onRefresh: queryStoreInfo,
children: [ child: SingleChildScrollView(
AspectRatio( physics: NeverScrollableScrollPhysics(),
aspectRatio: 1, child: Column(
child: Container( children: [
margin: EdgeInsets.fromLTRB(16, 20, 16, 8), AspectRatio(
padding: EdgeInsets.fromLTRB(10, 20, 10, 14), aspectRatio: 1,
decoration: BoxDecoration( child: Container(
color: Colors.white, margin: EdgeInsets.fromLTRB(16, 20, 16, 8),
borderRadius: BorderRadius.all(Radius.circular(8)), padding: EdgeInsets.fromLTRB(10, 20, 10, 14),
boxShadow: [ decoration: BoxDecoration(
BoxShadow( color: Colors.white,
color: Colors.black.withAlpha(25), borderRadius: BorderRadius.circular(8),
offset: Offset(0, 1), boxShadow: [
blurRadius: 12, BoxShadow(
spreadRadius: 0, color: Colors.black.withAlpha(25),
), offset: Offset(0, 1),
], blurRadius: 12,
), spreadRadius: 0,
child: Column( ),
mainAxisAlignment: MainAxisAlignment.spaceAround, ],
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AspectRatio(
aspectRatio: 1.8,
child: buildSwiper(),
), ),
Expanded( child: Column(
child: Container( mainAxisAlignment: MainAxisAlignment.spaceAround,
margin: EdgeInsets.only( crossAxisAlignment: CrossAxisAlignment.start,
left: 10.w, children: [
right: 10.w, AspectRatio(
top: 16.h, aspectRatio: 1.8,
child: buildSwiper(),
), ),
child: Column( Expanded(
mainAxisAlignment: child: Container(
MainAxisAlignment.spaceBetween, margin: EdgeInsets.only(
crossAxisAlignment: left: 10.w,
CrossAxisAlignment.start, right: 10.w,
children: [ top: 16.h,
Row( ),
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Row(
children: [
Text(
storeInfo != null
? storeInfo.storeName
: "",
style: TextStyle(
fontSize: 16.sp,
color: Colors.black,
fontWeight: FontWeight.w500,
),
),
Expanded(
child: Container(
alignment:
Alignment.centerRight,
child: Text(
S.of(context).ren(
storeInfo != null
? storeInfo
.perCapitaConsumption
: "",
),
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w400,
color: Color(0xFF353535),
),
),
),
),
],
),
Text( Text(
storeInfo != null storeInfo != null
? storeInfo.storeName ? storeInfo.address
: "", : "",
maxLines: 2,
textAlign: TextAlign.justify,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, color: Color(0xFF353535),
color: Colors.black, fontWeight: FontWeight.w400,
fontWeight: FontWeight.w500, fontSize: 12.sp,
),
),
Row(
children: itemServer(
storeInfo != null
? storeInfo.businessService
: "",
), ),
), ),
Expanded( Row(
child: Container( mainAxisAlignment:
alignment: Alignment.centerRight, MainAxisAlignment.spaceBetween,
child: Text( crossAxisAlignment:
S.of(context).ren( CrossAxisAlignment.end,
storeInfo != null children: [
? storeInfo Expanded(
.perCapitaConsumption child: Text(
: "", S.of(context).yingyeshijian(storeInfo ==
null
? ""
: (storeInfo.openStartTime ==
null &&
storeInfo
.openEndTime ==
null)
? S.of(context).quantian
: "${storeInfo.openStartTime.substring(0, storeInfo.openStartTime.lastIndexOf(":"))} "
"- ${storeInfo.openEndTime.substring(0, storeInfo.openEndTime.lastIndexOf(":"))}"),
style: TextStyle(
color: Color(0xFF353535),
fontWeight: FontWeight.w400,
fontSize: 12.sp,
),
), ),
style: TextStyle( ),
fontSize: 14.sp, SizedBox(
fontWeight: FontWeight.w400, width: 16.w,
color: Color(0xFF353535), ),
InkWell(
onTap: () {
if (storeInfo == null ||
storeInfo.latitude ==
null ||
storeInfo.longitude ==
null ||
storeInfo.latitude == "" ||
storeInfo.longitude == "")
return;
Navigator.of(context).pushNamed(
'/router/location_map',
arguments: {
"lat": storeInfo.latitude,
"lng":
storeInfo.longitude,
"storeName":
storeInfo.storeName,
});
},
child: Image.asset(
"assets/image/icon_union_location.png",
width: 24.w,
height: 24.h,
), ),
), ),
), SizedBox(
), width: 16.w,
],
),
Text(
storeInfo != null
? storeInfo.address
: "",
maxLines: 2,
textAlign: TextAlign.justify,
style: TextStyle(
color: Color(0xFF353535),
fontWeight: FontWeight.w400,
fontSize: 12.sp,
),
),
Row(
children: itemServer(
storeInfo != null
? storeInfo.businessService : "",
),
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Expanded(
child: Text(
S.of(context).yingyeshijian(storeInfo == null
? "" : (storeInfo.openStartTime == null && storeInfo.openEndTime == null)
? S.of(context).quantian
: "${storeInfo.openStartTime.substring(0, storeInfo.openStartTime.lastIndexOf(":"))} "
"- ${storeInfo.openEndTime.substring(0, storeInfo.openEndTime.lastIndexOf(":"))}"),
style: TextStyle(
color: Color(0xFF353535),
fontWeight: FontWeight.w400,
fontSize: 12.sp,
), ),
), InkWell(
), onTap: () {
SizedBox( showCallMobile();
width: 16.w, },
), child: Image.asset(
InkWell( "assets/image/icon_union_call.png",
onTap: () { width: 24,
if (storeInfo == null || height: 24,
storeInfo.latitude == null || ),
storeInfo.longitude == null || ),
storeInfo.latitude == "" || ],
storeInfo.longitude == "")
return;
Navigator.of(context).pushNamed(
'/router/location_map',
arguments: {
"lat": storeInfo.latitude,
"lng": storeInfo.longitude,
"storeName":
storeInfo.storeName,
});
},
child: Image.asset(
"assets/image/icon_union_location.png",
width: 24.w,
height: 24.h,
),
),
SizedBox(
width: 16.w,
),
InkWell(
onTap: () {
showCallMobile();
},
child: Image.asset(
"assets/image/icon_union_call.png",
width: 24,
height: 24,
),
), ),
], ],
), ),
], ),
flex: 1,
), ),
), ],
flex: 1,
), ),
], ),
), ),
), buildVip(),
), Container(
buildVip(), margin: EdgeInsets.only(top: 10.h, bottom: 10.h),
Container( child: ItemTitle(
margin: EdgeInsets.only(top: 10.h, bottom: 10.h), text: S.of(context).youhuiquan,
child: ItemTitle( imgPath: "assets/image/icon_union_coupons.png",
text: S.of(context).youhuiquan,
imgPath: "assets/image/icon_union_coupons.png",
),
),
(storeInfo != null && storeInfo.couponVOList != null)
? buildCoupon()
: Container(
width: double.infinity,
height: 50.h,
alignment: Alignment.center,
child: Text(
S.of(context).zanwuyouhuiquankelingqu,
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.bold,
color: Color(0xFFA0A0A0),
),
),
), ),
Container( ),
margin: EdgeInsets.only(top: 20.h, bottom: 20.h), (storeInfo != null && storeInfo.couponVOList != null)
child: ItemTitle( ? buildCoupon()
text: S.of(context).xindianhuodong, : Container(
imgPath: "assets/image/icon_union_start_store.png", width: double.infinity,
), height: 50.h,
), alignment: Alignment.center,
(activitys != null && activitys.length > 0) child: Text(
? Container( S.of(context).zanwuyouhuiquankelingqu,
margin: EdgeInsets.only(bottom: 30.h), style: TextStyle(
child: AspectRatio( fontSize: 14.sp,
aspectRatio: 1.55, fontWeight: FontWeight.bold,
child: buildSwiper2Bottom(), color: Color(0xFFA0A0A0),
), ),
) ),
: Container(
width: double.infinity,
height: 30.h,
margin: EdgeInsets.only(bottom: 30.h),
alignment: Alignment.center,
child: Text(
S.of(context).muqianzanwuxingdianhuodong,
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.bold,
color: Color(0xFFA0A0A0),
), ),
), Container(
margin: EdgeInsets.only(top: 20.h, bottom: 20.h),
child: ItemTitle(
text: S.of(context).xindianhuodong,
imgPath: "assets/image/icon_union_start_store.png",
), ),
], ),
), (activitys != null && activitys.length > 0)
), ? Container(
), margin: EdgeInsets.only(bottom: 30.h),
flex: 1, child: AspectRatio(
), aspectRatio: 1.55,
InkWell( child: buildSwiper2Bottom(),
onTap: _loginMin, ),
child: Container( )
padding: EdgeInsets.only(top: 16.h, bottom: 16.h), : Container(
decoration: BoxDecoration( width: double.infinity,
color: isEnable() ? Color(0xFF32A060) : Color(0xFFD8D8D8), height: 30.h,
borderRadius: BorderRadius.vertical( margin: EdgeInsets.only(bottom: 30.h),
top: Radius.circular(4), alignment: Alignment.center,
child: Text(
S.of(context).muqianzanwuxingdianhuodong,
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.bold,
color: Color(0xFFA0A0A0),
),
),
),
],
),
),
), ),
flex: 1,
), ),
alignment: Alignment.center, InkWell(
child: Text( onTap: _loginMin,
isEnable() child: Container(
? S.of(context).jinrushangdian padding: EdgeInsets.only(top: 16.h, bottom: 16.h),
: S.of(context).zanwuxianshangjindian, decoration: BoxDecoration(
style: TextStyle( color: isEnable() ? Color(0xFF32A060) : Color(0xFFD8D8D8),
fontSize: 16.sp, borderRadius: BorderRadius.vertical(
color: isEnable() ? Colors.white : Color(0xFFA0A0A0), top: Radius.circular(4),
fontWeight: FontWeight.bold, ),
),
alignment: Alignment.center,
child: Text(
isEnable()
? S.of(context).jinrushangdian
: S.of(context).zanwuxianshangjindian,
style: TextStyle(
fontSize: 16.sp,
color: isEnable() ? Colors.white : Color(0xFFA0A0A0),
fontWeight: FontWeight.bold,
),
),
), ),
), ),
), ],
), );
], },
), ),
); );
} }
@ -793,9 +802,8 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
? activitys[position].coverImg ? activitys[position].coverImg
: "", : "",
aspectRatio: 2.2, aspectRatio: 2.2,
radius: BorderRadius.only( radius: BorderRadius.vertical(
topRight: Radius.circular(8), top: Radius.circular(8),
topLeft: Radius.circular(8),
), ),
fit: BoxFit.cover, fit: BoxFit.cover,
errorSrc: "assets/image/default_2_1.png", errorSrc: "assets/image/default_2_1.png",
@ -911,26 +919,12 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
); );
} }
//{"uid":"1412687522458238976",
// "userInfo":{"headimg":"https:\/\/pos.upload.gznl.top\/admin\/2021\/07\/4ed055e5-5341-4080-a6f0-fe97c62d078f.jpg",
// "balance":null,
// "money":"0.00",
// "phone":"13800138000",
// "isBind":true,
// "nickname":"你这橘子洋气呀"
// },
// "baseURL":"https:\/\/pos-test.api.lotus-wallet.com\/app\/",
// "shopId":"1344490596986781696",
// "tenantCode":"1177",
// "position":"30.554638,114.34394500000002",
// "token":"Bearer eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX3R5cGUiOiJNSU5JIiwibmFtZSI6IiIsInRva2VuX3R5cGUiOiJ0b2tlbiIsInVzZXJpZCI6IjE0MTI2ODc1MjI0NTgyMzg5NzYiLCJhY2NvdW50IjoiIiwiZXhwIjoxNjI2Nzk1Nzc0LCJuYmYiOjE2MjY3NjY5NzR9.cggcx_vqTozKS-z9uygjV4uA2yHQ4eWssMAngd2c-i0"}
printMin() async { printMin() async {
String miniAppId = storeInfo.mini.miniAppId; String miniAppId = storeInfo.mini.miniAppId;
print("print isExistsApp: ${await Min.isExistsApp(miniAppId)}"); debugPrint("print isExistsApp: ${await Min.isExistsApp(miniAppId)}");
print("print getAppBasePath: ${await Min.getAppBasePath(miniAppId)}"); debugPrint("print getAppBasePath: ${await Min.getAppBasePath(miniAppId)}");
print("print currentPageUrl: ${await Min.currentPageUrl()}"); debugPrint("print currentPageUrl: ${await Min.currentPageUrl()}");
print("print runingAppid: ${await Min.runingAppid()}"); debugPrint("print runingAppid: ${await Min.runingAppid()}");
// print("print getAppVersionInfo: ${await Min.getAppVersionInfo(miniAppId)}");
} }
_loginMin() async { _loginMin() async {
@ -1008,67 +1002,20 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
}); });
} }
Function state;
double progressValue = 0; double progressValue = 0;
String downText = "正在下载中..."; String downText = "正在下载中...";
downloadWgt(appid, savePath) async { downloadWgt(appid, savePath) async {
downText = S.of(context).zhengzaixiazaizhong; downText = S.of(context).zhengzaixiazaizhong;
showCupertinoDialog(
context: context,
barrierDismissible: true,
builder: (context) {
return Material(
type: MaterialType.transparency,
child: StatefulBuilder(builder: (context, status) {
state = status;
return Center(
child: Container(
width: 130.w,
height: 130.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Colors.white,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 40.h,
width: 40.w,
child: CircularProgressIndicator(
value: progressValue,
backgroundColor: Colors.yellow,
color: Colors.blue,
valueColor: AlwaysStoppedAnimation<Color>(Colors.red),
),
),
Text(
downText,
style: TextStyle(
color: Colors.black,
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
),
],
),
),
);
}),
);
});
Response response = await Dio() Response response = await Dio()
.download(storeInfo.mini.miniDownloadUrl, savePath, .download(storeInfo.mini.miniDownloadUrl, savePath,
onReceiveProgress: (progress, max) { onReceiveProgress: (progress, max) {
progressValue = progress.toDouble() / max.toDouble(); progressValue = progress.toDouble() / max.toDouble();
// print("print progressValue: $progressValue"); EasyLoading.showProgress(progressValue, status: downText);
state(() {});
}); });
if (response.statusCode == 200) { if (response.statusCode == 200) {
downText = "下载完成"; downText = "下载完成";
EasyLoading.showProgress(progressValue, status: downText);
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
value.setStringList( value.setStringList(
"miniAppid", "miniAppid",
@ -1077,15 +1024,12 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
: []) : [])
..add(appid)); ..add(appid));
}); });
state(() {});
Future.delayed(Duration(seconds: 1), () {
if (Navigator.canPop(context)) {
Navigator.of(context).pop();
}
});
} else { } else {
print("print 下载失败"); print("print 下载失败");
} }
Future.delayed(Duration(seconds: 1), () {
EasyLoading.dismiss();
});
} }
List<Widget> itemServer(String businessService) { List<Widget> itemServer(String businessService) {
@ -1112,7 +1056,7 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
showCallMobile() { showCallMobile() {
showCupertinoModalPopup( showCupertinoModalPopup(
context: context, context: context,
builder: (contetx) { builder: (context) {
return CupertinoActionSheet( return CupertinoActionSheet(
title: Text(S.of(context).bodadianhua), title: Text(S.of(context).bodadianhua),
actions: [ actions: [

56
lib/union/union_page.dart

@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_baidu_mapapi_map/flutter_baidu_mapapi_map.dart'; import 'package:flutter_baidu_mapapi_map/flutter_baidu_mapapi_map.dart';
import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/main.dart'; import 'package:huixiang/main.dart';
@ -34,8 +35,12 @@ class UnionPage extends StatefulWidget {
class _UnionPage extends State<UnionPage> class _UnionPage extends State<UnionPage>
with AutomaticKeepAliveClientMixin, WidgetsBindingObserver { with AutomaticKeepAliveClientMixin, WidgetsBindingObserver {
RefreshController refreshController =
final RefreshController refreshController =
RefreshController(initialRefresh: false); RefreshController(initialRefresh: false);
ApiService apiService;
bool isKeyBoardShow = false;
BMFCoordinate latLng;
@override @override
void dispose() { void dispose() {
@ -46,8 +51,6 @@ class _UnionPage extends State<UnionPage>
refreshController.dispose(); refreshController.dispose();
} }
bool isKeyBoardShow = false;
@override @override
void didChangeMetrics() { void didChangeMetrics() {
super.didChangeMetrics(); super.didChangeMetrics();
@ -67,18 +70,13 @@ class _UnionPage extends State<UnionPage>
}); });
} }
ApiService apiService;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
Location.getInstance() Location.getInstance().aMapFlutterLocation
.aMapFlutterLocation .onResultCallback().listen((event) {
.onResultCallback()
.listen((event) {
print("value: ");
if (event != null && if (event != null &&
event["latitude"] != null && event["latitude"] != null &&
event["longitude"] != null) { event["longitude"] != null) {
@ -114,6 +112,8 @@ class _UnionPage extends State<UnionPage>
zoomLevel: 15, zoomLevel: 15,
)); ));
}); });
} else {
EasyLoading.dismiss();
} }
}); });
@ -126,13 +126,19 @@ class _UnionPage extends State<UnionPage>
getLatLng(); getLatLng();
Location.getInstance().prepareLoc(); Location.getInstance().prepareLoc();
startLocation();
}
startLocation() async {
EasyLoading.show(status: S.current.zhengzaijiazai);
Location.getInstance().startLocation(context).then((value) { Location.getInstance().startLocation(context).then((value) {
refreshController.refreshCompleted(); if (!value) {
EasyLoading.dismiss();
refreshController.refreshCompleted();
}
}); });
} }
BMFCoordinate latLng;
saveLatLng(BMFCoordinate latLng, province, city, district) async { saveLatLng(BMFCoordinate latLng, province, city, district) async {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString("latitude", "${latLng.latitude}"); await prefs.setString("latitude", "${latLng.latitude}");
@ -195,11 +201,11 @@ class _UnionPage extends State<UnionPage>
}).catchError((error) { }).catchError((error) {
refreshController.refreshFailed(); refreshController.refreshFailed();
}); });
SmartDialog.dismiss(); EasyLoading.dismiss();
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
storeList = baseData.data; storeList = baseData.data;
refreshController.refreshCompleted(); refreshController.refreshCompleted();
if (mounted) setState(() {}); setState(() {});
} else { } else {
refreshController.refreshFailed(); refreshController.refreshFailed();
} }
@ -250,11 +256,7 @@ class _UnionPage extends State<UnionPage>
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
header: MyHeader(), header: MyHeader(),
onRefresh: () { onRefresh: () {
print( startLocation();
"object: ${Location.getInstance().aMapFlutterLocation == null}");
Location.getInstance().startLocation(context).then((value) {
refreshController.refreshCompleted();
});
}, },
child: ListView.builder( child: ListView.builder(
itemCount: storeList == null ? 0 : storeList.length, itemCount: storeList == null ? 0 : storeList.length,
@ -265,8 +267,12 @@ class _UnionPage extends State<UnionPage>
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/union_detail_page', Navigator.of(context).pushNamed(
arguments: {"id": storeList[position].id}); '/router/union_detail_page',
arguments: {
"id": storeList[position].id,
"storeName": storeList[position].storeName
});
}, },
child: buildStoreItem(storeList[position], position), child: buildStoreItem(storeList[position], position),
); );
@ -276,7 +282,7 @@ class _UnionPage extends State<UnionPage>
} }
BMFMapController _mapController; BMFMapController _mapController;
TextEditingController editingController = TextEditingController(); final TextEditingController editingController = TextEditingController();
void onMapCreated(BMFMapController controller) { void onMapCreated(BMFMapController controller) {
_mapController = controller; _mapController = controller;
@ -302,9 +308,7 @@ class _UnionPage extends State<UnionPage>
child: TextField( child: TextField(
textInputAction: TextInputAction.search, textInputAction: TextInputAction.search,
onEditingComplete: () { onEditingComplete: () {
Location.getInstance().startLocation(context).then((value) { startLocation();
refreshController.refreshCompleted();
});
}, },
controller: editingController, controller: editingController,
cursorHeight: 30.h, cursorHeight: 30.h,

8
lib/utils/location.dart

@ -48,17 +48,20 @@ class Location {
}); });
} }
Future<void> startLocation(context) async { Future<bool> startLocation(context) async {
if (!(await Permission.locationWhenInUse.serviceStatus.isEnabled)) { if (!(await Permission.locationWhenInUse.serviceStatus.isEnabled)) {
enableLocation(context); enableLocation(context);
return; return false;
} }
if (await Permission.location.isPermanentlyDenied) { if (await Permission.location.isPermanentlyDenied) {
requestDialog(context); requestDialog(context);
return false;
} else if (await Permission.location.isGranted) { } else if (await Permission.location.isGranted) {
aMapFlutterLocation.startLocation(); aMapFlutterLocation.startLocation();
return true;
} else if (await Permission.location.isUndetermined) { } else if (await Permission.location.isUndetermined) {
await Permission.location.request(); await Permission.location.request();
return false;
} else { } else {
if (Platform.isIOS) { if (Platform.isIOS) {
// //
@ -66,6 +69,7 @@ class Location {
} else { } else {
await Permission.location.request(); await Permission.location.request();
} }
return false;
} }
} }

67
lib/view_widget/classic_header.dart

@ -7,30 +7,33 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart' import 'package:flutter/material.dart'
hide RefreshIndicator, RefreshIndicatorState; hide RefreshIndicator, RefreshIndicatorState;
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/view_widget/rotate_container.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:rive/rive.dart'; import 'package:rive/rive.dart';
class MyHeader extends StatelessWidget { class MyHeader extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// return CustomHeader();
return MyClassicHeader( return MyClassicHeader(
completeIcon: const Icon(Icons.done, color: Color(0xFF32A060)), refreshStyle: RefreshStyle.Follow,
completeText: S.of(context).shuaxinchenggong, completeText: S.of(context).shuaxinchenggong,
failedText: S.of(context).shuaxinshibai, failedText: S.of(context).shuaxinshibai,
refreshingText: S.of(context).shuaxinzhong, refreshingText: S.of(context).shuaxinzhong,
releaseText: S.of(context).shifangshuaxin, releaseText: S.of(context).shifangshuaxin,
idleText: S.of(context).xialashuaxin, idleText: S.of(context).xialashuaxin,
completeTextStyle: TextStyle(color: Color(0xFF32A060)), iconPos: IconPosition.left,
refreshingIcon: RotateContainer( completeTextStyle: TextStyle(
rotated: true, color: Color(0xFF32A060),
child: Image.asset( ),
"assets/image/icon_header_loading.png", completeIcon: Icon(
width: 24, Icons.done,
height: 24, color: Color(0xFF32A060),
), ),
refreshingIcon: SpinKitCircle(
color: Colors.grey,
size: 24.w,
), ),
); );
} }
@ -44,14 +47,11 @@ class CustomHeader extends RefreshIndicator {
} }
class _CustomHeader extends RefreshIndicatorState<CustomHeader> { class _CustomHeader extends RefreshIndicatorState<CustomHeader> {
FlareControls flareController = FlareControls(); FlareControls flareController = FlareControls();
Artboard _riveArtboard; Artboard _riveArtboard;
RiveAnimationController _controllerIdle; RiveAnimationController _controllerIdle;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -72,7 +72,6 @@ class _CustomHeader extends RefreshIndicatorState<CustomHeader> {
@override @override
Widget buildContent(BuildContext context, RefreshStatus mode) { Widget buildContent(BuildContext context, RefreshStatus mode) {
if (_controllerIdle != null) { if (_controllerIdle != null) {
if (mode == RefreshStatus.idle) { if (mode == RefreshStatus.idle) {
_controllerIdle.isActive = false; _controllerIdle.isActive = false;
@ -213,21 +212,29 @@ class _ClassicHeaderState extends RefreshIndicatorState<MyClassicHeader> {
Widget buildContent(BuildContext context, RefreshStatus mode) { Widget buildContent(BuildContext context, RefreshStatus mode) {
Widget textWidget = _buildText(mode); Widget textWidget = _buildText(mode);
Widget iconWidget = _buildIcon(mode); Widget iconWidget = _buildIcon(mode);
List<Widget> children = <Widget>[iconWidget, textWidget]; List<Widget> children = <Widget>[
final Widget container = Wrap( iconWidget,
spacing: widget.spacing, SizedBox(
textDirection: widget.iconPos == IconPosition.left width: 10,
? TextDirection.ltr ),
: TextDirection.rtl, textWidget
direction: widget.iconPos == IconPosition.bottom || ];
widget.iconPos == IconPosition.top final Widget container = Row(
? Axis.vertical // spacing: widget.spacing,
: Axis.horizontal, // textDirection: widget.iconPos == IconPosition.left
crossAxisAlignment: WrapCrossAlignment.center, // ? TextDirection.ltr
verticalDirection: widget.iconPos == IconPosition.bottom // : TextDirection.rtl,
? VerticalDirection.up // direction: widget.iconPos == IconPosition.bottom ||
: VerticalDirection.down, // widget.iconPos == IconPosition.top
alignment: WrapAlignment.center, // ? Axis.vertical
// : Axis.horizontal,
// crossAxisAlignment: WrapCrossAlignment.center,
// verticalDirection: widget.iconPos == IconPosition.bottom
// ? VerticalDirection.up
// : VerticalDirection.down,
// alignment: WrapAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: children, children: children,
); );
return widget.outerBuilder != null return widget.outerBuilder != null

14
pubspec.lock

@ -328,6 +328,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.3" version: "1.1.3"
flutter_easyloading:
dependency: "direct main"
description:
name: flutter_easyloading
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.0"
flutter_html: flutter_html:
dependency: "direct main" dependency: "direct main"
description: description:
@ -375,6 +382,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.6" version: "2.1.6"
flutter_spinkit:
dependency: "direct main"
description:
name: flutter_spinkit
url: "https://pub.flutter-io.cn"
source: hosted
version: "5.0.0"
flutter_staggered_grid_view: flutter_staggered_grid_view:
dependency: "direct main" dependency: "direct main"
description: description:

3
pubspec.yaml

@ -86,6 +86,9 @@ dependencies:
sharesdk_plugin: ^1.3.0 sharesdk_plugin: ^1.3.0
flutter_spinkit: ^5.0.0
flutter_easyloading: ^3.0.0
rive: ^0.6.8 rive: ^0.6.8
flare_flutter: ^3.0.2 flare_flutter: ^3.0.2

Loading…
Cancel
Save