|
|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
|
|
|
|
|
@ -9,6 +10,7 @@ import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/features/emergency_services/emergency_services_view_model.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/features/emergency_services/models/resp_model/AmbulanceRequestOrdersModel.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/features/emergency_services/models/resp_model/RRTServiceData.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/theme/colors.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
|
|
|
|
|
@ -60,14 +62,14 @@ class TrackingScreen extends StatelessWidget {
|
|
|
|
|
iconSize: 18.w,
|
|
|
|
|
backgroundColor: AppColors.bgGreenColor,
|
|
|
|
|
borderColor: Colors.transparent,
|
|
|
|
|
text: "Close".needTranslation,
|
|
|
|
|
text: LocaleKeys.close.tr(context: context),
|
|
|
|
|
textColor: AppColors.whiteColor,
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
).paddingOnly(left: 16.h, right: 16.h),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
body: CollapsingListView(
|
|
|
|
|
title: "Tracking Details".needTranslation,
|
|
|
|
|
title: LocaleKeys.trackingDetails.tr(context: context),
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
@ -136,7 +138,7 @@ class TrackingScreen extends StatelessWidget {
|
|
|
|
|
height: 16,
|
|
|
|
|
),
|
|
|
|
|
CustomButton(
|
|
|
|
|
text: "Cancel Request".needTranslation,
|
|
|
|
|
text: LocaleKeys.cancelRequest.tr(context: context),
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
openCancelOrderBottomSheet(context);
|
|
|
|
|
},
|
|
|
|
|
@ -162,7 +164,7 @@ class TrackingScreen extends StatelessWidget {
|
|
|
|
|
iconSize: 18.w,
|
|
|
|
|
backgroundColor: AppColors.lightRedButtonColor,
|
|
|
|
|
borderColor: Colors.transparent,
|
|
|
|
|
text: "Share Your Live Location on Whatsapp".needTranslation,
|
|
|
|
|
text: LocaleKeys.shareLocationWhatsapp.tr(context: context),
|
|
|
|
|
fontSize: 12.f,
|
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
|
iconColor: AppColors.primaryRedColor,
|
|
|
|
|
@ -280,7 +282,7 @@ class TrackingScreen extends StatelessWidget {
|
|
|
|
|
return RichText(
|
|
|
|
|
text: TextSpan(children: <TextSpan>[
|
|
|
|
|
TextSpan(
|
|
|
|
|
text: "Please wait for the call".needTranslation,
|
|
|
|
|
text: LocaleKeys.pleaseWaitForCall.tr(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 21.f,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
@ -288,7 +290,7 @@ class TrackingScreen extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
TextSpan(
|
|
|
|
|
text: "...".needTranslation,
|
|
|
|
|
text: "...",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 21.f,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
@ -301,7 +303,7 @@ class TrackingScreen extends StatelessWidget {
|
|
|
|
|
return RichText(
|
|
|
|
|
text: TextSpan(children: <TextSpan>[
|
|
|
|
|
TextSpan(
|
|
|
|
|
text: "15:30".needTranslation,
|
|
|
|
|
text: "15:30",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 21.f,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
@ -309,7 +311,7 @@ class TrackingScreen extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
TextSpan(
|
|
|
|
|
text: " mins ".needTranslation,
|
|
|
|
|
text: LocaleKeys.mins.tr(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 21.f,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
@ -317,7 +319,7 @@ class TrackingScreen extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
TextSpan(
|
|
|
|
|
text: "to hospital".needTranslation,
|
|
|
|
|
text: LocaleKeys.toHospitalLower.tr(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 21.f,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
@ -328,7 +330,7 @@ class TrackingScreen extends StatelessWidget {
|
|
|
|
|
);
|
|
|
|
|
case OrderTrackingState.ended:
|
|
|
|
|
|
|
|
|
|
return "Arrived".needTranslation.toText21(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
|
return LocaleKeys.arrived.tr().toText21(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
|
case OrderTrackingState.failed:
|
|
|
|
|
case OrderTrackingState.cancel:
|
|
|
|
|
return SizedBox.shrink();
|
|
|
|
|
@ -386,8 +388,8 @@ class TrackingScreen extends StatelessWidget {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
spacing: 4.h,
|
|
|
|
|
children: [
|
|
|
|
|
"Contact".needTranslation.toText14(color: AppColors.textColor, weight: FontWeight.w600),
|
|
|
|
|
"0115259555".needTranslation.toText12(color: AppColors.primaryRedColor, fontWeight: FontWeight.w500).onPress((){
|
|
|
|
|
LocaleKeys.contact.tr().toText14(color: AppColors.textColor, weight: FontWeight.w600),
|
|
|
|
|
"0115259555".toText12(color: AppColors.primaryRedColor, fontWeight: FontWeight.w500).onPress((){
|
|
|
|
|
launchUrl(
|
|
|
|
|
Uri.parse("tel://0115259555"),
|
|
|
|
|
);
|
|
|
|
|
@ -429,23 +431,24 @@ class TrackingScreen extends StatelessWidget {
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
getTitle(OrderTrackingState? state) {
|
|
|
|
|
if(state == null)
|
|
|
|
|
return "Failed".needTranslation.toText16(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
|
if(state == null) {
|
|
|
|
|
return LocaleKeys.failed.tr().toText16(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (state) {
|
|
|
|
|
case OrderTrackingState.waitingForCall:
|
|
|
|
|
return "Confirmation Call".needTranslation.toText16(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
|
return LocaleKeys.confirmationCall.tr().toText16(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
|
case OrderTrackingState.dispactched:
|
|
|
|
|
return "Pickup Up from Home".needTranslation.toText16(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
|
return LocaleKeys.pickupFromHome.tr().toText16(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
|
case OrderTrackingState.returning:
|
|
|
|
|
return " On The Way To Hospital".needTranslation.toText16(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
|
return LocaleKeys.onTheWayToHospital.tr().toText16(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
|
case OrderTrackingState.ended:
|
|
|
|
|
return "Arrived at Hospital".needTranslation.toText16(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
|
return LocaleKeys.arrivedAtHospital.tr().toText16(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
|
case OrderTrackingState.failed:
|
|
|
|
|
return "Failed".needTranslation.toText16(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
|
return LocaleKeys.failed.tr().toText16(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
|
|
|
|
|
|
case OrderTrackingState.cancel:
|
|
|
|
|
return "Order Cancel".needTranslation.toText16(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
|
return LocaleKeys.orderCancel.tr().toText16(color: AppColors.textColor, weight: FontWeight.w600);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|