|
|
|
@ -1,32 +1,29 @@
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:test_sa/extensions/context_extension.dart';
|
|
|
|
import 'package:test_sa/extensions/context_extension.dart';
|
|
|
|
import 'package:test_sa/extensions/int_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/int_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
|
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
|
|
import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
|
|
|
|
import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
|
|
|
|
import 'package:test_sa/service_request_latest/views/components/bottom_sheets/service_request_bottomsheet.dart';
|
|
|
|
import 'package:test_sa/service_request_latest/views/components/bottom_sheets/service_request_bottomsheet.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class FooterActionButton {
|
|
|
|
class FooterActionButton {
|
|
|
|
|
|
|
|
static Widget footerContainer({required Widget child}) {
|
|
|
|
static Widget footerContainer({required Widget child}){
|
|
|
|
|
|
|
|
return Align(
|
|
|
|
return Align(
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth,vertical: 16.toScreenHeight),
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 16.toScreenHeight),
|
|
|
|
color: AppColor.white10,
|
|
|
|
color: AppColor.white10,
|
|
|
|
child: child,
|
|
|
|
child: child,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Widget requestDetailsFooterWidget({required int status,required BuildContext context}){
|
|
|
|
static Widget requestDetailsFooterWidget({required int status, required BuildContext context}) {
|
|
|
|
switch(status){
|
|
|
|
switch (status) {
|
|
|
|
//accept reject...
|
|
|
|
//accept reject...
|
|
|
|
case 1:
|
|
|
|
case 1:
|
|
|
|
return footerContainer(
|
|
|
|
return footerContainer(
|
|
|
|
child:
|
|
|
|
child: Row(
|
|
|
|
Row(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
@ -47,18 +44,15 @@ class FooterActionButton {
|
|
|
|
label: context.translation.accept,
|
|
|
|
label: context.translation.accept,
|
|
|
|
maxWidth: true,
|
|
|
|
maxWidth: true,
|
|
|
|
buttonColor: AppColor.green70,
|
|
|
|
buttonColor: AppColor.green70,
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {},
|
|
|
|
},
|
|
|
|
|
|
|
|
).expanded,
|
|
|
|
).expanded,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)
|
|
|
|
));
|
|
|
|
);
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
//need visit fixed remotely
|
|
|
|
//need visit fixed remotely
|
|
|
|
case 2:
|
|
|
|
case 2:
|
|
|
|
return footerContainer(
|
|
|
|
return footerContainer(
|
|
|
|
child:
|
|
|
|
child: Row(
|
|
|
|
Row(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
@ -82,84 +76,66 @@ class FooterActionButton {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
).expanded,
|
|
|
|
).expanded,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)
|
|
|
|
));
|
|
|
|
);
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
//verify Asset Details
|
|
|
|
//verify Asset Details
|
|
|
|
case 3:
|
|
|
|
case 3:
|
|
|
|
return footerContainer(
|
|
|
|
return footerContainer(
|
|
|
|
child:
|
|
|
|
child: AppFilledButton(
|
|
|
|
AppFilledButton(
|
|
|
|
|
|
|
|
label: context.translation.verify_asset_details,
|
|
|
|
label: context.translation.verify_asset_details,
|
|
|
|
// maxWidth: true,
|
|
|
|
// maxWidth: true,
|
|
|
|
buttonColor: AppColor.primary10,
|
|
|
|
buttonColor: AppColor.primary10,
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {},
|
|
|
|
|
|
|
|
));
|
|
|
|
},
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
//Activities
|
|
|
|
//Activities
|
|
|
|
case 4:
|
|
|
|
case 4:
|
|
|
|
return footerContainer(
|
|
|
|
return footerContainer(
|
|
|
|
child:
|
|
|
|
child: AppFilledButton(
|
|
|
|
AppFilledButton(
|
|
|
|
|
|
|
|
label: context.translation.activities,
|
|
|
|
label: context.translation.activities,
|
|
|
|
// maxWidth: true,
|
|
|
|
// maxWidth: true,
|
|
|
|
buttonColor: AppColor.neutral50,
|
|
|
|
buttonColor: AppColor.neutral50,
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
ServiceRequestBottomSheet.activityTypeBottomSheet(context: context);
|
|
|
|
ServiceRequestBottomSheet.activityTypeBottomSheet(context: context);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
)
|
|
|
|
));
|
|
|
|
);
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
//I have arrived...
|
|
|
|
//I have arrived...
|
|
|
|
case 5:
|
|
|
|
case 5:
|
|
|
|
return footerContainer(
|
|
|
|
return footerContainer(
|
|
|
|
child:
|
|
|
|
child: AppFilledButton(
|
|
|
|
AppFilledButton(
|
|
|
|
|
|
|
|
label: context.translation.iHaveArrived,
|
|
|
|
label: context.translation.iHaveArrived,
|
|
|
|
//showIcon: true,
|
|
|
|
//showIcon: true,
|
|
|
|
// icon: 'arrived_icon'.toSvgAsset(),
|
|
|
|
// icon: 'arrived_icon'.toSvgAsset(),
|
|
|
|
buttonColor: AppColor.green70,
|
|
|
|
buttonColor: AppColor.green70,
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {},
|
|
|
|
|
|
|
|
));
|
|
|
|
},
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
//Close..
|
|
|
|
//Close..
|
|
|
|
case 6:
|
|
|
|
case 6:
|
|
|
|
return footerContainer(
|
|
|
|
return footerContainer(
|
|
|
|
child:
|
|
|
|
child: AppFilledButton(
|
|
|
|
AppFilledButton(
|
|
|
|
|
|
|
|
label: context.translation.close,
|
|
|
|
label: context.translation.close,
|
|
|
|
// maxWidth: true,
|
|
|
|
// maxWidth: true,
|
|
|
|
buttonColor: AppColor.primary10,
|
|
|
|
buttonColor: AppColor.primary10,
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {},
|
|
|
|
|
|
|
|
));
|
|
|
|
},
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
//for nurse to take action...
|
|
|
|
//for nurse to take action...
|
|
|
|
case 7:
|
|
|
|
case 7:
|
|
|
|
return footerContainer(
|
|
|
|
return footerContainer(
|
|
|
|
child:
|
|
|
|
child: AppFilledButton(
|
|
|
|
AppFilledButton(
|
|
|
|
|
|
|
|
label: context.translation.takeAction,
|
|
|
|
label: context.translation.takeAction,
|
|
|
|
// maxWidth: true,
|
|
|
|
// maxWidth: true,
|
|
|
|
buttonColor: AppColor.primary10,
|
|
|
|
buttonColor: AppColor.primary10,
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
ServiceRequestBottomSheet.nurseTakeActionBottomSheet(context: context);
|
|
|
|
ServiceRequestBottomSheet.nurseTakeActionBottomSheet(context: context);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
)
|
|
|
|
));
|
|
|
|
);
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return const SizedBox();
|
|
|
|
return const SizedBox();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|