Browse Source

Merge branches 'dev' and 'master' of https://git.lotus-wallet.com/fmk/huixiang_app

 Conflicts:
	lib/home/points_mall_page.dart
	lib/union/union_page.dart
null_safety
哈哈哈 3 years ago
parent
commit
8f4801c049
  1. BIN
      assets/image/2x/icon_mine_card.png
  2. BIN
      assets/image/2x/icon_mine_order.png
  3. BIN
      assets/image/3x/icon_mine_card.png
  4. BIN
      assets/image/3x/icon_mine_order.png
  5. BIN
      assets/image/icon_mine_card.png
  6. BIN
      assets/image/icon_mine_order.png
  7. 5
      lib/home/points_mall_page.dart
  8. 32
      lib/integral/integral_page.dart
  9. 21
      lib/integral_store/integral_store_details_page.dart
  10. 4
      lib/mine/mine_page.dart
  11. 5
      lib/mine/mine_vip_level_page.dart
  12. 97
      lib/mine/vip_detail_page.dart
  13. 6
      lib/union/union_details_page.dart
  14. 343
      lib/union/union_page.dart
  15. 8
      pubspec.lock

BIN
assets/image/2x/icon_mine_card.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
assets/image/2x/icon_mine_order.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 966 B

BIN
assets/image/3x/icon_mine_card.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
assets/image/3x/icon_mine_order.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
assets/image/icon_mine_card.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 866 B

After

Width:  |  Height:  |  Size: 875 B

BIN
assets/image/icon_mine_order.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 605 B

After

Width:  |  Height:  |  Size: 510 B

5
lib/home/points_mall_page.dart

@ -440,8 +440,9 @@ class _PointsMallPage extends State<PointsMallPage>
borderRadius: BorderRadius.only(topRight: Radius.circular(4)),
child: Image.asset(
"assets/image/icon_hot_right_top.png",
width: 36,
height: 36,
width: 36.w,
height: 36.h,
fit: BoxFit.cover,
),
),
),

32
lib/integral/integral_page.dart

