Compare commits

..

No commits in common. 'e4b84bb3e0fa998c3d3fe246b23ca6a19d080988' and 'abe29fc7b3e37a05a16f867db682a5d31e6c1f92' have entirely different histories.

@ -67,7 +67,7 @@ class _InspectionPersonBottomSheetState extends State<InspectionPersonBottomShee
top: 16, top: 16,
left: 16, left: 16,
right: 16, right: 16,
bottom: MediaQuery.of(context).viewInsets.bottom+MediaQuery.of(context).padding.bottom, bottom: MediaQuery.of(context).viewInsets.bottom,
), ),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,

@ -46,12 +46,7 @@ class _DemoExtensionBottomSheetState extends State<DemoExtensionBottomSheet> {
topLeft: Radius.circular(30), topLeft: Radius.circular(30),
), ),
), ),
padding: EdgeInsets.only( padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 8.toScreenHeight),
left: 16.toScreenWidth,
right: 16.toScreenWidth,
top: 8.toScreenHeight,
bottom: MediaQuery.of(context).viewInsets.bottom + MediaQuery.of(context).padding.bottom,
),
child: SafeArea( child: SafeArea(
child: Form( child: Form(
key: _formKey, key: _formKey,
@ -98,7 +93,7 @@ class _DemoExtensionBottomSheetState extends State<DemoExtensionBottomSheet> {
textColor: AppColor.black10, textColor: AppColor.black10,
loading: false, loading: false,
onPressed: () async { onPressed: () async {
Navigator.pop(context, false); Navigator.pop(context,false);
}, },
).expanded, ).expanded,
16.width, 16.width,

@ -423,7 +423,6 @@ class SwipeGeneralUtils {
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
useSafeArea: true,
shape: const RoundedRectangleBorder( shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical( borderRadius: BorderRadius.vertical(
top: Radius.circular(20), top: Radius.circular(20),
@ -431,28 +430,22 @@ class SwipeGeneralUtils {
), ),
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
clipBehavior: Clip.antiAliasWithSaveLayer, clipBehavior: Clip.antiAliasWithSaveLayer,
builder: (BuildContext context) =>Padding( builder: (BuildContext context) => Column(
padding: EdgeInsets.only( mainAxisSize: MainAxisSize.min,
bottom: MediaQuery.of(context).viewInsets.bottom + crossAxisAlignment: CrossAxisAlignment.start,
MediaQuery.of(context).padding.bottom, children: [
), context.translation.markAttendance.heading4(context).custom(color:context.isDark?AppColor.white50: AppColor.white936),
child: Column( 8.height,
mainAxisSize: MainAxisSize.min, context.translation.selectMethodToMarkAttendance.bodyText2(context).custom(color: AppColor.neutral120),
crossAxisAlignment: CrossAxisAlignment.start, 12.height,
children: [ GridView(
context.translation.markAttendance.heading4(context).custom(color:context.isDark?AppColor.white50: AppColor.white936), padding: const EdgeInsets.all(0),
8.height, shrinkWrap: true,
context.translation.selectMethodToMarkAttendance.bodyText2(context).custom(color: AppColor.neutral120), physics: const NeverScrollableScrollPhysics(),
12.height, gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 1, crossAxisSpacing: 12, mainAxisSpacing: 12),
GridView( children: availableAttendanceMethodList(context: context, userProvider: _userProvider, isNfcSupported: isNfcSupported)),
padding: const EdgeInsets.all(0), ],
shrinkWrap: true, ).paddingAll(16),
physics: const NeverScrollableScrollPhysics(),
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 1, crossAxisSpacing: 12, mainAxisSpacing: 12),
children: availableAttendanceMethodList(context: context, userProvider: _userProvider, isNfcSupported: isNfcSupported)),
],
).paddingAll(16),
),
); );
} }

