@ -2,10 +2,12 @@ import 'package:flutter/material.dart';
import ' package:mc_common_app/classes/consts.dart ' ;
import ' package:mc_common_app/classes/consts.dart ' ;
import ' package:mc_common_app/extensions/int_extensions.dart ' ;
import ' package:mc_common_app/extensions/int_extensions.dart ' ;
import ' package:mc_common_app/extensions/string_extensions.dart ' ;
import ' package:mc_common_app/extensions/string_extensions.dart ' ;
import ' package:mc_common_app/generated/locale_keys.g.dart ' ;
import ' package:mc_common_app/models/appointments_models/appointment_list_model.dart ' ;
import ' package:mc_common_app/models/appointments_models/appointment_list_model.dart ' ;
import ' package:mc_common_app/theme/colors.dart ' ;
import ' package:mc_common_app/theme/colors.dart ' ;
import ' package:mc_common_app/widgets/extensions/extensions_widget.dart ' ;
import ' package:mc_common_app/widgets/extensions/extensions_widget.dart ' ;
import ' package:flutter_svg/flutter_svg.dart ' ;
import ' package:flutter_svg/flutter_svg.dart ' ;
import ' package:easy_localization/easy_localization.dart ' ;
class GeneralAppointmentWidget extends StatelessWidget {
class GeneralAppointmentWidget extends StatelessWidget {
final AppointmentListModel appointmentListModel ;
final AppointmentListModel appointmentListModel ;
@ -127,7 +129,7 @@ class GeneralAppointmentWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
children: [
if ( isNeedToShowMergeStatus )
if ( isNeedToShowMergeStatus )
" Appointment Merged " . toText ( color: MyColors . white ) . toContainer (
" ${ LocaleKeys . merged . tr ( ) } " . toText ( color: MyColors . white ) . toContainer (
padding: const EdgeInsets . symmetric ( horizontal: 6 , vertical: 3 ) ,
padding: const EdgeInsets . symmetric ( horizontal: 6 , vertical: 3 ) ,
borderRadius: 12 ,
borderRadius: 12 ,
backgroundColor: MyColors . greenColor ,
backgroundColor: MyColors . greenColor ,
@ -149,7 +151,7 @@ class GeneralAppointmentWidget extends StatelessWidget {
( appointmentListModel . customerName ? ? " " ) . toText ( color: MyColors . black , isBold: true , fontSize: 16 ) ,
( appointmentListModel . customerName ? ? " " ) . toText ( color: MyColors . black , isBold: true , fontSize: 16 ) ,
Row (
Row (
children: [
children: [
" Phone :" . toText (
" ${ LocaleKeys . phone . tr ( ) } :" . toText (
color: MyColors . lightTextColor ,
color: MyColors . lightTextColor ,
) ,
) ,
2. width ,
2. width ,
@ -162,38 +164,39 @@ class GeneralAppointmentWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment . start ,
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
children: [
" Appt. On :" . toText (
" ${ LocaleKeys . time . tr ( ) } :" . toText (
color: MyColors . lightTextColor ,
color: MyColors . lightTextColor ,
) ,
) ,
4. width ,
Flexible ( child: ( appointmentListModel . duration ? ? " " ) . toText ( fontSize: 8 ) )
] ,
) ,
Row (
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
" ${ LocaleKeys . date . tr ( ) } : " . toText (
color: MyColors . lightTextColor ,
) ,
4. width ,
Flexible ( child: appointmentListModel . appointmentDate ! . toFormattedDateWithoutTime ( ) . toText ( fontSize: 8 ) )
] ,
) ,
Row (
children: [
" ${ LocaleKeys . location . tr ( ) } : " . toText ( color: MyColors . lightTextColor ) ,
2. width ,
2. width ,
Expanded (
( appointmentListModel . appointmentType = = 1 ? LocaleKeys . home . tr ( ) : LocaleKeys . workshop . tr ( ) ) . toText (
child: " ${ appointmentListModel . duration ? ? " " } ${ appointmentListModel . appointmentDate ! . toFormattedDateWithoutTime ( ) } " . toText (
fontSize: 12 ,
fontSize: 12 ,
) ,
) ,
) ,
] ,
] ,
) ,
) ,
/ / Row (
/ / children: [
/ / " Location: " . toText (
/ / color: MyColors . lightTextColor ,
/ / ) ,
/ / 2. width ,
/ / appointmentListModel . appointmentType . toString ( ) . toText (
/ / fontSize: 12 ,
/ / ) ,
/ / ] ,
/ / ) ,
] ,
] ,
) ,
) ,
) ,
) ,
if ( ! isNeedTotalPayment )
if ( ! isNeedTotalPayment )
if ( appointmentListModel . customerAppointmentList ! . length > 1 )
if ( appointmentListModel . customerAppointmentList ! . length > 1 )
" ${ appointmentListModel . customerAppointmentList ! . length - 1 } + Appointments "
" ${ appointmentListModel . customerAppointmentList ! . length - 1 } + Appointments " . toText ( fontSize: 8 ) . toContainer (
. toText (
fontSize: 8 ,
)
. toContainer (
borderRadius: 15 ,
borderRadius: 15 ,
backgroundColor: MyColors . lightGreyEAColor ,
backgroundColor: MyColors . lightGreyEAColor ,
padding: const EdgeInsets . symmetric (
padding: const EdgeInsets . symmetric (
@ -223,21 +226,18 @@ class GeneralAppointmentWidget extends StatelessWidget {
Column (
Column (
crossAxisAlignment: CrossAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
children: [
24. height ,
18. height ,
" Total Amount " . toText (
LocaleKeys . totalAmount . tr ( ) . toText (
fontSize: 12 ,
fontSize: 12 ,
color: MyColors . lightTextColor ,
color: MyColors . lightTextColor ,
isBold: true ,
) ,
) ,
Row (
Row (
mainAxisAlignment: MainAxisAlignment . start ,
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . end ,
crossAxisAlignment: CrossAxisAlignment . end ,
children: [
children: [
appointmentListModel . totalAmount . toString ( ) . toText ( fontSize: 16 , isBold: true ) ,
appointmentListModel . totalAmount . toString ( ) . toText ( fontSize: 16 , isBold: true ) ,
2. width ,
2. width ,
" SAR: " . toText (
LocaleKeys . sar . tr ( ) . toText ( color: MyColors . lightTextColor ) ,
color: MyColors . lightTextColor ,
) ,
] ,
] ,
) ,
) ,
] ,
] ,
@ -246,20 +246,17 @@ class GeneralAppointmentWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
children: [
2. height ,
2. height ,
" Remaining Amount " . toText (
LocaleKeys . remainingAmount . tr ( ) . toText (
fontSize: 12 ,
fontSize: 12 ,
color: MyColors . lightTextColor ,
color: MyColors . lightTextColor ,
isBold: true ,
) ,
) ,
Row (
Row (
mainAxisAlignment: MainAxisAlignment . start ,
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . end ,
crossAxisAlignment: CrossAxisAlignment . end ,
children: [
children: [
appointmentListModel . remainingAmount . toString ( ) . toText ( fontSize: 16 , isBold: true ) ,
appointmentListModel . remainingAmount . toString ( ) . toText ( fontSize: 16 , isBold: true ) ,
2. width ,
2. width ,
" SAR: " . toText (
LocaleKeys . sar . tr ( ) . toText ( color: MyColors . lightTextColor ) ,
color: MyColors . lightTextColor ,
) ,
] ,
] ,
) ,
) ,
] ,
] ,
@ -269,10 +266,7 @@ class GeneralAppointmentWidget extends StatelessWidget {
] ,
] ,
) ,
) ,
) ,
) ,
if ( ! isNeedToShowItems )
if ( ! isNeedToShowItems ) const Icon ( Icons . arrow_forward ) ,
const Icon (
Icons . arrow_forward ,
) ,
] ,
] ,
) ,
) ,
] ,
] ,