|
|
@@ -118,17 +118,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,
|
|
|
@@ -136,22 +142,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,
|
|
|
@@ -181,10 +193,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
|
|
|
@@ -274,15 +286,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,
|
|
|
));
|
|
|
}
|
|
|
|