merge conflict resolve.
							parent
							
								
									69ae0147bb
								
							
						
					
					
						commit
						c6d8c299f7
					
				@ -1,165 +1,141 @@
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
import 'package:test_sa/extensions/context_extension.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/new_views/app_style/app_color.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';
 | 
			
		||||
 | 
			
		||||
class FooterActionButton  {
 | 
			
		||||
 | 
			
		||||
  static Widget footerContainer({required Widget child}){
 | 
			
		||||
class FooterActionButton {
 | 
			
		||||
  static Widget footerContainer({required Widget child}) {
 | 
			
		||||
    return Align(
 | 
			
		||||
      alignment: Alignment.bottomCenter,
 | 
			
		||||
      child: Container(
 | 
			
		||||
        padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth,vertical: 16.toScreenHeight),
 | 
			
		||||
        padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 16.toScreenHeight),
 | 
			
		||||
        color: AppColor.white10,
 | 
			
		||||
        child: child,
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  static Widget requestDetailsFooterWidget({required int status,required BuildContext context}){
 | 
			
		||||
    switch(status){
 | 
			
		||||
  static Widget requestDetailsFooterWidget({required int status, required BuildContext context}) {
 | 
			
		||||
    switch (status) {
 | 
			
		||||
      //accept reject...
 | 
			
		||||
      case 1:
 | 
			
		||||
        return footerContainer(
 | 
			
		||||
            child:
 | 
			
		||||
            Row(
 | 
			
		||||
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
 | 
			
		||||
              mainAxisSize: MainAxisSize.min,
 | 
			
		||||
              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:
 | 
			
		||||
            child: Row(
 | 
			
		||||
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
 | 
			
		||||
          mainAxisSize: MainAxisSize.min,
 | 
			
		||||
          children: [
 | 
			
		||||
            AppFilledButton(
 | 
			
		||||
              label: context.translation.verify_asset_details,
 | 
			
		||||
              // maxWidth: true,
 | 
			
		||||
              buttonColor: AppColor.primary10,
 | 
			
		||||
              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;
 | 
			
		||||
        //Activities
 | 
			
		||||
      case 4:
 | 
			
		||||
      //need visit fixed remotely
 | 
			
		||||
      case 2:
 | 
			
		||||
        return footerContainer(
 | 
			
		||||
            child:
 | 
			
		||||
            child: Row(
 | 
			
		||||
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
 | 
			
		||||
          mainAxisSize: MainAxisSize.min,
 | 
			
		||||
          children: [
 | 
			
		||||
            AppFilledButton(
 | 
			
		||||
              label: context.translation.activities,
 | 
			
		||||
              // maxWidth: true,
 | 
			
		||||
              label: context.translation.needAVisit,
 | 
			
		||||
              maxWidth: true,
 | 
			
		||||
              buttonColor: AppColor.neutral50,
 | 
			
		||||
              onPressed: () async {
 | 
			
		||||
                ServiceRequestBottomSheet.activityTypeBottomSheet(context: context);
 | 
			
		||||
                ServiceRequestBottomSheet.initialVisitBottomSheet(context: context);
 | 
			
		||||
              },
 | 
			
		||||
            )
 | 
			
		||||
        );
 | 
			
		||||
        break;
 | 
			
		||||
        //I have arrived...
 | 
			
		||||
        case 5:
 | 
			
		||||
        return footerContainer(
 | 
			
		||||
            child:
 | 
			
		||||
            ).expanded,
 | 
			
		||||
            const SizedBox(
 | 
			
		||||
              width: 20,
 | 
			
		||||
            ),
 | 
			
		||||
            AppFilledButton(
 | 
			
		||||
              label: context.translation.iHaveArrived,
 | 
			
		||||
              //showIcon: true,
 | 
			
		||||
             // icon: 'arrived_icon'.toSvgAsset(),
 | 
			
		||||
              label: context.translation.fixedRemotely,
 | 
			
		||||
              maxWidth: true,
 | 
			
		||||
              buttonColor: AppColor.green70,
 | 
			
		||||
              onPressed: () async {
 | 
			
		||||
 | 
			
		||||
                ServiceRequestBottomSheet.fixRemotelyBottomSheet(context: context);
 | 
			
		||||
              },
 | 
			
		||||
            )
 | 
			
		||||
        );
 | 
			
		||||
            ).expanded,
 | 
			
		||||
          ],
 | 
			
		||||
        ));
 | 
			
		||||
        break;
 | 
			
		||||
        //Close..
 | 
			
		||||
        case 6:
 | 
			
		||||
      //verify Asset Details
 | 
			
		||||
      case 3:
 | 
			
		||||
        return footerContainer(
 | 
			
		||||
            child:
 | 
			
		||||
            AppFilledButton(
 | 
			
		||||
              label: context.translation.close,
 | 
			
		||||
              // maxWidth: true,
 | 
			
		||||
              buttonColor: AppColor.primary10,
 | 
			
		||||
              onPressed: () async {
 | 
			
		||||
 | 
			
		||||
              },
 | 
			
		||||
            )
 | 
			
		||||
        );
 | 
			
		||||
            child: AppFilledButton(
 | 
			
		||||
          label: context.translation.verify_asset_details,
 | 
			
		||||
          // maxWidth: true,
 | 
			
		||||
          buttonColor: AppColor.primary10,
 | 
			
		||||
          onPressed: () async {},
 | 
			
		||||
        ));
 | 
			
		||||
        break;
 | 
			
		||||
        //for nurse to take action...
 | 
			
		||||
        case 7:
 | 
			
		||||
      //Activities
 | 
			
		||||
      case 4:
 | 
			
		||||
        return footerContainer(
 | 
			
		||||
            child:
 | 
			
		||||
            AppFilledButton(
 | 
			
		||||
              label: context.translation.takeAction,
 | 
			
		||||
              // maxWidth: true,
 | 
			
		||||
              buttonColor: AppColor.primary10,
 | 
			
		||||
              onPressed: () async {
 | 
			
		||||
               ServiceRequestBottomSheet.nurseTakeActionBottomSheet(context: context);
 | 
			
		||||
              },
 | 
			
		||||
            )
 | 
			
		||||
        );
 | 
			
		||||
            child: AppFilledButton(
 | 
			
		||||
          label: context.translation.activities,
 | 
			
		||||
          // maxWidth: true,
 | 
			
		||||
          buttonColor: AppColor.neutral50,
 | 
			
		||||
          onPressed: () async {
 | 
			
		||||
            ServiceRequestBottomSheet.activityTypeBottomSheet(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;
 | 
			
		||||
 | 
			
		||||
      default:
 | 
			
		||||
        return const SizedBox();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
					Loading…
					
					
				
		Reference in New Issue