@ -53,12 +53,7 @@ class _AddSupplierEngineerBottomSheetState extends State<AddSupplierEngineerBott
color: Theme.of(context).scaffoldBackgroundColor, color: Theme.of(context).scaffoldBackgroundColor,
borderRadius: const BorderRadius.only(topRight: Radius.circular(20), topLeft: Radius.circular(20)), borderRadius: const BorderRadius.only(topRight: Radius.circular(20), topLeft: Radius.circular(20)),
), ),
padding: EdgeInsets.only( padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 8.toScreenHeight),
left: 16.toScreenWidth,
right: 16.toScreenHeight,
top: 8.toScreenHeight,
bottom: MediaQuery.of(context).viewInsets.bottom + MediaQuery.of(context).padding.bottom,
),
child: Form( child: Form(
key: _formKey, key: _formKey,
child: SingleChildScrollView( child: SingleChildScrollView(

@ -44,90 +44,85 @@ class _UpdateUserContactInfoBottomSheetState extends State<UpdateUserContactInfo
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return Column(
padding: EdgeInsets.only( crossAxisAlignment: CrossAxisAlignment.start,
bottom: MediaQuery.of(context).viewInsets.bottom + MediaQuery.of(context).padding.bottom, mainAxisSize: MainAxisSize.min,
), children: [
child: Column( AppTextFormField(
crossAxisAlignment: CrossAxisAlignment.start, labelText: "Email",
mainAxisSize: MainAxisSize.min, backgroundColor: AppColor.fieldBgColor(context),
children: [ initialValue: widget.uEmail,
AppTextFormField( textAlign: TextAlign.center,
labelText: "Email", hintText: "email@example.com",
backgroundColor: AppColor.fieldBgColor(context), labelStyle: AppTextStyles.textFieldLabelStyle,
initialValue: widget.uEmail, hintStyle: AppTextStyles.textFieldLabelStyle,
textAlign: TextAlign.center, textInputType: TextInputType.emailAddress,
hintText: "email@example.com", showShadow: false,
labelStyle: AppTextStyles.textFieldLabelStyle, onChange: (value) {
hintStyle: AppTextStyles.textFieldLabelStyle, email = value;
textInputType: TextInputType.emailAddress, },
showShadow: false, style: Theme.of(context).textTheme.titleMedium,
onChange: (value) { ),
email = value; 12.height,
}, AppTextFormField(
style: Theme.of(context).textTheme.titleMedium, labelText: "Phone Number",
), backgroundColor: AppColor.fieldBgColor(context),
12.height, initialValue: widget.uPhoneNo,
AppTextFormField( textAlign: TextAlign.center,
labelText: "Phone Number", hintText: "05xxxxxxxx",
backgroundColor: AppColor.fieldBgColor(context), labelStyle: AppTextStyles.textFieldLabelStyle,
initialValue: widget.uPhoneNo, hintStyle: AppTextStyles.textFieldLabelStyle,
textAlign: TextAlign.center, textInputType: TextInputType.phone,
hintText: "05xxxxxxxx", showShadow: false,
labelStyle: AppTextStyles.textFieldLabelStyle, onChange: (value) {
hintStyle: AppTextStyles.textFieldLabelStyle, phoneNo = value;
textInputType: TextInputType.phone, },
showShadow: false, style: Theme.of(context).textTheme.titleMedium,
onChange: (value) { ),
phoneNo = value; 12.height,
}, AppTextFormField(
style: Theme.of(context).textTheme.titleMedium, labelText: "Extension No",
), backgroundColor: AppColor.fieldBgColor(context),
12.height, initialValue: widget.uExtensionNo,
AppTextFormField( textAlign: TextAlign.center,
labelText: "Extension No", hintText: "1234",
backgroundColor: AppColor.fieldBgColor(context), labelStyle: AppTextStyles.textFieldLabelStyle,
initialValue: widget.uExtensionNo, hintStyle: AppTextStyles.textFieldLabelStyle,
textAlign: TextAlign.center, textInputType: const TextInputType.numberWithOptions(decimal: true),
hintText: "1234", showShadow: false,
labelStyle: AppTextStyles.textFieldLabelStyle, onChange: (value) {
hintStyle: AppTextStyles.textFieldLabelStyle, extensionNo = value;
textInputType: const TextInputType.numberWithOptions(decimal: true), },
showShadow: false, style: Theme.of(context).textTheme.titleMedium,
onChange: (value) { ),
extensionNo = value; 12.height,
}, AppFilledButton(
style: Theme.of(context).textTheme.titleMedium, label: "Update",
), buttonColor: context.isDark? AppColor.primary10:AppColor.neutral50,
12.height, onPressed: () async {
AppFilledButton( FocusManager.instance.primaryFocus!.unfocus();
label: "Update", if (email.isEmpty || !Validator.isEmail(email)) {
buttonColor: context.isDark ? AppColor.primary10 : AppColor.neutral50, "Please enter valid email".showToast;
onPressed: () async { return;
FocusManager.instance.primaryFocus!.unfocus(); }
if (email.isEmpty || !Validator.isEmail(email)) { if (phoneNo.isEmpty || phoneNo.length != 10) {
"Please enter valid email".showToast; "Please enter valid phone number".showToast;
return; return;
} }
if (phoneNo.isEmpty || phoneNo.length != 10) { if (extensionNo.isEmpty) {
"Please enter valid phone number".showToast; "Please enter extension".showToast;
return; return;
} }
if (extensionNo.isEmpty) { showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
"Please enter extension".showToast; bool status = await context.userProvider.updateContactInfo(widget.userID, email, phoneNo, extensionNo);
return; Navigator.pop(context);
} if (status) {
showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
bool status = await context.userProvider.updateContactInfo(widget.userID, email, phoneNo, extensionNo);
Navigator.pop(context); Navigator.pop(context);
if (status) { widget.onUpdate(email, phoneNo, extensionNo);
Navigator.pop(context); }
widget.onUpdate(email, phoneNo, extensionNo); },
} ),
}, ],
),
],
),
); );
} }
} }

