|
|
|
@ -21,6 +21,8 @@ import 'package:provider/provider.dart';
|
|
|
|
class TrackingScreen extends StatelessWidget {
|
|
|
|
class TrackingScreen extends StatelessWidget {
|
|
|
|
final OrderTrackingState state = OrderTrackingState.ended;
|
|
|
|
final OrderTrackingState state = OrderTrackingState.ended;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const TrackingScreen({super.key});
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
@ -45,7 +47,7 @@ class TrackingScreen extends StatelessWidget {
|
|
|
|
animationSection(),
|
|
|
|
animationSection(),
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
spacing: 16.h,
|
|
|
|
spacing: 16.h,
|
|
|
|
children: [OrderStatus(context), OrderTrackingId(), ContactSection()],
|
|
|
|
children: [orderStatus(context), orderTrackingId(), contactSection()],
|
|
|
|
).paddingAll(16.h),
|
|
|
|
).paddingAll(16.h),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
))),
|
|
|
|
@ -59,12 +61,11 @@ class TrackingScreen extends StatelessWidget {
|
|
|
|
case OrderTrackingState.returning:
|
|
|
|
case OrderTrackingState.returning:
|
|
|
|
return Lottie.asset(AppAnimations.ambulance, repeat: true, reverse: false, width: 260.h, height: 200.h);
|
|
|
|
return Lottie.asset(AppAnimations.ambulance, repeat: true, reverse: false, width: 260.h, height: 200.h);
|
|
|
|
case OrderTrackingState.ended:
|
|
|
|
case OrderTrackingState.ended:
|
|
|
|
default:
|
|
|
|
|
|
|
|
return Lottie.asset(AppAnimations.checkmark, repeat: true, width: 260.h, height: 200.h);
|
|
|
|
return Lottie.asset(AppAnimations.checkmark, repeat: true, width: 260.h, height: 200.h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
OrderStatus(BuildContext context) {
|
|
|
|
orderStatus(BuildContext context) {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
padding: EdgeInsets.all(16.h),
|
|
|
|
padding: EdgeInsets.all(16.h),
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
@ -137,7 +138,6 @@ class TrackingScreen extends StatelessWidget {
|
|
|
|
children: [dividerSection, doctorSection(), mapSection(context)],
|
|
|
|
children: [dividerSection, doctorSection(), mapSection(context)],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
case OrderTrackingState.ended:
|
|
|
|
case OrderTrackingState.ended:
|
|
|
|
default:
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
spacing: 12.h,
|
|
|
|
spacing: 12.h,
|
|
|
|
@ -200,16 +200,17 @@ class TrackingScreen extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
|
|
Widget mapForRequestedCoordinate(BuildContext context) {
|
|
|
|
Widget mapForRequestedCoordinate(BuildContext context) {
|
|
|
|
// return SizedBox.shrink();
|
|
|
|
// return SizedBox.shrink();
|
|
|
|
if (context.read<EmergencyServicesViewModel>().isGMSAvailable || Platform.isIOS)
|
|
|
|
if (context.read<EmergencyServicesViewModel>().isGMSAvailable || Platform.isIOS) {
|
|
|
|
return GMSMap(
|
|
|
|
return GMSMap(
|
|
|
|
myLocationEnabled: false,
|
|
|
|
myLocationEnabled: false,
|
|
|
|
currentLocation: context.read<EmergencyServicesViewModel>().getGMSLocation(),
|
|
|
|
currentLocation: context.read<EmergencyServicesViewModel>().getGMSLocation(),
|
|
|
|
onCameraMoved: (value) => context.read<EmergencyServicesViewModel>().handleGMSMapCameraMoved(value));
|
|
|
|
onCameraMoved: (value) => context.read<EmergencyServicesViewModel>().handleGMSMapCameraMoved(value));
|
|
|
|
else
|
|
|
|
} else {
|
|
|
|
return HMSMap(
|
|
|
|
return HMSMap(
|
|
|
|
myLocationEnabled: false,
|
|
|
|
myLocationEnabled: false,
|
|
|
|
currentLocation: context.read<EmergencyServicesViewModel>().getHMSLocation(),
|
|
|
|
currentLocation: context.read<EmergencyServicesViewModel>().getHMSLocation(),
|
|
|
|
onCameraMoved: (value) => context.read<EmergencyServicesViewModel>().handleHMSMapCameraMoved(value));
|
|
|
|
onCameraMoved: (value) => context.read<EmergencyServicesViewModel>().handleHMSMapCameraMoved(value));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
informationRegardingTrackingSection() {
|
|
|
|
informationRegardingTrackingSection() {
|
|
|
|
@ -277,12 +278,11 @@ class TrackingScreen extends StatelessWidget {
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
case OrderTrackingState.ended:
|
|
|
|
case OrderTrackingState.ended:
|
|
|
|
default:
|
|
|
|
|
|
|
|
return "Arrived".needTranslation.toText21(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
return "Arrived".needTranslation.toText21(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
OrderTrackingId() {
|
|
|
|
orderTrackingId() {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
padding: EdgeInsets.all(16.h),
|
|
|
|
padding: EdgeInsets.all(16.h),
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
@ -298,17 +298,17 @@ class TrackingScreen extends StatelessWidget {
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
spacing: 8.h,
|
|
|
|
spacing: 8.h,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Chip("location name".needTranslation, AppAssets.location_pickup, AppColors.blackBgColor),
|
|
|
|
chip("location name".needTranslation, AppAssets.location_pickup, AppColors.blackBgColor),
|
|
|
|
Chip("hotel name ".needTranslation, AppAssets.hospital, AppColors.blackBgColor),
|
|
|
|
chip("hotel name ".needTranslation, AppAssets.hospital, AppColors.blackBgColor),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Chip("hotel name ".needTranslation, AppAssets.hospital, AppColors.blackBgColor),
|
|
|
|
chip("hotel name ".needTranslation, AppAssets.hospital, AppColors.blackBgColor),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Chip(String title, String iconString, Color iconColor) {
|
|
|
|
chip(String title, String iconString, Color iconColor) {
|
|
|
|
return AppCustomChipWidget(
|
|
|
|
return AppCustomChipWidget(
|
|
|
|
labelText: title,
|
|
|
|
labelText: title,
|
|
|
|
icon: iconString,
|
|
|
|
icon: iconString,
|
|
|
|
@ -317,7 +317,7 @@ class TrackingScreen extends StatelessWidget {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ContactSection() {
|
|
|
|
contactSection() {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
padding: EdgeInsets.all(16.h),
|
|
|
|
padding: EdgeInsets.all(16.h),
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
@ -375,7 +375,6 @@ class TrackingScreen extends StatelessWidget {
|
|
|
|
case OrderTrackingState.returning:
|
|
|
|
case OrderTrackingState.returning:
|
|
|
|
return " On The Way To Hospital".needTranslation.toText16(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
return " On The Way To Hospital".needTranslation.toText16(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
case OrderTrackingState.ended:
|
|
|
|
case OrderTrackingState.ended:
|
|
|
|
default:
|
|
|
|
|
|
|
|
return "Arrived at Hospital".needTranslation.toText16(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
return "Arrived at Hospital".needTranslation.toText16(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|