Merge remote-tracking branch 'origin/export_module_ui_ux_enhancement' into export_module_ui_ux_enhancement

# Conflicts:
#	lib/controllers/api_routes/urls.dart
main_production_RSG
WaseemAbbasi22 1 month ago
commit 69fd82480b

@ -264,13 +264,7 @@ class _CMDetailPageState extends State<CMDetailPage> {
if (filePath != null) {
// Show success dialog using the reusable FileSuccessDialog widget
await FileSuccessDialog.show(
context: context,
filePath: filePath,
title: 'Print Successful',
message: 'Your PDF has been generated successfully',
logPrefix: 'printed',
);
await FileSuccessDialog.show(context: context, filePath: filePath, title: 'Export Successful', message: 'Your PDF has been generated successfully', logPrefix: 'printed');
} else if (exportProvider.errorMessage != null) {
if (mounted) {
exportProvider.errorMessage?.showToast;

@ -29,7 +29,7 @@ class AssetDetailCard extends StatelessWidget {
label: requestDetailProvider.engineerUpdateWorkOrderHelperModel?.equipmentStatus?.name,
id: requestDetailProvider.engineerUpdateWorkOrderHelperModel!.equipmentStatus!.id ?? 0,
radius: 4,
textColor: AppColor.white10,
textColor: AppColor.getEquipmentStatusTextColor(context, requestDetailProvider.engineerUpdateWorkOrderHelperModel!.equipmentStatus!.id ?? 0),
backgroundColor: AppColor.getEquipmentStatusColor(context, requestDetailProvider.engineerUpdateWorkOrderHelperModel!.equipmentStatus!.id ?? 0),
),
if (requestDetailProvider.engineerUpdateWorkOrderHelperModel?.cmFrameId != null) ...[

@ -81,9 +81,9 @@ class _ServiceRequestAssistantEmployeeListState extends State<ServiceRequestAssi
child: AppFilledButton(
label: "Add Assistant Employee".addTranslation,
maxWidth: true,
textColor: AppColor.textColor(context),
buttonColor: context.isDark ? AppColor.neutral60 : AppColor.white10,
icon: Icon(Icons.add_circle, color: AppColor.blueStatus(context)),
// textColor: AppColor.textColor(context),
// buttonColor: context.isDark ? AppColor.neutral60 : AppColor.white10,
icon: Icon(Icons.add_circle, color: AppColor.background(context)),
showIcon: true,
onPressed: _addNewEntry,
),

@ -109,11 +109,11 @@ class _ExternalMaintenanceRequestState extends State<ExternalMaintenanceRequest>
width: 60.toScreenWidth,
decoration: BoxDecoration(
// color: requestDetailProvider.activityMaintenanceHelperModel?.supplier?.suppliername == null ? AppColor.neutral40 : AppColor.neutral100,
color: requestDetailProvider.activityMaintenanceHelperModel?.supplier?.suppliername == null ? AppColor.disableFieldBackground(context) : AppColor.fieldBgColor(context),
color: requestDetailProvider.activityMaintenanceHelperModel?.supplier?.suppliername == null ? AppColor.disableFieldBackground(context) : AppColor.primary10,
borderRadius: BorderRadius.circular(10),
//boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 10)],
),
child: Icon(Icons.add, color: context.isDark ? null : AppColor.neutral60),
child: Icon(Icons.add, color: AppColor.background(context)),
).onPress(requestDetailProvider.activityMaintenanceHelperModel?.supplier?.suppliername == null
? null
: () async {

@ -42,7 +42,7 @@ class FileSuccessDialog {
Align(
alignment: Alignment.topRight,
child: 'clear'.toSvgAsset(
color: AppColor.iconColor(context),
color: AppColor.icon2Color(context),
width: 18,
height: 18,
).onPress(() {
@ -89,9 +89,9 @@ class FileSuccessDialog {
}
},
label: 'Open',
buttonColor: AppColor.primary10,
// buttonColor: AppColor.primary10,
showIcon: true,
icon: const Icon(Icons.folder_open, color: Colors.white),
icon: Icon(Icons.folder_open, color: AppColor.background(context)),
height: 48,
),
),

@ -431,15 +431,31 @@ class AppColor {
switch (id) {
case 368:
//partially Down
return greenStatus(context);
return greenStatusColor;
case 369:
// Completely Down
return redStatus(context);
return redStatusColor;
case 790:
//UP
return blueStatus(context);
return blueStatusColor;
default:
return blueStatusColor;
}
}
static Color getEquipmentStatusTextColor(BuildContext context, int id) {
switch (id) {
case 368:
//partially Down
return greenStatusTextColor;
case 369:
// Completely Down
return redStatusTextColor;
case 790:
//UP
return blueStatusTextColor;
default:
return blueStatus(context);
return blueStatusTextColor;
}
}
}

@ -44,98 +44,99 @@ class _AddSupplierEngineerBottomSheetState extends State<AddSupplierEngineerBott
@override
Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context, listen: false);
return Wrap(
children: [
Form(
key: _formKey,
child: SingleChildScrollView(
child: Column(
children: [
Container(
width: 40.toScreenWidth,
height: 5.toScreenHeight,
decoration: BoxDecoration(color: AppColor.neutral40, borderRadius: BorderRadius.circular(30)),
),
Align(
alignment: AlignmentDirectional.centerStart,
child: "Add Engineer For Supplier".heading5(context).custom(fontWeight: FontWeight.w600).paddingOnly(top: 16, bottom: 16),
),
8.height,
AppTextFormField(
labelText: "Engineer Supplier Name".addTranslation,
textInputType: TextInputType.name,
onChange: (text) {
engineer.personName = text.isEmpty ? null : text;
},
onSaved: (text) {
engineer.personName = text.isEmpty ? null : text;
},
),
8.height,
SingleItemDropDownMenu<Lookup, SupplierEngineerProvider>(
context: context,
title: "Role",
initialValue: suppEngRole,
onSelect: (value) {
if (value != null) {
suppEngRole = value;
}
},
),
8.height,
AppTextFormField(
labelText: "Contact".addTranslation,
textInputType: TextInputType.name,
onChange: (text) {
engineer.contact = text.isEmpty ? null : text;
},
onSaved: (text) {
engineer.contact = text.isEmpty ? null : text;
},
),
8.height,
AppTextFormField(
labelText: "Email".addTranslation,
textInputType: TextInputType.emailAddress,
onChange: (text) {
engineer.email = text.isEmpty ? null : text;
},
onSaved: (text) {
engineer.email = text.isEmpty ? null : text;
},
),
8.height,
16.height,
Consumer<ServiceRequestsProvider>(
builder: (context, snapshot, _) => AppFilledButton(
label: context.translation.save,
loading: snapshot.isLoading ?? false,
onPressed: () async {
_formKey.currentState!.save();
if (engineer.personName?.isEmpty ?? true) {
"Engineer supplier name is empty".showToast;
return;
return SafeArea(
child: Wrap(
children: [
Form(
key: _formKey,
child: SingleChildScrollView(
child: Column(
children: [
Container(
width: 40.toScreenWidth,
height: 5.toScreenHeight,
decoration: BoxDecoration(color: AppColor.neutral40, borderRadius: BorderRadius.circular(30)),
),
Align(
alignment: AlignmentDirectional.centerStart,
child: "Add Engineer For Supplier".heading5(context).custom(fontWeight: FontWeight.w600).paddingOnly(top: 16, bottom: 16),
),
12.height,
AppTextFormField(
labelText: "Engineer Supplier Name".addTranslation,
textInputType: TextInputType.name,
onChange: (text) {
engineer.personName = text.isEmpty ? null : text;
},
onSaved: (text) {
engineer.personName = text.isEmpty ? null : text;
},
),
12.height,
SingleItemDropDownMenu<Lookup, SupplierEngineerProvider>(
context: context,
title: "Role",
initialValue: suppEngRole,
onSelect: (value) {
if (value != null) {
suppEngRole = value;
}
},
),
12.height,
AppTextFormField(
labelText: "Contact".addTranslation,
textInputType: TextInputType.name,
onChange: (text) {
engineer.contact = text.isEmpty ? null : text;
},
onSaved: (text) {
engineer.contact = text.isEmpty ? null : text;
},
),
12.height,
AppTextFormField(
labelText: "Email".addTranslation,
textInputType: TextInputType.emailAddress,
onChange: (text) {
engineer.email = text.isEmpty ? null : text;
},
onSaved: (text) {
engineer.email = text.isEmpty ? null : text;
},
),
24.height,
Consumer<ServiceRequestsProvider>(
builder: (context, snapshot, _) => AppFilledButton(
label: context.translation.save,
loading: snapshot.isLoading ?? false,
onPressed: () async {
_formKey.currentState!.save();
engineer.personRoleId = suppEngRole?.id;
if (engineer.personName?.isEmpty ?? true) {
"Engineer supplier name is empty".showToast;
return;
}
SuppEngineerWorkOrders? suppEngineer = await snapshot.addSupplierEngineer(engineer);
if (suppEngineer == null) {
Fluttertoast.showToast(msg: context.translation.failedToCompleteRequest);
return;
}
Fluttertoast.showToast(msg: context.translation.successfulRequestMessage);
Navigator.pop(context, suppEngineer);
},
engineer.personRoleId = suppEngRole?.id;
SuppEngineerWorkOrders? suppEngineer = await snapshot.addSupplierEngineer(engineer);
if (suppEngineer == null) {
Fluttertoast.showToast(msg: context.translation.failedToCompleteRequest);
return;
}
Fluttertoast.showToast(msg: context.translation.successfulRequestMessage);
Navigator.pop(context, suppEngineer);
},
),
),
),
16.height,
],
16.height,
],
),
),
),
)
],
)
],
),
);
}
}

Loading…
Cancel
Save