@ -14,76 +14,70 @@ class AssetDetailBottomSheet extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return Column(
padding: EdgeInsets.only( crossAxisAlignment: CrossAxisAlignment.start,
bottom: MediaQuery.of(context).viewInsets.bottom + mainAxisSize: MainAxisSize.min,
MediaQuery.of(context).padding.bottom, children: [
), (asset?.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-").heading5(context),
child: Column( 16.height,
crossAxisAlignment: CrossAxisAlignment.start, AspectRatio(
mainAxisSize: MainAxisSize.min, aspectRatio: 358 / 136,
children: [ child: Container(
(asset?.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-").heading5(context), width: 95,
16.height, height: 95,
AspectRatio( decoration: ShapeDecoration(
aspectRatio: 358 / 136, color: AppColor.neutral30,
child: Container( shape: RoundedRectangleBorder(
width: 95, borderRadius: BorderRadius.circular(10),
height: 95, ),
decoration: ShapeDecoration( image: DecorationImage(
color: AppColor.neutral30, fit: BoxFit.cover,
shape: RoundedRectangleBorder( image: NetworkImage(asset?.assetPhoto != null ? URLs.getFileUrl(asset!.assetPhoto)! : "https://www.lasteelcraft.com/images/no-image-available.png"),
borderRadius: BorderRadius.circular(10), )),
),
image: DecorationImage(
fit: BoxFit.cover,
image: NetworkImage(asset?.assetPhoto != null ? URLs.getFileUrl(asset!.assetPhoto)! : "https://www.lasteelcraft.com/images/no-image-available.png"),
)),
),
), ),
16.height, ),
Column( 16.height,
mainAxisAlignment: MainAxisAlignment.spaceBetween, Column(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Row( children: [
crossAxisAlignment: CrossAxisAlignment.start, Row(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
"${context.translation.assetNo}: ${asset!.assetNumber}".bodyText(context), children: [
"${context.translation.modelName}: ${asset!.modelDefinition?.modelName}".bodyText(context), "${context.translation.assetNo}: ${asset!.assetNumber}".bodyText(context),
"${context.translation.supplier}: ${asset!.supplier?.suppliername?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context), "${context.translation.modelName}: ${asset!.modelDefinition?.modelName}".bodyText(context),
"${context.translation.manufacture}: ${asset!.modelDefinition?.manufacturerName?.cleanupWhitespace.capitalizeFirstOfEach}".bodyText(context), "${context.translation.supplier}: ${asset!.supplier?.suppliername?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context),
//"${context.translation.location}: ${assetModel.site.custName?.cleanupWhitespace?.capitalizeFirstOfEach}".bodyText(context), "${context.translation.manufacture}: ${asset!.modelDefinition?.manufacturerName?.cleanupWhitespace.capitalizeFirstOfEach}".bodyText(context),
], //"${context.translation.location}: ${assetModel.site.custName?.cleanupWhitespace?.capitalizeFirstOfEach}".bodyText(context),
).expanded, ],
8.width, ).expanded,
Column( 8.width,
crossAxisAlignment: CrossAxisAlignment.start, Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
"${context.translation.snNo}: ${asset!.assetSerialNo}".bodyText(context), children: [
"${context.translation.site}: ${asset?.site?.custName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context), "${context.translation.snNo}: ${asset!.assetSerialNo}".bodyText(context),
"${context.translation.building}: ${asset?.building?.name?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context), "${context.translation.site}: ${asset?.site?.custName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context),
"${context.translation.floor}: ${asset?.floor?.name?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context), "${context.translation.building}: ${asset?.building?.name?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context),
"${context.translation.md}: ${asset?.department?.departmentName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context), "${context.translation.floor}: ${asset?.floor?.name?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context),
"${context.translation.room}: ${asset?.room?.name ?? "-"}".bodyText(context), "${context.translation.md}: ${asset?.department?.departmentName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context),
], "${context.translation.room}: ${asset?.room?.name ?? "-"}".bodyText(context),
).expanded, ],
], ).expanded,
), ],
),
8.height,
if ((asset?.modelDefinition?.assetDescription ?? "").isNotEmpty) ...[
8.height,
const Divider(color: AppColor.neutral30, height: 1, thickness: 1),
8.height, 8.height,
if ((asset?.modelDefinition?.assetDescription ?? "").isNotEmpty) ...[ asset!.modelDefinition!.assetDescription!.bodyText(context),
8.height, ]
const Divider(color: AppColor.neutral30, height: 1, thickness: 1), ],
8.height, )
asset!.modelDefinition!.assetDescription!.bodyText(context), ],
] ).paddingAll(16);
],
)
],
).paddingAll(16),
);
} }
} }

