@ -53,8 +53,8 @@ class CallAmbulancePage extends StatelessWidget {
ExpandableBottomSheet (
ExpandableBottomSheet (
bottomSheetType: context . watch < EmergencyServicesViewModel > ( ) . bottomSheetType ,
bottomSheetType: context . watch < EmergencyServicesViewModel > ( ) . bottomSheetType ,
children: {
children: {
BottomSheetType . EXPANDED: Expan edBottomSheet( context ) ,
BottomSheetType . EXPANDED: Expan d edBottomSheet( context ) ,
BottomSheetType . FIXED: FixedBottomSheet ( context ) ,
BottomSheetType . FIXED: pickUpDetailAndAppointementSection ( context ) ,
} ,
} ,
) ,
) ,
] ,
] ,
@ -92,7 +92,7 @@ class CallAmbulancePage extends StatelessWidget {
) ;
) ;
}
}
Widget Fix edBottomSheet( BuildContext context ) {
Widget Expand edBottomSheet( BuildContext context ) {
return GestureDetector (
return GestureDetector (
onVerticalDragUpdate: ( details ) {
onVerticalDragUpdate: ( details ) {
/ / if ( details . delta . dy < 0 ) {
/ / if ( details . delta . dy < 0 ) {
@ -172,7 +172,11 @@ class CallAmbulancePage extends StatelessWidget {
CustomButton (
CustomButton (
text: LocaleKeys . selectDetails . tr ( context: context ) ,
text: LocaleKeys . selectDetails . tr ( context: context ) ,
onPressed: ( ) {
onPressed: ( ) {
context . read < EmergencyServicesViewModel > ( ) . updateBottomSheetState ( BottomSheetType . EXPANDED ) ;
LocationViewModel locationViewModel = context . read < LocationViewModel > ( ) ;
GeocodeResponse ? response = locationViewModel . geocodeResponse ;
PlaceDetails ? placeDetails = locationViewModel . placeDetails ;
PlacePrediction ? placePrediction = locationViewModel . selectedPrediction ;
context . read < EmergencyServicesViewModel > ( ) . submitAmbulanceRequest ( response ? . results . first , placeDetails , placePrediction ) ;
} )
} )
] ,
] ,
) . paddingOnly ( top: 24. h , bottom: 32. h , left: 24. h , right: 24. h ) ,
) . paddingOnly ( top: 24. h , bottom: 32. h , left: 24. h , right: 24. h ) ,
@ -185,7 +189,7 @@ class CallAmbulancePage extends StatelessWidget {
) ;
) ;
}
}
Widget ExpanedBottomSheet ( BuildContext context ) {
Widget pickUpDetailAndAppointementSection ( BuildContext context ) {
return GestureDetector (
return GestureDetector (
onVerticalDragUpdate: ( details ) {
onVerticalDragUpdate: ( details ) {
if ( details . delta . dy > 0 ) {
if ( details . delta . dy > 0 ) {
@ -324,7 +328,7 @@ class CallAmbulancePage extends StatelessWidget {
)
)
] ,
] ,
) ,
) ,
if ( AmbulanceCallingPlace . TO_HOSPITAL = = context . read < EmergencyServicesViewModel > ( ) . callingPlace )
Row (
Row (
children: [
children: [
hospitalAndPickUpItemContent (
hospitalAndPickUpItemContent (
@ -346,6 +350,12 @@ class CallAmbulancePage extends StatelessWidget {
)
)
] ,
] ,
) ,
) ,
/ / Visibility (
/ / visible: ,
/ / child:
/ / ) ,
] ,
] ,
) . paddingAll ( 16. h ) ,
) . paddingAll ( 16. h ) ,
) ;
) ;
@ -460,11 +470,7 @@ class CallAmbulancePage extends StatelessWidget {
CustomButton (
CustomButton (
text: LocaleKeys . submitRequest . tr ( context: context ) ,
text: LocaleKeys . submitRequest . tr ( context: context ) ,
onPressed: ( ) {
onPressed: ( ) {
LocationViewModel locationViewModel = context . read < LocationViewModel > ( ) ;
context . read < EmergencyServicesViewModel > ( ) . updateBottomSheetState ( BottomSheetType . EXPANDED ) ;
GeocodeResponse ? response = locationViewModel . geocodeResponse ;
PlaceDetails ? placeDetails = locationViewModel . placeDetails ;
PlacePrediction ? placePrediction = locationViewModel . selectedPrediction ;
context . read < EmergencyServicesViewModel > ( ) . submitAmbulanceRequest ( response ? . results . first , placeDetails , placePrediction ) ;
} )
} )
] ,
] ,
) . paddingOnly ( top: 24. h , bottom: 12. h , left: 24. h , right: 24. h ) ,
) . paddingOnly ( top: 24. h , bottom: 12. h , left: 24. h , right: 24. h ) ,
@ -582,7 +588,9 @@ class CallAmbulancePage extends StatelessWidget {
}
}
hospitalField ( BuildContext context ) {
hospitalField ( BuildContext context ) {
return DecoratedBox (
return Visibility (
visible: false = = context . watch < EmergencyServicesViewModel > ( ) . haveAnAppointment ,
child: DecoratedBox (
decoration: RoundedRectangleBorder ( ) . toSmoothCornerDecoration ( color: AppColors . whiteColor , borderRadius: 12. h ) ,
decoration: RoundedRectangleBorder ( ) . toSmoothCornerDecoration ( color: AppColors . whiteColor , borderRadius: 12. h ) ,
child: Row (
child: Row (
children: [
children: [
@ -597,6 +605,7 @@ class CallAmbulancePage extends StatelessWidget {
showHospitalBottomSheet ( context ) ;
showHospitalBottomSheet ( context ) ;
} ) . paddingSymmetrical (
} ) . paddingSymmetrical (
10. w , 12. h ) ,
10. w , 12. h ) ,
) ,
) ;
) ;
}
}