|
|
@@ -119,17 +119,23 @@ class MainPage extends BasePage<MainController> {
|
|
|
if (controller.memberStatusInfo.value == null ||
|
|
|
controller.memberStatusInfo.value?.expired == true) {
|
|
|
return buildNoMemberView();
|
|
|
- } else if (todayTrack == null ||
|
|
|
- todayTrack.isRequestSuccess.value == false) {
|
|
|
- return buildTodayTrackLoadingView();
|
|
|
} else {
|
|
|
- return buildTodayTrackDetailView(todayTrack);
|
|
|
+ return buildTodayTrackView(todayTrack);
|
|
|
}
|
|
|
})),
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ Widget buildTodayTrackView(TodayTrackReportBean? todayTrack) {
|
|
|
+ return Stack(children: [
|
|
|
+ buildTodayTrackDetailView(todayTrack),
|
|
|
+ Visibility(
|
|
|
+ visible: todayTrack?.isRequestSuccess.value == false,
|
|
|
+ child: buildTodayTrackLoadingView()),
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+
|
|
|
Widget buildNoMemberView() {
|
|
|
return GestureDetector(
|
|
|
onTap: controller.onTrackNoMemberClick,
|
|
|
@@ -137,22 +143,28 @@ class MainPage extends BasePage<MainController> {
|
|
|
}
|
|
|
|
|
|
Widget buildTodayTrackLoadingView() {
|
|
|
- return Column(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: [
|
|
|
- CupertinoActivityIndicator(
|
|
|
- color: '#A3A3A5'.color,
|
|
|
- radius: 16.w,
|
|
|
- ),
|
|
|
- SizedBox(height: 15.w),
|
|
|
- Text(StringName.mainTodayTrackLoading,
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 14.sp, color: '#666666'.color.withOpacity(0.87)))
|
|
|
- ],
|
|
|
+ return Container(
|
|
|
+ width: double.infinity,
|
|
|
+ height: double.infinity,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: Colors.white, borderRadius: BorderRadius.circular(20.r)),
|
|
|
+ child: Column(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ CupertinoActivityIndicator(
|
|
|
+ color: '#A3A3A5'.color,
|
|
|
+ radius: 16.w,
|
|
|
+ ),
|
|
|
+ SizedBox(height: 15.w),
|
|
|
+ Text(StringName.mainTodayTrackLoading,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 14.sp, color: '#666666'.color.withOpacity(0.87)))
|
|
|
+ ],
|
|
|
+ ),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- Widget buildTodayTrackDetailView(TodayTrackReportBean todayTrackReportBean) {
|
|
|
+ Widget buildTodayTrackDetailView(TodayTrackReportBean? todayTrackReportBean) {
|
|
|
return GestureDetector(
|
|
|
behavior: HitTestBehavior.opaque,
|
|
|
onTap: controller.onTodayTraceClick,
|
|
|
@@ -182,10 +194,10 @@ class MainPage extends BasePage<MainController> {
|
|
|
}
|
|
|
|
|
|
Widget buildSelectedFriendTodayTrackDetailView(
|
|
|
- TodayTrackReportBean todayTrackReportBean) {
|
|
|
- final startAddr = todayTrackReportBean.startPoint?.addr;
|
|
|
+ TodayTrackReportBean? todayTrackReportBean) {
|
|
|
+ final startAddr = todayTrackReportBean?.startPoint?.addr;
|
|
|
|
|
|
- final errorAddr = todayTrackReportBean.exceptionPoint?.addr;
|
|
|
+ final errorAddr = todayTrackReportBean?.exceptionPoint?.addr;
|
|
|
|
|
|
MainTrackType startPointType = startAddr?.isNotEmpty == true
|
|
|
? MainTrackType.startPoint
|
|
|
@@ -275,15 +287,16 @@ class MainPage extends BasePage<MainController> {
|
|
|
));
|
|
|
}
|
|
|
|
|
|
- Widget buildTodayMapView(TodayTrackReportBean todayTrackReportBean) {
|
|
|
+ Widget buildTodayMapView(TodayTrackReportBean? todayTrackReportBean) {
|
|
|
return ClipRRect(
|
|
|
borderRadius: BorderRadius.circular(8.r),
|
|
|
child: MapWidget(
|
|
|
+ controller: controller.todayTrackSmallMapController,
|
|
|
isShowLogo: false,
|
|
|
interactionIsEnabled: false,
|
|
|
- mapPadding: todayTrackReportBean.mapPadding,
|
|
|
- markers: todayTrackReportBean.markers,
|
|
|
- polyline: todayTrackReportBean.polylines,
|
|
|
+ mapPadding: todayTrackReportBean?.mapPadding,
|
|
|
+ markers: todayTrackReportBean?.markers,
|
|
|
+ polyline: todayTrackReportBean?.polylines,
|
|
|
));
|
|
|
}
|
|
|
|
|
|
@@ -494,12 +507,20 @@ class MainPage extends BasePage<MainController> {
|
|
|
Row(
|
|
|
children: [
|
|
|
Obx(() {
|
|
|
- return Text(
|
|
|
- controller.selectedFriend?.getUserNickName() ?? '',
|
|
|
- style: TextStyle(
|
|
|
- fontWeight: FontWeight.bold,
|
|
|
- fontSize: 16.sp,
|
|
|
- color: '#202020'.color),
|
|
|
+ return ConstrainedBox(
|
|
|
+ constraints: BoxConstraints(
|
|
|
+ maxWidth: 0.26.sw,
|
|
|
+ ),
|
|
|
+ child: Text(
|
|
|
+ maxLines: 1,
|
|
|
+ controller.selectedFriend?.getUserNickName() ??
|
|
|
+ '',
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
+ style: TextStyle(
|
|
|
+ fontWeight: FontWeight.bold,
|
|
|
+ fontSize: 16.sp,
|
|
|
+ color: '#202020'.color),
|
|
|
+ ),
|
|
|
);
|
|
|
}),
|
|
|
SizedBox(width: 7.w),
|
|
|
@@ -518,7 +539,7 @@ class MainPage extends BasePage<MainController> {
|
|
|
onTap: () => controller.onViewTraceClick(
|
|
|
controller.selectedFriend!),
|
|
|
child: Container(
|
|
|
- margin: EdgeInsets.only(right: 16.w),
|
|
|
+ margin: EdgeInsets.only(right: 12.w),
|
|
|
decoration: getPrimaryBtnDecoration(32.w),
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
horizontal: 21.w, vertical: 5.w),
|