@ -249,11 +249,12 @@ class _IntegralPage extends State<IntegralPage> {
task.name,
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w400,
color: Color(0xFF353535),
),
),
SizedBox(
width: 7,
height: 7.h,
),
Row(
children: [
@ -272,6 +273,7 @@ class _IntegralPage extends State<IntegralPage> {
"${task.complateNum ?? task.conplateNum}/${task.limitDay}"),
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w400,
color: Color(0xFF727272),
),
),
@ -291,7 +293,7 @@ class _IntegralPage extends State<IntegralPage> {
radius: 12,
fontSize: 14.sp,
fontWeight: FontWeight.bold,
padding: EdgeInsets.fromLTRB(12.w, 2.h, 12.w, 2.h),
padding: EdgeInsets.fromLTRB(12.w, 4.h, 12.w, 4.h),
)
],
),
@ -320,7 +322,7 @@ class _IntegralPage extends State<IntegralPage> {
style: TextStyle(
color: Color(0xFF353535),
fontSize: 14.sp,
fontWeight: FontWeight.bold),
fontWeight: FontWeight.w500),
),
SizedBox(
height: 10.h,
@ -331,7 +333,8 @@ class _IntegralPage extends State<IntegralPage> {
S.of(context).shenmijifendali,
style: TextStyle(
color: Color(0xFF727272),
fontSize: 12.sp,
fontWeight: FontWeight.bold,
fontSize: 10.sp,
),
),
),
@ -374,7 +377,7 @@ class _IntegralPage extends State<IntegralPage> {
? Colors.white
: Color(0xFF353535),
fontSize: 14.sp,
fontWeight: FontWeight.bold,
fontWeight: FontWeight.w500,
),
),
Container(
@ -441,6 +444,9 @@ class _IntegralPage extends State<IntegralPage> {
fontSize: 16.sp,
color: Color(0xFF353535)),
),
SizedBox(
height: 10.h,
),
Text(
S.of(context).lianxuqiandaolingqushuangbeijifen,
style: TextStyle(
@ -471,6 +477,8 @@ class _IntegralPage extends State<IntegralPage> {
child: Container(
alignment: Alignment.center,
child: RoundButton(
width: 106,
height: 34,
text: (signInfo != null && signInfo.todayHasSignin)
? S.of(context).yiqiandao
: S.of(context).lijiqiandao,
@ -479,6 +487,7 @@ class _IntegralPage extends State<IntegralPage> {
? Colors.grey
: Color(0xFF32A060),
fontSize: 16.sp,
fontWeight: FontWeight.w400,
padding: EdgeInsets.fromLTRB(16.w, 6.h, 16.w, 6.h),
radius: 4,
),
@ -499,7 +508,9 @@ class _IntegralPage extends State<IntegralPage> {
BaseData baseData = await apiService.signIn();
if (baseData != null && baseData.isSuccess) {
querySignInfo();
SmartDialog.show(widget: SignInWidget("${signInfo.signInList.length + 1}", "${signInfo.rewardList[signInfo.signInList.length]}"));
SmartDialog.show(
widget: SignInWidget("${signInfo.signInList.length + 1}",
"${signInfo.rewardList[signInfo.signInList.length]}"));
}
}
@ -519,7 +530,7 @@ class _IntegralPage extends State<IntegralPage> {
Text(
signInfo != null ? "${signInfo.point}" : "0",
style: TextStyle(
fontWeight: FontWeight.bold,
fontWeight: FontWeight.w500,
fontSize: 21.sp,
color: Colors.white,
),
@ -531,6 +542,7 @@ class _IntegralPage extends State<IntegralPage> {
S.of(context).wodejifenzhi,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w400,
color: Color(0xFFF2F2F2),
),
)
@ -548,7 +560,8 @@ class _IntegralPage extends State<IntegralPage> {
Navigator.of(context)
.pushNamed('/router/mine_vip_level_page', arguments: {
"rankLevel": rankLevel,
"createTime": (userinfo != null) ? "${userinfo.createTime}" : "",
"createTime":
(userinfo != null) ? "${userinfo.createTime}" : "",
"points":
(userinfo != null) ? int.tryParse(userinfo.points) : 0,
});
@ -562,7 +575,7 @@ class _IntegralPage extends State<IntegralPage> {
? "${signInfo.rank.rankName.replaceAll("会员", "")}"
: "",
style: TextStyle(
fontWeight: FontWeight.bold,
fontWeight: FontWeight.w500,
fontSize: 21.sp,
color: Colors.white,
),
@ -578,6 +591,7 @@ class _IntegralPage extends State<IntegralPage> {
S.of(context).wodehuiyuandengji,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w400,
color: Color(0xFFF2F2F2),
),
),

21
lib/integral_store/integral_store_details_page.dart

@ -102,16 +102,15 @@ class _IntegralStoreDetailsPage extends State {
assetUriMatcher(): assetImageRender(),
networkSourceMatcher(extension: "svg"):
svgNetworkImageRender(),
networkSourceMatcher():
networkImageRender(
loadingWidget: () {
// return Image.asset("assets/image/default_1.png",);
return Container();
},
// mapUrl: (url) {
// print("objectUrl: $url");
// return "$url?imageMogr2/format/webp/blur/1x0/quality/75";
// }
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
// return Image.asset("assets/image/default_1.png",);
return Container();
},
// mapUrl: (url) {
// print("objectUrl: $url");
// return "$url?imageMogr2/format/webp/blur/1x0/quality/75";
// }
),
},
),
@ -225,6 +224,7 @@ class _IntegralStoreDetailsPage extends State {
: S.of(context).yiduihuanjian("${goods.sales}"),
style: TextStyle(
fontSize: 10.sp,
fontWeight: FontWeight.w400,
color: Color(0xFFA29E9E),
),
),
@ -242,6 +242,7 @@ class _IntegralStoreDetailsPage extends State {
goods == null ? "" : goods.description,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w400,
color: Color(0xFF727272),
),
),

4
lib/mine/mine_page.dart

@ -499,7 +499,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
Text(
S.of(context).kaquan,
style: TextStyle(
fontWeight: FontWeight.w600,
fontWeight: FontWeight.bold,
fontSize: 16.sp,
color: Color(0xFF353535),
),
@ -512,7 +512,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
width: 2.w,
height: 32.h,
margin: EdgeInsets.only(left: 20.w, right: 20.w),
color: Color(0xFFABABAB),
color: Color(0xFFF7F7F7),
),
Expanded(
flex: 1,

5
lib/mine/mine_vip_level_page.dart

@ -135,6 +135,7 @@ class _MineVipLevelPage extends State<MineVipLevelPage> {
style: TextStyle(
textBaseline: TextBaseline.alphabetic,
fontSize: 14.sp,
fontWeight: FontWeight.w400,
color: Color(0xFF353535),
),
),
@ -222,6 +223,7 @@ class _MineVipLevelPage extends State<MineVipLevelPage> {
style: TextStyle(
textBaseline: TextBaseline.alphabetic,
fontSize: 14.sp,
fontWeight: FontWeight.w400,
color: Color(0xFF353535),
),
),
@ -249,6 +251,7 @@ class _MineVipLevelPage extends State<MineVipLevelPage> {
S.of(context).youhuiquanwufajileijifen,
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w400,
color: Color(0xFF353535),
),
),
@ -278,6 +281,7 @@ class _MineVipLevelPage extends State<MineVipLevelPage> {
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w400,
color: Color(0xFF353535),
),
),
@ -289,6 +293,7 @@ class _MineVipLevelPage extends State<MineVipLevelPage> {
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w400,
color: Color(0xFF353535),
),
),

97
lib/mine/vip_detail_page.dart

@ -194,7 +194,7 @@ class _VipDetailPage extends State<VipDetailPage> {
fadeSrc: "assets/image/default_1.png",
),
SizedBox(
width: 12.w,
width: 8.w,
),
Expanded(
child: Container(
@ -212,7 +212,7 @@ class _VipDetailPage extends State<VipDetailPage> {
vipCard != null ? vipCard.storeName : "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 20.sp,
fontSize: 14.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
@ -228,10 +228,10 @@ class _VipDetailPage extends State<VipDetailPage> {
TextSpan(
children: [
TextSpan(
text: "会员卡",
text: S.of(context).huiyuanka,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
fontWeight: FontWeight.w400,
color: Colors.black,
),
),
@ -263,7 +263,7 @@ class _VipDetailPage extends State<VipDetailPage> {
children: [
TextSpan(
text:
"¥${vipCard != null ? vipCard.balance : ""}",
"¥ ${vipCard != null ? vipCard.balance : ""}",
style: TextStyle(
fontSize: 24.sp,
fontWeight: FontWeight.w500,
@ -348,10 +348,10 @@ class _VipDetailPage extends State<VipDetailPage> {
child: Text(
vipCard != null
? "${vipCard.id.substring(0, 4)} "
"${vipCard.id.substring(4, 8)} "
"${vipCard.id.substring(8, 12)} "
"${vipCard.id.substring(12, 16)} "
"${vipCard.id.substring(16, vipCard.id.length)}"
"${vipCard.id.substring(4, 8)} "
"${vipCard.id.substring(8, 12)} "
"${vipCard.id.substring(12, 16)} "
"${vipCard.id.substring(16, vipCard.id.length)}"
: "",
maxLines: 1,
textAlign: TextAlign.center,
@ -361,11 +361,11 @@ class _VipDetailPage extends State<VipDetailPage> {
wordSpacing: vipCard == null
? 10
: (MediaQuery.of(context).size.width - 64.w) /
(((vipCard.id.length) * 4)),
(((vipCard.id.length) * 4)),
letterSpacing: vipCard == null
? 8
: (MediaQuery.of(context).size.width - 64.w) /
(((vipCard.id.length) * 4)),
(((vipCard.id.length) * 4)),
),
),
),
@ -407,10 +407,11 @@ class _VipDetailPage extends State<VipDetailPage> {
),
)),
GestureDetector(
onTap: (){
Navigator.of(context).pushNamed('/router/union_detail_page',arguments: {"id": orderInfo.storeId});
onTap: () {
Navigator.of(context).pushNamed('/router/union_detail_page',
arguments: {"id": orderInfo.storeId});
},
child:Text(
child: Text(
"查看",
style: TextStyle(
fontSize: 12.sp,
@ -469,7 +470,7 @@ class _VipDetailPage extends State<VipDetailPage> {
flex: 1,
child: Text(
(orderInfo.storeVO.openStartTime == null &&
orderInfo.storeVO.openEndTime == null)
orderInfo.storeVO.openEndTime == null)
? S.of(context).quantian
: "${orderInfo.storeVO.openStartTime.substring(0, orderInfo.storeVO.openStartTime.lastIndexOf(":"))}-${orderInfo.storeVO.openEndTime.substring(0, orderInfo.storeVO.openEndTime.lastIndexOf(":"))}",
style: TextStyle(
@ -514,40 +515,40 @@ class _VipDetailPage extends State<VipDetailPage> {
return products
.map(
(e) => Container(
margin: EdgeInsets.symmetric(horizontal: 2.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
MImage(
e.skuImg,
width: 75.w,
height: 75.h,
fit: BoxFit.contain,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
SizedBox(
height: 4.h,
),
if (isRemake)
Container(
width: 75.w,
child: Text(
e.productName,
maxLines: 1,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
margin: EdgeInsets.symmetric(horizontal: 2.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
MImage(
e.skuImg,
width: 75.w,
height: 75.h,
fit: BoxFit.contain,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
),
],
),
),
)
SizedBox(
height: 4.h,
),
if (isRemake)
Container(
width: 75.w,
child: Text(
e.productName,
maxLines: 1,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
),
),
],
),
),
)
.toList();
}
}

6
lib/union/union_details_page.dart

@ -721,7 +721,8 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
receiveVip() async {
BaseData baseData = await apiService.minLogin(storeInfo.id);
if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast(S.of(context).lingquchenggong, alignment: Alignment.center);
SmartDialog.showToast(S.of(context).lingquchenggong,
alignment: Alignment.center);
setState(() {
isReceive = false;
});
@ -909,7 +910,8 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
_loginMin() async {
if (storeInfo == null) return;
if (!isEnable()) {
SmartDialog.showToast(S.of(context).zanbuzhichixianshangdiancan, alignment: Alignment.center);
SmartDialog.showToast(S.of(context).zanbuzhichixianshangdiancan,
alignment: Alignment.center);
return;
}
BaseData baseData = await apiService.minLogin(storeInfo.id);

343
lib/union/union_page.dart

@ -1,14 +1,15 @@
import 'dart:io';
import 'dart:ui';
import 'package:amap_flutter_location/amap_flutter_location.dart';
import 'package:amap_flutter_location/amap_location_option.dart';
import 'package:android_intent_plus/android_intent.dart';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_baidu_mapapi_map/flutter_baidu_mapapi_map.dart';
import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/main.dart';
@ -20,13 +21,15 @@ import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/item_title.dart';
import 'package:amap_flutter_base/amap_flutter_base.dart';
import 'package:amap_flutter_map/amap_flutter_map.dart';
import 'package:huixiang/view_widget/request_permission.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'dart:typed_data';
import 'package:flutter/rendering.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
class UnionPage extends StatefulWidget {
@override
@ -38,15 +41,27 @@ class UnionPage extends StatefulWidget {
class _UnionPage extends State<UnionPage>
with AutomaticKeepAliveClientMixin, WidgetsBindingObserver {
//使true
CustomStyleOptions _customStyleOptions = CustomStyleOptions(false);
//
void _loadCustomData() async {
if (null == _customStyleOptions) {
_customStyleOptions = CustomStyleOptions(false);
}
ByteData styleByteData =
await rootBundle.load('assets/map_style/style.data');
_customStyleOptions.styleData = styleByteData.buffer.asUint8List();
ByteData styleExtraByteData =
await rootBundle.load('assets/map_style/style_extra.data');
_customStyleOptions.styleExtraData =
styleExtraByteData.buffer.asUint8List();
//setState修改CustomStyleOptions的enable为true
setState(() {
_mapController.setCustomMapStyle('assets/map_style/chatian.sty', 0);
_customStyleOptions.enabled = true;
});
}
LocationFlutterPlugin aMapFlutterLocation;
AMapFlutterLocation aMapFlutterLocation;
RefreshController refreshController =
RefreshController(initialRefresh: false);
@ -55,6 +70,7 @@ class _UnionPage extends State<UnionPage>
super.dispose();
WidgetsBinding.instance.removeObserver(this);
aMapFlutterLocation.stopLocation();
aMapFlutterLocation.destroy();
refreshController.dispose();
}
@ -89,17 +105,19 @@ class _UnionPage extends State<UnionPage>
WidgetsBinding.instance.addObserver(this);
if (aMapFlutterLocation == null) {
aMapFlutterLocation = LocationFlutterPlugin();
aMapFlutterLocation.onResultCallback().listen((event) {
AMapFlutterLocation.setApiKey("f39d1daa020a56f208eb2519f63e9534",
"feaae7986201b571cace1b83728be5bb");
aMapFlutterLocation = AMapFlutterLocation();
aMapFlutterLocation.onLocationChanged().listen((event) {
if (event != null &&
event["latitude"] != null &&
event["longitude"] != null) {
print("location: $event");
if (event["latitude"] is String && event["longitude"] is String) {
latLng = BMFCoordinate(double.tryParse(event["latitude"]),
latLng = LatLng(double.tryParse(event["latitude"]),
double.tryParse(event["longitude"]));
} else {
latLng = BMFCoordinate(event["latitude"], event["longitude"]);
latLng = LatLng(event["latitude"], event["longitude"]);
}
saveLatLng(
latLng, event["province"], event["city"], event["district"]);
@ -111,10 +129,12 @@ class _UnionPage extends State<UnionPage>
event["district"],
editingController.text);
if (_mapController != null)
_mapController.updateMapOptions(BMFMapOptions(
center: latLng,
zoomLevel: 15,
));
_mapController.moveCamera(
CameraUpdate.newCameraPosition(CameraPosition(
target: latLng,
zoom: 15.0,
)),
);
}
});
@ -126,25 +146,15 @@ class _UnionPage extends State<UnionPage>
});
}
aMapFlutterLocation.prepareLoc({
"coorType": "bd09ll",
"isNeedAddres": false,
"isNeedAltitude": false,
"isNeedLocationPoiList": false,
"isNeedLocationDescribe": false,
"isNeedNewVersionRgc": false,
"scanspan": 0,
"openGps": true,
"locationMode": 2,
}, {
"locationMode": "kCLLocationAccuracyBest",
"locationTimeout": 10,
"reGeocodeTimeout": 10,
"activityType": "CLActivityTypeAutomotiveNavigation",
"BMKLocationCoordinateType": "BMKLocationCoordinateTypeBMK09LL",
"BMKLocationCoordinateType": "BMKLocationCoordinateTypeBMK09LL",
"isNeedNewVersionRgc": false,
});
aMapFlutterLocation.setLocationOption(AMapLocationOption(
needAddress: true,
onceLocation: true,
locationMode: AMapLocationMode.Hight_Accuracy,
desiredAccuracy: DesiredAccuracy.HundredMeters,
desiredLocationAccuracyAuthorizationMode:
AMapLocationAccuracyAuthorizationMode.FullAndReduceAccuracy,
pausesLocationUpdatesAutomatically: true,
));
_loadCustomData();
@ -152,9 +162,9 @@ class _UnionPage extends State<UnionPage>
startLocation();
}
BMFCoordinate latLng;
LatLng latLng;
saveLatLng(BMFCoordinate latLng, province, city, district) async {
saveLatLng(LatLng latLng, province, city, district) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString("latitude", "${latLng.latitude}");
await prefs.setString("longitude", "${latLng.longitude}");
@ -176,7 +186,7 @@ class _UnionPage extends State<UnionPage>
value.containsKey("city") &&
value.containsKey("district"))
{
latLng = BMFCoordinate(double.tryParse(value.getString("latitude")),
latLng = LatLng(double.tryParse(value.getString("latitude")),
double.tryParse(value.getString("longitude"))),
queryStore(
value.getString("latitude"),
@ -188,10 +198,14 @@ class _UnionPage extends State<UnionPage>
),
setState(() {
if (_mapController != null) {
_mapController.updateMapOptions(BMFMapOptions(
center: latLng,
zoomLevel: 15,
));
_mapController.moveCamera(
CameraUpdate.newCameraPosition(
CameraPosition(
target: latLng,
zoom: 15.0,
),
),
);
}
})
}
@ -221,7 +235,7 @@ class _UnionPage extends State<UnionPage>
storeList = (baseData.data as List<dynamic>)
.map((e) => Store.fromJson(e))
.toList();
// buildMarker();
buildMarker();
refreshController.refreshCompleted();
if (mounted) setState(() {});
} else {
@ -229,20 +243,34 @@ class _UnionPage extends State<UnionPage>
}
}
// buildMarker() async {
// markers.clear();
// markers.addAll(storeList.map((element) => BMFMarker(
// position: BMFCoordinate(double.tryParse(element.latitude),
// double.tryParse(element.longitude)),
// centerOffset: BMFPoint(0.5, 0.9),
// enabled: false,
// icon: "assets/image/icon_map_marker.png",
// draggable: false,
// )));
// if (mounted) setState(() {});
// }
//
// List<BMFMarker> markers = [];
RepaintBoundary repaintBoundary;
buildMarker() async {
markers.clear();
BitmapDescriptor bitmapDescriptor = await BitmapDescriptor.fromAssetImage(
ImageConfiguration(
bundle: DefaultAssetBundle.of(context),
devicePixelRatio: MediaQuery.of(context)?.devicePixelRatio ?? 1.0,
locale: Localizations.localeOf(context),
textDirection: Directionality.of(context),
size: Size(35.w, 35.h),
platform: defaultTargetPlatform,
),
"assets/image/icon_map_marker.png");
markers.addAll(storeList.map((element) => Marker(
position: LatLng(double.tryParse(element.latitude),
double.tryParse(element.longitude)),
anchor: Offset(0.5, 0.9),
clickable: false,
icon: bitmapDescriptor,
infoWindowEnable: true,
)));
if (mounted) setState(() {});
}
List<Marker> markers = [];
@override
Widget build(BuildContext context) {
@ -262,7 +290,7 @@ class _UnionPage extends State<UnionPage>
PreferredSize(
preferredSize: Size(double.infinity, 52.h),
child: Container(
padding: EdgeInsets.only(top: 6.h),
padding: EdgeInsets.only(top: 26.5.h),
color: Color(0xFFFAFAFA),
child: ItemTitle(
text: S.of(context).jingbilianmenghuiyuandian,
@ -278,17 +306,24 @@ class _UnionPage extends State<UnionPage>
// headerSliverBuilder: (context, inner) {
// return [
// SliverOverlapAbsorber(
// sliver: buildSliverAppBar(BMFMapWidget(
// mapOptions: BMFMapOptions(
// center: BMFCoordinate(30.553111, 114.342366),
// zoomLevel: 12,
// sliver: buildSliverAppBar(AMapWidget(
// initialCameraPosition: CameraPosition(
// target: LatLng(30.553111, 114.342366),
// zoom: 12.0,
// ),
// onBMFMapCreated: onMapCreated,
// // customStyleOptions: _customStyleOptions,
// // gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[
// // Factory<OneSequenceGestureRecognizer>(
// // () => EagerGestureRecognizer()),
// // ].toSet(),
// onMapCreated: onMapCreated,
// apiKey: aMapApiKeys,
// touchPoiEnabled: true,
// markers: markers.toSet(),
// scrollGesturesEnabled: true,
// customStyleOptions: _customStyleOptions,
// onPoiTouched: (poiTouch) {
// FocusScope.of(context).requestFocus(FocusNode());
// },
// gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[
// Factory<OneSequenceGestureRecognizer>(
// () => EagerGestureRecognizer()),
// ].toSet(),
// )),
// handle:
// NestedScrollView.sliverOverlapAbsorberHandleFor(context),
@ -333,7 +368,7 @@ class _UnionPage extends State<UnionPage>
itemCount: storeList == null ? 0 : storeList.length,
// padding: EdgeInsets.only(top: 8.h, bottom: 84.h + (375.h - 88.h) + 4.h),
padding: EdgeInsets.only(
top: 8.h, bottom: 84.h /* + (375.h - 88.h) + 4.h*/),
top: 17.h, bottom: 84.h /* + (375.h - 88.h) + 4.h*/),
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
@ -425,10 +460,10 @@ class _UnionPage extends State<UnionPage>
});
}
BMFMapController _mapController;
AMapController _mapController;
TextEditingController editingController = TextEditingController();
void onMapCreated(BMFMapController controller) {
void onMapCreated(AMapController controller) {
_mapController = controller;
}
@ -438,17 +473,16 @@ class _UnionPage extends State<UnionPage>
margin: EdgeInsets.fromLTRB(16.w, 40, 16.w, 0),
padding: EdgeInsets.fromLTRB(0, 6.h, 0, 6.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(4)),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(4)),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
]),
child: TextField(
textInputAction: TextInputAction.search,
onEditingComplete: () {
@ -479,81 +513,81 @@ class _UnionPage extends State<UnionPage>
);
}
// Widget buildSliverAppBar(BMFMapWidget map) {
// return SliverAppBar(
// //
// // floating: true,
// // snap: true,
// pinned: true,
// backgroundColor: Color(0xFFFAFAFA),
// elevation: 0,
// automaticallyImplyLeading: false,
// title: Container(
// height: 36.h,
// margin: EdgeInsets.fromLTRB(16.w, 0, 16.w, 0),
// padding: EdgeInsets.fromLTRB(0, 6.h, 0, 6.h),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.all(Radius.circular(4)),
// boxShadow: [
// BoxShadow(
// color: Colors.black.withAlpha(12),
// offset: Offset(0, 3),
// blurRadius: 14,
// spreadRadius: 0,
// )
// ]),
// child: TextField(
// textInputAction: TextInputAction.search,
// onEditingComplete: () {
// startLocation();
// },
// controller: editingController,
// cursorHeight: 30.h,
// decoration: InputDecoration(
// contentPadding: EdgeInsets.symmetric(vertical: 12.h),
// prefixIcon: Icon(
// Icons.search,
// size: 24,
// color: Colors.black,
// ),
// suffixIcon: InkWell(
// onTap: () {
// editingController.clear();
// },
// child: Icon(
// Icons.close,
// size: 19,
// color: Colors.grey,
// ),
// ),
// border: InputBorder.none,
// ),
// ),
// ),
// flexibleSpace: FlexibleSpaceBar(
// background: Container(
// child: map,
// ),
// ),
// expandedHeight: 375.h,
// bottom: PreferredSize(
// preferredSize: Size(double.infinity, 52.h),
// child: Container(
// padding: EdgeInsets.only(top: 6.h),
// color: Color(0xFFFAFAFA),
// child: ItemTitle(
// text: S.of(context).jingbilianmenghuiyuandian,
// imgPath: "assets/image/icon_union_store.png",
// ),
// ),
// ),
// );
// }
Widget buildSliverAppBar(AMapWidget map) {
return SliverAppBar(
//
// floating: true,
// snap: true,
pinned: true,
backgroundColor: Color(0xFFFAFAFA),
elevation: 0,
automaticallyImplyLeading: false,
title: Container(
height: 36.h,
margin: EdgeInsets.fromLTRB(16.w, 0, 16.w, 0),
padding: EdgeInsets.fromLTRB(0, 6.h, 0, 6.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(4)),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
]),
child: TextField(
textInputAction: TextInputAction.search,
onEditingComplete: () {
startLocation();
},
controller: editingController,
cursorHeight: 30.h,
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 12.h),
prefixIcon: Icon(
Icons.search,
size: 24,
color: Colors.black,
),
suffixIcon: InkWell(
onTap: () {
editingController.clear();
},
child: Icon(
Icons.close,
size: 19,
color: Colors.grey,
),
),
border: InputBorder.none,
),
),
),
flexibleSpace: FlexibleSpaceBar(
background: Container(
child: map,
),
),
expandedHeight: 375.h,
bottom: PreferredSize(
preferredSize: Size(double.infinity, 52.h),
child: Container(
padding: EdgeInsets.only(top: 6.h),
color: Color(0xFFFAFAFA),
child: ItemTitle(
text: S.of(context).jingbilianmenghuiyuandian,
imgPath: "assets/image/icon_union_store.png",
),
),
),
);
}
Widget buildStoreItem(Store store, position) {
return Container(
margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 8.h),
margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 16.h),
padding: EdgeInsets.fromLTRB(20.w, 20.h, 20.w, 20.h),
decoration: BoxDecoration(
color: Colors.white,
@ -617,9 +651,6 @@ class _UnionPage extends State<UnionPage>
),
],
),
SizedBox(
height: 4.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
@ -658,10 +689,6 @@ class _UnionPage extends State<UnionPage>
),
],
),
// Expanded(
// child: Container(),
// flex: 1,
// ),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,

8
pubspec.lock

@ -35,7 +35,7 @@ packages:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.5.0"
version: "2.6.1"
barcode:
dependency: transitive
description:
@ -886,7 +886,7 @@ packages:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.19"
version: "0.3.0"
timing:
dependency: transitive
description:
@ -1049,7 +1049,7 @@ packages:
name: win32
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.5"
version: "2.2.5"
xdg_directories:
dependency: transitive
description:
@ -1072,5 +1072,5 @@ packages:
source: hosted
version: "3.1.0"
sdks:
dart: ">=2.12.0 <3.0.0"
dart: ">=2.13.0 <3.0.0"
flutter: ">=2.0.0"

Loading…
Cancel
Save