merge conflict resolve.
parent
69ae0147bb
commit
c6d8c299f7
@ -1,165 +1,141 @@
|
|||||||
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: [
|
|
||||||
AppFilledButton(
|
|
||||||
label: context.translation.reject,
|
|
||||||
maxWidth: true,
|
|
||||||
buttonColor: Colors.white54,
|
|
||||||
textColor: AppColor.red30,
|
|
||||||
showBorder: true,
|
|
||||||
onPressed: () async {
|
|
||||||
ServiceRequestBottomSheet.rejectRequestBottomSheet(context: context);
|
|
||||||
},
|
|
||||||
).expanded,
|
|
||||||
const SizedBox(
|
|
||||||
width: 20,
|
|
||||||
),
|
|
||||||
AppFilledButton(
|
|
||||||
label: context.translation.accept,
|
|
||||||
maxWidth: true,
|
|
||||||
buttonColor: AppColor.green70,
|
|
||||||
onPressed: () async {
|
|
||||||
},
|
|
||||||
).expanded,
|
|
||||||
],
|
|
||||||
)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
//need visit fixed remotely
|
|
||||||
case 2:
|
|
||||||
return footerContainer(
|
|
||||||
child:
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
AppFilledButton(
|
|
||||||
label: context.translation.needAVisit,
|
|
||||||
maxWidth: true,
|
|
||||||
buttonColor: AppColor.neutral50,
|
|
||||||
onPressed: () async {
|
|
||||||
ServiceRequestBottomSheet.initialVisitBottomSheet(context: context);
|
|
||||||
},
|
|
||||||
).expanded,
|
|
||||||
const SizedBox(
|
|
||||||
width: 20,
|
|
||||||
),
|
|
||||||
AppFilledButton(
|
|
||||||
label: context.translation.fixedRemotely,
|
|
||||||
maxWidth: true,
|
|
||||||
buttonColor: AppColor.green70,
|
|
||||||
onPressed: () async {
|
|
||||||
ServiceRequestBottomSheet.fixRemotelyBottomSheet(context: context);
|
|
||||||
},
|
|
||||||
).expanded,
|
|
||||||
],
|
|
||||||
)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
//verify Asset Details
|
|
||||||
case 3:
|
|
||||||
return footerContainer(
|
|
||||||
child:
|
|
||||||
AppFilledButton(
|
AppFilledButton(
|
||||||
label: context.translation.verify_asset_details,
|
label: context.translation.reject,
|
||||||
// maxWidth: true,
|
maxWidth: true,
|
||||||
buttonColor: AppColor.primary10,
|
buttonColor: Colors.white54,
|
||||||
|
textColor: AppColor.red30,
|
||||||
|
showBorder: true,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
ServiceRequestBottomSheet.rejectRequestBottomSheet(context: context);
|
||||||
},
|
},
|
||||||
)
|
).expanded,
|
||||||
);
|
const SizedBox(
|
||||||
|
width: 20,
|
||||||
|
),
|
||||||
|
AppFilledButton(
|
||||||
|
label: context.translation.accept,
|
||||||
|
maxWidth: true,
|
||||||
|
buttonColor: AppColor.green70,
|
||||||
|
onPressed: () async {},
|
||||||
|
).expanded,
|
||||||
|
],
|
||||||
|
));
|
||||||
break;
|
break;
|
||||||
//Activities
|
//need visit fixed remotely
|
||||||
case 4:
|
case 2:
|
||||||
return footerContainer(
|
return footerContainer(
|
||||||
child:
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
AppFilledButton(
|
AppFilledButton(
|
||||||
label: context.translation.activities,
|
label: context.translation.needAVisit,
|
||||||
// maxWidth: true,
|
maxWidth: true,
|
||||||
buttonColor: AppColor.neutral50,
|
buttonColor: AppColor.neutral50,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
ServiceRequestBottomSheet.activityTypeBottomSheet(context: context);
|
ServiceRequestBottomSheet.initialVisitBottomSheet(context: context);
|
||||||
},
|
},
|
||||||
)
|
).expanded,
|
||||||
);
|
const SizedBox(
|
||||||
break;
|
width: 20,
|
||||||
//I have arrived...
|
),
|
||||||
case 5:
|
|
||||||
return footerContainer(
|
|
||||||
child:
|
|
||||||
AppFilledButton(
|
AppFilledButton(
|
||||||
label: context.translation.iHaveArrived,
|
label: context.translation.fixedRemotely,
|
||||||
//showIcon: true,
|
maxWidth: true,
|
||||||
// icon: 'arrived_icon'.toSvgAsset(),
|
|
||||||
buttonColor: AppColor.green70,
|
buttonColor: AppColor.green70,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
ServiceRequestBottomSheet.fixRemotelyBottomSheet(context: context);
|
||||||
},
|
},
|
||||||
)
|
).expanded,
|
||||||
);
|
],
|
||||||
|
));
|
||||||
break;
|
break;
|
||||||
//Close..
|
//verify Asset Details
|
||||||
case 6:
|
case 3:
|
||||||
return footerContainer(
|
return footerContainer(
|
||||||
child:
|
child: AppFilledButton(
|
||||||
AppFilledButton(
|
label: context.translation.verify_asset_details,
|
||||||
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...
|
//Activities
|
||||||
case 7:
|
case 4:
|
||||||
return footerContainer(
|
return footerContainer(
|
||||||
child:
|
child: AppFilledButton(
|
||||||
AppFilledButton(
|
label: context.translation.activities,
|
||||||
label: context.translation.takeAction,
|
// maxWidth: true,
|
||||||
// maxWidth: true,
|
buttonColor: AppColor.neutral50,
|
||||||
buttonColor: AppColor.primary10,
|
onPressed: () async {
|
||||||
onPressed: () async {
|
ServiceRequestBottomSheet.activityTypeBottomSheet(context: context);
|
||||||
ServiceRequestBottomSheet.nurseTakeActionBottomSheet(context: context);
|
},
|
||||||
},
|
));
|
||||||
)
|
break;
|
||||||
);
|
//I have arrived...
|
||||||
|
case 5:
|
||||||
|
return footerContainer(
|
||||||
|
child: AppFilledButton(
|
||||||
|
label: context.translation.iHaveArrived,
|
||||||
|
//showIcon: true,
|
||||||
|
// icon: 'arrived_icon'.toSvgAsset(),
|
||||||
|
buttonColor: AppColor.green70,
|
||||||
|
onPressed: () async {},
|
||||||
|
));
|
||||||
|
break;
|
||||||
|
//Close..
|
||||||
|
case 6:
|
||||||
|
return footerContainer(
|
||||||
|
child: AppFilledButton(
|
||||||
|
label: context.translation.close,
|
||||||
|
// maxWidth: true,
|
||||||
|
buttonColor: AppColor.primary10,
|
||||||
|
onPressed: () async {},
|
||||||
|
));
|
||||||
|
break;
|
||||||
|
//for nurse to take action...
|
||||||
|
case 7:
|
||||||
|
return footerContainer(
|
||||||
|
child: AppFilledButton(
|
||||||
|
label: context.translation.takeAction,
|
||||||
|
// maxWidth: true,
|
||||||
|
buttonColor: AppColor.primary10,
|
||||||
|
onPressed: () async {
|
||||||
|
ServiceRequestBottomSheet.nurseTakeActionBottomSheet(context: context);
|
||||||
|
},
|
||||||
|
));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue