improvements

main_production_RSG
Sikander Saleem 1 month ago
parent c7494b2354
commit 0ee21c0011

@ -7,8 +7,9 @@ class URLs {
// static const host1 = "https://atomsmdev.hmg.com"; // local DEV url // static const host1 = "https://atomsmdev.hmg.com"; // local DEV url
static const host1 = "https://atomsmuat.hmg.com"; // local UAT url static const host1 = "https://atomsmuat.hmg.com"; // local UAT url
static final String _baseUrl = "$_host/mobile"; // host local UAT // static final String _baseUrl = "$_host/mobile"; // host local UAT
// static final String _baseUrl = "$_host/v1/mobile"; // new V2 apis // static final String _baseUrl = "$_host/v1/mobile";
static final String _baseUrl = "$_host/v2/mobile"; // new V2 apis
// static final String _baseUrl = "$_host/v3/mobile"; // v3 for production CM,PM,TM // static final String _baseUrl = "$_host/v3/mobile"; // v3 for production CM,PM,TM
// static final String _baseUrl = "$_host/v4/mobile"; // v4 for Demo module // static final String _baseUrl = "$_host/v4/mobile"; // v4 for Demo module
// static final String _baseUrl = "$_host/v5/mobile"; // v5 for data segregation // static final String _baseUrl = "$_host/v5/mobile"; // v5 for data segregation

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

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

@ -109,11 +109,11 @@ class _ExternalMaintenanceRequestState extends State<ExternalMaintenanceRequest>
width: 60.toScreenWidth, width: 60.toScreenWidth,
decoration: BoxDecoration( decoration: BoxDecoration(
// color: requestDetailProvider.activityMaintenanceHelperModel?.supplier?.suppliername == null ? AppColor.neutral40 : AppColor.neutral100, // 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), borderRadius: BorderRadius.circular(10),
//boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 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 ).onPress(requestDetailProvider.activityMaintenanceHelperModel?.supplier?.suppliername == null
? null ? null
: () async { : () async {

@ -431,15 +431,31 @@ class AppColor {
switch (id) { switch (id) {
case 368: case 368:
//partially Down //partially Down
return greenStatus(context); return greenStatusColor;
case 369: case 369:
// Completely Down // Completely Down
return redStatus(context); return redStatusColor;
case 790: case 790:
//UP //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: default:
return blueStatus(context); return blueStatusTextColor;
} }
} }
} }

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

Loading…
Cancel
Save