@ -17,12 +17,7 @@ class PendingRequestBottomSheet extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: EdgeInsets.only( padding: const EdgeInsets.all(21),
left: 21,
right: 21,
top: 12,
bottom: MediaQuery.of(context).viewInsets.bottom + MediaQuery.of(context).padding.bottom,
),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,

@ -41,65 +41,60 @@ class _RejectionReasonBottomSheetState extends State<RejectionReasonBottomSheet>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Form( return Form(
key: _formKey, key: _formKey,
child: Padding( child: Column(
padding: EdgeInsetsGeometry.only( crossAxisAlignment: CrossAxisAlignment.start,
bottom: MediaQuery.of(context).viewInsets.bottom + MediaQuery.of(context).padding.bottom, mainAxisSize: MainAxisSize.min,
), children: [
child: Column( SingleItemDropDownMenu<Lookup, RejectReasonProvider>(
crossAxisAlignment: CrossAxisAlignment.start, context: context,
mainAxisSize: MainAxisSize.min, title: context.translation.reason,
children: [ backgroundColor: AppColor.fieldBgColor(context),
SingleItemDropDownMenu<Lookup, RejectReasonProvider>( showShadow: false,
context: context, showAsBottomSheet: true,
title: context.translation.reason, validator: (value) {
backgroundColor: AppColor.fieldBgColor(context), if (value == null) return "Mandatory";
showShadow: false, return null;
showAsBottomSheet: true, },
validator: (value) { onSelect: (value) {
if (value == null) return "Mandatory"; selectedReason = value;
return null; },
}, ),
onSelect: (value) { 12.height,
selectedReason = value; AppTextFormField(
}, backgroundColor: AppColor.fieldBgColor(context),
), labelText: context.translation.comments,
12.height, controller: _commentController,
AppTextFormField( textInputType: TextInputType.multiline,
backgroundColor: AppColor.fieldBgColor(context), alignLabelWithHint: true,
labelText: context.translation.comments, showSpeechToText: true,
controller: _commentController, showShadow: false,
textInputType: TextInputType.multiline, style: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)),
alignLabelWithHint: true, labelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff767676)),
showSpeechToText: true, floatingLabelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)),
showShadow: false, validator: (value) {
style: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)), if ((value ?? "").isEmpty) return "Mandatory";
labelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff767676)), return null;
floatingLabelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)), },
validator: (value) { ),
if ((value ?? "").isEmpty) return "Mandatory"; 16.height,
return null; AppFilledButton(
}, label: context.translation.reject,
), buttonColor: AppColor.red30,
16.height, onPressed: () async {
AppFilledButton( if (_formKey.currentState!.validate()) {
label: context.translation.reject, _formKey.currentState!.save();
buttonColor: AppColor.red30, Utils.showLoading(context);
onPressed: () async { bool isSuccess = await widget.onRejectPressed(selectedReason!.id!, _commentController.text);
if (_formKey.currentState!.validate()) { Utils.hideLoading(context);
_formKey.currentState!.save(); if (isSuccess) {
Utils.showLoading(context); Navigator.of(context).pop();
bool isSuccess = await widget.onRejectPressed(selectedReason!.id!, _commentController.text); widget.onRefreshed?.call();
Utils.hideLoading(context);
if (isSuccess) {
Navigator.of(context).pop();
widget.onRefreshed?.call();
}
} }
}, }
), },
16.height, ),
], 16.height,
), ],
), ),
); );
} }

@ -91,7 +91,7 @@ class _RequestApprovalBottomState extends State<RequestApprovalBottomSheet> {
color: AppColor.background(context), color: AppColor.background(context),
borderRadius: const BorderRadius.only(topRight: Radius.circular(20), topLeft: Radius.circular(20)), borderRadius: const BorderRadius.only(topRight: Radius.circular(20), topLeft: Radius.circular(20)),
), ),
padding: EdgeInsets.only(right: 16.toScreenWidth, left: 16.toScreenWidth, top: 24.toScreenHeight, bottom: MediaQuery.of(context).viewInsets.bottom + MediaQuery.of(context).padding.bottom), padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 24.toScreenHeight),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

Loading…
Cancel
Save