@ -100,216 +100,213 @@ class GeneralAppointmentWidget extends StatelessWidget {
@ override
Widget build ( BuildContext context ) {
return Row (
mainAxisAlignment: MainAxisAlignment . start ,
return Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
if ( isSelectable )
SizedBox (
child: const SizedBox (
width: 14 ,
height: 14 ,
) . toContainer (
borderRadius: 24 ,
marginAll: 4 ,
paddingAll: 0 ,
backgroundColor: ( appointmentListModel . isSelected ? ? false ) ? MyColors . primaryColor : MyColors . greyButtonColor ,
) ,
) . toContainer (
borderRadius: 24 ,
isEnabledBorder: true ,
paddingAll: 0 ,
borderWidget: 3 ,
borderColor: MyColors . primaryColor ,
) ,
if ( isSelectable ) 12. width ,
Expanded (
child: Column (
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
if ( isNeedToShowMergeStatus )
LocaleKeys . merged . tr ( ) . toText ( color: MyColors . white ) . toContainer (
padding: const EdgeInsets . symmetric ( horizontal: 6 , vertical: 3 ) ,
borderRadius: 12 ,
backgroundColor: MyColors . greenColor ,
) ,
Row (
mainAxisAlignment: MainAxisAlignment . start ,
Row (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
if ( isSelectable )
SizedBox (
child: const SizedBox (
width: 14 ,
height: 14 ,
) . toContainer (
borderRadius: 24 ,
marginAll: 4 ,
paddingAll: 0 ,
backgroundColor: ( appointmentListModel . isSelected ? ? false ) ? MyColors . primaryColor : MyColors . greyButtonColor ,
) ,
) . toContainer (
borderRadius: 24 ,
isEnabledBorder: true ,
paddingAll: 0 ,
borderWidget: 3 ,
borderColor: MyColors . primaryColor ,
) ,
if ( isSelectable ) 12. width ,
Expanded (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Expanded (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
mainAxisAlignment: MainAxisAlignment . start ,
children: [
( appointmentListModel . branchName ? ? " " ) . toText (
fontSize: 12 ,
color: MyColors . darkTextColor ,
isBold: true ,
if ( isNeedToShowMergeStatus )
LocaleKeys . merged . tr ( ) . toText ( color: MyColors . white ) . toContainer (
padding: const EdgeInsets . symmetric ( horizontal: 6 , vertical: 3 ) ,
borderRadius: 12 ,
backgroundColor: MyColors . greenColor ,
) ,
( appointmentListModel . customerName ? ? " " ) . toText ( color: MyColors . black , isBold: true , fontSize: 16 ) ,
Row (
Row (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Expanded (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
" ${ LocaleKeys . phone . tr ( ) } : " . toText (
color: MyColors . lightTextColor ,
( appointmentListModel . branchName ? ? " " ) . toText (
fontSize: 12 ,
color: MyColors . darkTextColor ,
isBold: true ,
) ,
2. width ,
appointmentListModel . customerMobileNum . toString ( ) . toText (
fontSize: 12 ,
( appointmentListModel . customerName ? ? " " ) . toText ( color: MyColors . black , isBold: true , fontSize: 16 ) ,
Row (
children: [
" ${ LocaleKeys . phone . tr ( ) } : " . toText (
color: MyColors . lightTextColor ,
) ,
2. width ,
Expanded (
child: appointmentListModel . customerMobileNum . toString ( ) . toText (
fontSize: 12 ,
) ,
) ,
] ,
) ,
Row (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
" ${ LocaleKeys . time . tr ( ) } : " . toText (
color: MyColors . lightTextColor ,
) ,
4. width ,
Expanded ( child: ( appointmentListModel . duration ? ? " " ) . toText ( fontSize: 8 ) )
] ,
) ,
Row (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
" ${ LocaleKeys . date . tr ( ) } : " . toText (
color: MyColors . lightTextColor ,
) ,
4. width ,
Expanded ( child: appointmentListModel . appointmentDate ! . toFormattedDateWithoutTime ( ) . toText ( fontSize: 8 ) )
] ,
) ,
Row (
children: [
" ${ LocaleKeys . delivery . tr ( ) } : " . toText ( color: MyColors . lightTextColor ) ,
2. width ,
Expanded (
child: ( appointmentListModel . appointmentTypeEnum = = AppointmentTypeEnum . home ? LocaleKeys . home . tr ( ) : LocaleKeys . workshop . tr ( ) ) . toText (
fontSize: 12 ,
) ,
) ,
] ,
) ,
Row (
children: [
" ${ LocaleKeys . createdOn . tr ( ) } : " . toText ( color: MyColors . lightTextColor ) ,
2. width ,
Expanded ( child: appointmentListModel . appointmentCreatedOn ! . toFormattedDateWithoutTime ( ) . toText ( fontSize: 8 ) )
] ,
) ,
if ( isFromUpdateAppointmentPage ) . . . [
if ( appointmentListModel . appointmentAddress ! = null & & appointmentListModel . appointmentAddress ! . isNotEmpty ) . . . [
Row (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
" ${ LocaleKeys . address . tr ( ) } : " . toText ( color: MyColors . lightTextColor ) ,
2. width ,
Expanded ( child: ( appointmentListModel . appointmentAddress ? ? " " ) . toText ( fontSize: 8 ) )
] ,
) ,
] ,
Row (
children: [
" ${ LocaleKeys . paymentType . tr ( ) } : " . toText ( color: MyColors . lightTextColor ) ,
2. width ,
Expanded ( child: ( appointmentListModel . paymentType ? ? " " ) . toText ( fontSize: 8 ) ) ,
] ,
) ,
LocaleKeys . openMapLocation
. tr ( )
. toText (
isUnderLine: true ,
color: MyColors . darkPrimaryColor ,
fontSize: 10 ,
)
. onPress ( ( ) async {
double latitude , longitude = 0.0 ;
latitude = double . parse ( appointmentListModel . appointmentLatitude ! ) ;
longitude = double . parse ( appointmentListModel . appointmentLongitude ! ) ;
await Utils . openLocationInMaps ( latitude: latitude , longitude: longitude ) ;
} ) ,
]
] ,
) ,
Row (
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
" ${ LocaleKeys . time . tr ( ) } : " . toText (
) ,
if ( ! isNeedTotalPayment )
if ( appointmentListModel . customerAppointmentList ! = null & & appointmentListModel . customerAppointmentList ! . length > 1 )
" ${ appointmentListModel . customerAppointmentList ! . length - 1 } + appts " . toText ( fontSize: 8 ) . toContainer (
borderRadius: 15 ,
backgroundColor: MyColors . lightGreyEAColor ,
padding: const EdgeInsets . symmetric (
vertical: 4 ,
horizontal: 8 ,
) ,
) ,
if ( isNeedToShowAppointmentStatus )
( appointmentListModel . appointmentStatusEnum ! . getAppointmentNameFromEnum ( ) ) . toText ( color: MyColors . white ) . toContainer (
padding: const EdgeInsets . symmetric ( horizontal: 6 , vertical: 3 ) ,
borderRadius: 12 ,
backgroundColor: MyColors . primaryColor ,
) ,
] ,
) ,
] ,
) ,
) ,
] ,
) ,
8. height ,
Row (
crossAxisAlignment: CrossAxisAlignment . end ,
children: [
Expanded (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
. . . buildServicesFromAppointment ( appointmentListModel: appointmentListModel ) ,
if ( isNeedTotalPayment )
Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
18. height ,
LocaleKeys . totalAmount . tr ( ) . toText (
fontSize: 12 ,
color: MyColors . lightTextColor ,
) ,
4. width ,
Flexible ( child: ( appointmentListModel . duration ? ? " " ) . toText ( fontSize: 8 ) )
] ,
) ,
Row (
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . end ,
children: [
" ${ LocaleKeys . date . tr ( ) } : " . toText (
color: MyColors . lightTextColor ,
) ,
4. width ,
Flexible ( child: appointmentListModel . appointmentDate ! . toFormattedDateWithoutTime ( ) . toText ( fontSize: 8 ) )
appointmentListModel . totalAmount . toString ( ) . toText ( fontSize: 16 , isBold: true ) ,
2. width ,
LocaleKeys . sar . tr ( ) . toText ( color: MyColors . lightTextColor ) ,
] ,
) ,
Row (
children: [
" ${ LocaleKeys . serviceDeliveryType . tr ( ) } : " . toText ( color: MyColors . lightTextColor ) ,
2. width ,
( appointmentListModel . appointmentTypeEnum = = AppointmentTypeEnum . home ? LocaleKeys . home . tr ( ) : LocaleKeys . workshop . tr ( ) ) . toText (
2. height ,
LocaleKeys . remainingAmount . tr ( ) . toText (
fontSize: 12 ,
color: MyColors . lightTextColor ,
) ,
] ,
) ,
Row (
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . end ,
children: [
" ${ LocaleKeys . createdOn . tr ( ) } : " . toText ( color: MyColors . lightTextColor ) ,
appointmentListModel . remainingAmount . toString ( ) . toText ( fontSize: 16 , isBold: true ) ,
2. width ,
Flexible ( child: appointmentListModel . appointmentCreatedOn ! . toFormattedDateWithoutTime ( ) . toText ( fontSize: 8 ) )
] ,
) ,
if ( isFromUpdateAppointmentPage ) . . . [
if ( appointmentListModel . appointmentAddress ! = null & & appointmentListModel . appointmentAddress ! . isNotEmpty ) . . . [
Row (
children: [
" ${ LocaleKeys . address . tr ( ) } : " . toText ( color: MyColors . lightTextColor ) ,
2. width ,
Flexible ( child: ( appointmentListModel . appointmentAddress ? ? " " ) . toText ( fontSize: 8 ) )
] ,
) ,
LocaleKeys . sar . tr ( ) . toText ( color: MyColors . lightTextColor ) ,
] ,
Row (
children: [
" ${ LocaleKeys . paymentType . tr ( ) } : " . toText ( color: MyColors . lightTextColor ) ,
2. width ,
( appointmentListModel . paymentType ? ? " " ) . toText ( fontSize: 8 ) ,
] ,
) ,
LocaleKeys . openMapLocation
. tr ( )
. toText (
isUnderLine: true ,
color: MyColors . darkPrimaryColor ,
fontSize: 10 ,
)
. onPress ( ( ) async {
double latitude , longitude = 0.0 ;
latitude = double . parse ( appointmentListModel . appointmentLatitude ! ) ;
longitude = double . parse ( appointmentListModel . appointmentLongitude ! ) ;
await Utils . openLocationInMaps ( latitude: latitude , longitude: longitude ) ;
} ) ,
]
] ,
) ,
) ,
if ( ! isNeedTotalPayment )
if ( appointmentListModel . customerAppointmentList ! = null & & appointmentListModel . customerAppointmentList ! . length > 1 )
" ${ appointmentListModel . customerAppointmentList ! . length - 1 } + Appointments " . toText ( fontSize: 8 ) . toContainer (
borderRadius: 15 ,
backgroundColor: MyColors . lightGreyEAColor ,
padding: const EdgeInsets . symmetric (
vertical: 6 ,
horizontal: 12 ,
) ,
) ,
if ( isNeedToShowAppointmentStatus )
( appointmentListModel . appointmentStatusEnum ! . getAppointmentNameFromEnum ( ) ) . toText ( color: MyColors . white ) . toContainer (
padding: const EdgeInsets . symmetric ( horizontal: 6 , vertical: 3 ) ,
borderRadius: 12 ,
backgroundColor: MyColors . primaryColor ,
) ,
] ,
) ,
8. height ,
Row (
crossAxisAlignment: CrossAxisAlignment . end ,
children: [
Expanded (
child: Column (
children: [
. . . buildServicesFromAppointment ( appointmentListModel: appointmentListModel ) ,
if ( isNeedTotalPayment )
Column (
children: [
Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
18. height ,
LocaleKeys . totalAmount . tr ( ) . toText (
fontSize: 12 ,
color: MyColors . lightTextColor ,
) ,
Row (
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . end ,
children: [
appointmentListModel . totalAmount . toString ( ) . toText ( fontSize: 16 , isBold: true ) ,
2. width ,
LocaleKeys . sar . tr ( ) . toText ( color: MyColors . lightTextColor ) ,
] ,
) ,
] ,
) ,
Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
2. height ,
LocaleKeys . remainingAmount . tr ( ) . toText (
fontSize: 12 ,
color: MyColors . lightTextColor ,
) ,
Row (
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . end ,
children: [
appointmentListModel . remainingAmount . toString ( ) . toText ( fontSize: 16 , isBold: true ) ,
2. width ,
LocaleKeys . sar . tr ( ) . toText ( color: MyColors . lightTextColor ) ,
] ,
) ,
] ,
) ,
] ,
)
] ,
) ,
) ,
if ( ! isNeedToShowItems ) const Icon ( Icons . arrow_forward ) ,
)
] ,
) ,
] ,
) ,
)
) ,
if ( ! isNeedToShowItems ) const Icon ( Icons . arrow_forward ) ,
] ,
) ,
] ,
) . toWhiteContainer ( width: double . infinity , allPading: 12 , onTap: onTap ) ;
}
@ -361,3 +358,94 @@ class GeneralAppointmentWidget extends StatelessWidget {
) ;
}
}
/ / https: / / ms . hmg . com / api / ServiceProviders / ServiceProviderBranchDetail_Get ? ID = 1061 & ServiceCategoryIDs = 4
/ / { ID: 1061 , ServiceCategoryIDs: [ 4 ] }
/ / {
/ / " messageStatus " : 1 ,
/ / " totalItemsCount " : 1 ,
/ / " data " : [
/ / {
/ / " id " : 1061 ,
/ / " serviceProviderID " : 14 ,
/ / " serviceProviderName " : " James Bond " ,
/ / " branchName " : " Sawaidi Branch " ,
/ / " branchDescription " : " This is Swaidi Branch " ,
/ / " cityID " : 1 ,
/ / " cityName " : " Riyadh " ,
/ / " address " : " Riyadh, KSA " ,
/ / " latitude " : " 37.541014800226456 " ,
/ / " longitude " : " -122.36278831958771 " ,
/ / " distanceKM " : 12811.22 ,
/ / " openTime " : " 12:00 " ,
/ / " closeTime " : " 22:45 " ,
/ / " branchStatus " : 3 ,
/ / " branchStatusText " : " ApprovedOrActive " ,
/ / " branchRateAvg " : 0.0 ,
/ / " serviceProviderServices " : [
/ / {
/ / " serviceProviderServiceID " : 1212 ,
/ / " providerServiceDescription " : null ,
/ / " categoryID " : 4 ,
/ / " categoryName " : " Care and Protection " ,
/ / " serviceID " : 16 ,
/ / " serviceDescription " : " film body protection " ,
/ / " serviceDescriptionN " : " فلم حماية الدهان " ,
/ / " serviceStatus " : 1 ,
/ / " statusText " : null ,
/ / " isAllowAppointment " : true ,
/ / " isAllowAppointmentHome " : true ,
/ / " customerLocationRange " : 10 ,
/ / " rangePricePerKm " : 15.0 ,
/ / " itemsCount " : 1
/ / }
/ / ] ,
/ / " serviceProviderBranchImage " : [
/ / {
/ / " id " : 136 ,
/ / " imageName " : " image_picker_929CDE1A-800C-4EFE-AC48-7060BB338D77-69034-00003ADB833C597D.jpg " ,
/ / " imageUrl " : " https://ms.hmg.com/api/serviceProviders/ServiceProviderBranchImage?imageName=61aa8beb-99b0-4876-b47a-08dce8674a2c_50243415.png&sp=Provider_14&serviceProviderBranch=ServiceProviderBranch_1061 " ,
/ / " imageStr " : null ,
/ / " serviceProviderBranchID " : 1061 ,
/ / " serviceProviderBranch " : null ,
/ / " isActive " : true ,
/ / " createdBy " : 101 ,
/ / " createdOn " : " 2024-12-16T14:47:48.6633333 " ,
/ / " modifiedBy " : null ,
/ / " modifiedOn " : null
/ / } ,
/ / {
/ / " id " : 137 ,
/ / " imageName " : " image_picker_EBF6BA32-3E4E-4AAE-BC2C-1B136A1C32B3-69034-00003ADB7C82E00F.jpg " ,
/ / " imageUrl " : " https://ms.hmg.com/api/serviceProviders/ServiceProviderBranchImage?imageName=61aa8beb-99b0-4876-b47a-08dce8674a2c_51856527.png&sp=Provider_14&serviceProviderBranch=ServiceProviderBranch_1061 " ,
/ / " imageStr " : null ,
/ / " serviceProviderBranchID " : 1061 ,
/ / " serviceProviderBranch " : null ,
/ / " isActive " : true ,
/ / " createdBy " : 101 ,
/ / " createdOn " : " 2024-12-16T14:47:48.6866667 " ,
/ / " modifiedBy " : null ,
/ / " modifiedOn " : null
/ / } ,
/ / {
/ / " id " : 138 ,
/ / " imageName " : " image_picker_168879D6-4707-4D0E-ACDA-0C956BD2AC4A-69034-00003AE6922D39CF.jpg " ,
/ / " imageUrl " : " https://ms.hmg.com/api/serviceProviders/ServiceProviderBranchImage?imageName=61aa8beb-99b0-4876-b47a-08dce8674a2c_61115226.png&sp=Provider_14&serviceProviderBranch=ServiceProviderBranch_1061 " ,
/ / " imageStr " : null ,
/ / " serviceProviderBranchID " : 1061 ,
/ / " serviceProviderBranch " : null ,
/ / " isActive " : true ,
/ / " createdBy " : 101 ,
/ / " createdOn " : " 2024-12-16T14:47:48.7066667 " ,
/ / " modifiedBy " : null ,
/ / " modifiedOn " : null
/ / }
/ / ]
/ / }
/ / ] ,
/ / " message " : " Success "
/ / }