resolved fSize issue

faiz_dev
faizatflutter 1 week ago
parent c1971ef287
commit 28f8aec60f

@ -7,7 +7,6 @@ import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; 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/emergency_services_view_model.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/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
@ -21,6 +20,7 @@ import 'package:provider/provider.dart';
class TrackingScreen extends StatelessWidget { class TrackingScreen extends StatelessWidget {
final OrderTrackingState state = OrderTrackingState.ended; final OrderTrackingState state = OrderTrackingState.ended;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -51,6 +51,7 @@ class TrackingScreen extends StatelessWidget {
))), ))),
); );
} }
animationSection() { animationSection() {
switch (state) { switch (state) {
case OrderTrackingState.waitingForCall: case OrderTrackingState.waitingForCall:
@ -95,7 +96,9 @@ class TrackingScreen extends StatelessWidget {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 16,), SizedBox(
height: 16,
),
CustomButton( CustomButton(
text: "Cancel Request".needTranslation, text: "Cancel Request".needTranslation,
onPressed: () async {}, onPressed: () async {},
@ -119,7 +122,7 @@ class TrackingScreen extends StatelessWidget {
backgroundColor: AppColors.lightRedButtonColor, backgroundColor: AppColors.lightRedButtonColor,
borderColor: Colors.transparent, borderColor: Colors.transparent,
text: "Share Your Live Locatin on Whatsapp".needTranslation, text: "Share Your Live Locatin on Whatsapp".needTranslation,
fontSize: 12.fSize, fontSize: 12.f,
textColor: AppColors.primaryRedColor, textColor: AppColors.primaryRedColor,
iconColor: AppColors.primaryRedColor, iconColor: AppColors.primaryRedColor,
onPressed: () {}, onPressed: () {},
@ -131,11 +134,7 @@ class TrackingScreen extends StatelessWidget {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
spacing: 12.h, spacing: 12.h,
children: [ children: [dividerSection, doctorSection(), mapSection(context)],
dividerSection,
doctorSection(),
mapSection(context)
],
); );
case OrderTrackingState.ended: case OrderTrackingState.ended:
default: default:
@ -170,17 +169,14 @@ class TrackingScreen extends StatelessWidget {
return Row( return Row(
spacing: 16.h, spacing: 16.h,
children: [ children: [
Utils.buildImgWithNetwork(url: "", iconColor: Colors.transparent) Utils.buildImgWithNetwork(url: "", iconColor: Colors.transparent).circle(52.h),
.circle(52.h),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Dr. John Doe".toText16( "Dr. John Doe".toText16(color: AppColors.textColor, weight: FontWeight.w600),
color: AppColors.textColor, weight: FontWeight.w600),
SizedBox(height: 4.h), SizedBox(height: 4.h),
"MBBS, MD - General Medicine".toText12( "MBBS, MD - General Medicine".toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500),
color: AppColors.greyTextColor, fontWeight: FontWeight.w500),
], ],
), ),
), ),
@ -204,23 +200,16 @@ class TrackingScreen extends StatelessWidget {
Widget mapForRequestedCoordinate(BuildContext context) { Widget mapForRequestedCoordinate(BuildContext context) {
// return SizedBox.shrink(); // return SizedBox.shrink();
if (context.read<EmergencyServicesViewModel>().isGMSAvailable || if (context.read<EmergencyServicesViewModel>().isGMSAvailable || Platform.isIOS)
Platform.isIOS)
return GMSMap( return GMSMap(
myLocationEnabled: false, myLocationEnabled: false,
currentLocation: currentLocation: context.read<EmergencyServicesViewModel>().getGMSLocation(),
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: currentLocation: context.read<EmergencyServicesViewModel>().getHMSLocation(),
context.read<EmergencyServicesViewModel>().getHMSLocation(), onCameraMoved: (value) => context.read<EmergencyServicesViewModel>().handleHMSMapCameraMoved(value));
onCameraMoved: (value) => context
.read<EmergencyServicesViewModel>()
.handleHMSMapCameraMoved(value));
} }
informationRegardingTrackingSection() { informationRegardingTrackingSection() {
@ -229,8 +218,7 @@ class TrackingScreen extends StatelessWidget {
children: [ children: [
currentStatus(), currentStatus(),
SizedBox(height: 4.h), SizedBox(height: 4.h),
"You will receive a call from HMG for confirmation ".toText12( "You will receive a call from HMG for confirmation ".toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500)
color: AppColors.greyTextColor, fontWeight: FontWeight.w500)
], ],
); );
} }
@ -244,7 +232,7 @@ class TrackingScreen extends StatelessWidget {
TextSpan( TextSpan(
text: "Please wait for the call".needTranslation, text: "Please wait for the call".needTranslation,
style: TextStyle( style: TextStyle(
fontSize: 21.fSize, fontSize: 21.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.textColor, color: AppColors.textColor,
), ),
@ -252,7 +240,7 @@ class TrackingScreen extends StatelessWidget {
TextSpan( TextSpan(
text: "...".needTranslation, text: "...".needTranslation,
style: TextStyle( style: TextStyle(
fontSize: 21.fSize, fontSize: 21.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.errorColor, color: AppColors.errorColor,
), ),
@ -265,7 +253,7 @@ class TrackingScreen extends StatelessWidget {
TextSpan( TextSpan(
text: "15:30".needTranslation, text: "15:30".needTranslation,
style: TextStyle( style: TextStyle(
fontSize: 21.fSize, fontSize: 21.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.textColor, color: AppColors.textColor,
), ),
@ -273,7 +261,7 @@ class TrackingScreen extends StatelessWidget {
TextSpan( TextSpan(
text: " mins ".needTranslation, text: " mins ".needTranslation,
style: TextStyle( style: TextStyle(
fontSize: 21.fSize, fontSize: 21.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.errorColor, color: AppColors.errorColor,
), ),
@ -281,7 +269,7 @@ class TrackingScreen extends StatelessWidget {
TextSpan( TextSpan(
text: "to hospital".needTranslation, text: "to hospital".needTranslation,
style: TextStyle( style: TextStyle(
fontSize: 21.fSize, fontSize: 21.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.textColor, color: AppColors.textColor,
), ),
@ -290,9 +278,7 @@ class TrackingScreen extends StatelessWidget {
); );
case OrderTrackingState.ended: case OrderTrackingState.ended:
default: default:
return "Arrived" return "Arrived".needTranslation.toText21(color: AppColors.textColor, weight: FontWeight.w600);
.needTranslation
.toText21(color: AppColors.textColor, weight: FontWeight.w600);
} }
} }
@ -308,19 +294,15 @@ class TrackingScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
spacing: 8.h, spacing: 8.h,
children: [ children: [
"Req ID:1234567890" "Req ID:1234567890".toText16(color: AppColors.textColor, weight: FontWeight.w600),
.toText16(color: AppColors.textColor, weight: FontWeight.w600),
Row( Row(
spacing: 8.h, spacing: 8.h,
children: [ children: [
Chip("location name".needTranslation, AppAssets.location_pickup, Chip("location name".needTranslation, AppAssets.location_pickup, AppColors.blackBgColor),
AppColors.blackBgColor), Chip("hotel name ".needTranslation, AppAssets.hospital, AppColors.blackBgColor),
Chip("hotel name ".needTranslation, AppAssets.hospital,
AppColors.blackBgColor),
], ],
), ),
Chip("hotel name ".needTranslation, AppAssets.hospital, Chip("hotel name ".needTranslation, AppAssets.hospital, AppColors.blackBgColor),
AppColors.blackBgColor),
], ],
), ),
); );
@ -350,11 +332,8 @@ class TrackingScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
spacing: 4.h, spacing: 4.h,
children: [ children: [
"Contact Rapid Response Team (RRT)".needTranslation.toText14( "Contact Rapid Response Team (RRT)".needTranslation.toText14(color: AppColors.textColor, weight: FontWeight.w600),
color: AppColors.textColor, weight: FontWeight.w600), "1223456789".needTranslation.toText12(color: AppColors.primaryRedColor, fontWeight: FontWeight.w500),
"1223456789".needTranslation.toText12(
color: AppColors.primaryRedColor,
fontWeight: FontWeight.w500),
SizedBox(height: 8.h), SizedBox(height: 8.h),
], ],
), ),
@ -390,18 +369,14 @@ class TrackingScreen extends StatelessWidget {
getTitle(OrderTrackingState state) { getTitle(OrderTrackingState state) {
switch (state) { switch (state) {
case OrderTrackingState.waitingForCall: case OrderTrackingState.waitingForCall:
return "Confirmation Call".needTranslation return "Confirmation Call".needTranslation.toText16(color: AppColors.textColor, weight: FontWeight.w600);
.toText16(color: AppColors.textColor, weight: FontWeight.w600);
case OrderTrackingState.dispactched: case OrderTrackingState.dispactched:
return "Pickup Up from Home".needTranslation return "Pickup Up from Home".needTranslation.toText16(color: AppColors.textColor, weight: FontWeight.w600);
.toText16(color: AppColors.textColor, weight: FontWeight.w600);
case OrderTrackingState.returning: case OrderTrackingState.returning:
return " On The Way To Hospital".needTranslation return " On The Way To Hospital".needTranslation.toText16(color: AppColors.textColor, weight: FontWeight.w600);
.toText16(color: AppColors.textColor, weight: FontWeight.w600);
case OrderTrackingState.ended: case OrderTrackingState.ended:
default: default:
return "Arrived at Hospital".needTranslation return "Arrived at Hospital".needTranslation.toText16(color: AppColors.textColor, weight: FontWeight.w600);
.toText16(color: AppColors.textColor, weight: FontWeight.w600);
} }
} }
@ -409,8 +384,7 @@ class TrackingScreen extends StatelessWidget {
return SizedBox( return SizedBox(
height: 170.h, height: 170.h,
width: double.infinity, width: double.infinity,
child: ClipRRect( child: ClipRRect(borderRadius: BorderRadius.circular(20.h), child: mapForRequestedCoordinate(context)),
borderRadius: BorderRadius.circular(20.h),child: mapForRequestedCoordinate(context)),
); );
} }
} }

Loading…
Cancel
Save