Merge branch 'refs/heads/design_3.0_TM_Module_snagsFix' into design_3.0_data_segregation

design_3.0_data_segregation
Sikander Saleem 4 months ago
commit d48fdfaaa5

@ -1,7 +1,7 @@
class URLs { class URLs {
URLs._(); URLs._();
static const String appReleaseBuildNumber = "26"; static const String appReleaseBuildNumber = "28";
// static const host1 = "https://atomsm.hmg.com"; // production url // static const host1 = "https://atomsm.hmg.com"; // production url
// static const host1 = "https://atomsmdev.hmg.com"; // local DEV url // static const host1 = "https://atomsmdev.hmg.com"; // local DEV url

@ -51,11 +51,11 @@ class AppBarWidget extends StatelessWidget {
children: [ children: [
Text( Text(
snapshot.user?.username ?? "", // Simplified null check snapshot.user?.username ?? "", // Simplified null check
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50, fontWeight: FontWeight.w600), style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50, fontWeight: FontWeight.w600, fontSize: context.isTablet() ? 14 : null),
), ),
Text( Text(
snapshot.user?.type?.name.toCamelCase ?? "", // Simplified null check snapshot.user?.type?.name.toCamelCase ?? "", // Simplified null check
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral20), style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral20, fontSize: context.isTablet() ? 12 : null),
), ),
], ],
), ),

@ -73,7 +73,7 @@ class RequestCategoryFragment extends StatelessWidget {
Widget getTabs({required BuildContext context, required DashBoardProvider requestsProvider, required UsersTypes? userType}) { Widget getTabs({required BuildContext context, required DashBoardProvider requestsProvider, required UsersTypes? userType}) {
List<CategoryTabs> tabs = CategoryTabs.getTabs(userType: userType ?? UsersTypes.normal_user, context: context); List<CategoryTabs> tabs = CategoryTabs.getTabs(userType: userType ?? UsersTypes.normal_user, context: context);
return SizedBox( return SizedBox(
height: 44 + 16, height: 44 + (context.isTablet() ? 36 : 16),
child: ListView.separated( child: ListView.separated(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
separatorBuilder: (cxt, index) => 12.width, separatorBuilder: (cxt, index) => 12.width,

@ -19,7 +19,14 @@ extension BuildContextExtension on BuildContext {
SettingProvider get settingProvider => Provider.of<SettingProvider>(this, listen: false); SettingProvider get settingProvider => Provider.of<SettingProvider>(this, listen: false);
UserProvider get userProvider => Provider.of<UserProvider>(this, listen: false); UserProvider get userProvider => Provider.of<UserProvider>(this, listen: false);
bool isTablet() {
final mediaQueryData = MediaQuery.of(this);
final double screenWidth = mediaQueryData.size.width;
final double screenHeight = mediaQueryData.size.height;
final double devicePixelRatio = mediaQueryData.devicePixelRatio;
bool isTablet = (devicePixelRatio < 2 && (screenWidth >= 700 || screenHeight >= 700)) || (devicePixelRatio >= 2 && (screenWidth >= 1000 || screenHeight >= 1000));
return isTablet;
}
void showConfirmDialog(String message, {String? title, VoidCallback? onTap}) => showDialog( void showConfirmDialog(String message, {String? title, VoidCallback? onTap}) => showDialog(
context: this, context: this,
builder: (BuildContext cxt) => ConfirmDialog(message: message, onTap: onTap, title: title), builder: (BuildContext cxt) => ConfirmDialog(message: message, onTap: onTap, title: title),

@ -146,20 +146,20 @@ class _ServiceRequestDetailViewState extends State<ServiceRequestDetailView> {
if (Provider.of<SettingProvider>(context, listen: false).showPriority) ...[ if (Provider.of<SettingProvider>(context, listen: false).showPriority) ...[
StatusLabel( StatusLabel(
label: workOrder.priority?.name, label: workOrder.priority?.name,
id: workOrder.priority!.id!, id: workOrder.priority!.value!,
radius: 4, radius: 4,
textColor: AppColor.getPriorityStatusTextColor(context, workOrder.priority!.id!), textColor: AppColor.getPriorityStatusTextColor(context, workOrder.priority!.value!),
backgroundColor: AppColor.getPriorityStatusColor(context, workOrder.priority!.id!), backgroundColor: AppColor.getPriorityStatusColor(context, workOrder.priority!.value!),
), ),
8.width, 8.width,
], ],
if (workOrder.itgFormWorkOrderStatus != null) ...[ if (workOrder.itgFormWorkOrderStatus != null) ...[
StatusLabel( StatusLabel(
label: workOrder.itgFormWorkOrderStatus, label: workOrder.itgFormWorkOrderStatus,
id: 0, // id: 0,
radius: 4, radius: 4,
textColor: AppColor.getPriorityStatusTextColor(context, 82), textColor: AppColor.getPriorityStatusTextColor(context, 82),
backgroundColor: AppColor.getPriorityStatusColor(context, 0), backgroundColor: AppColor.getPriorityStatusColor(context, 1000),
), ),
8.width, 8.width,
], ],

@ -120,16 +120,16 @@ class _PpmDetailsPageState extends State<PpmDetailsPage> {
context: context, context: context,
) )
] else ...[ ] else ...[
FooterActionButton.footerContainer( // FooterActionButton.footerContainer(
context: context, // context: context,
child: AppFilledButton( // child: AppFilledButton(
onPressed: () async { // onPressed: () async {
await Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdatePpm(ppm: null, planPreventiveVisit: planPreventiveVisit))); // await Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdatePpm(ppm: null, planPreventiveVisit: planPreventiveVisit)));
getVisitData(); // getVisitData();
}, // },
label: context.translation.viewDetails, // label: context.translation.viewDetails,
), // ),
) // )
] ]
]) ])
: const Center(child: NoDataFound()); : const Center(child: NoDataFound());

@ -58,7 +58,7 @@ class _PpmExternalDetailsFormState extends State<PpmExternalDetailsForm> {
final ppmProvider = Provider.of<PpmProvider>(context, listen: false); final ppmProvider = Provider.of<PpmProvider>(context, listen: false);
return ListView.builder( return ListView.builder(
itemCount: widget.models!.length + 1, itemCount: widget.models!.length + 1,
padding: const EdgeInsets.all(16), padding: const EdgeInsets.only(left: 16, right: 16, top: 8, bottom: 16),
itemBuilder: (context, index) { itemBuilder: (context, index) {
if (index == widget.models!.length) { if (index == widget.models!.length) {
return Visibility( return Visibility(
@ -190,7 +190,7 @@ class _ExternalDetailItemState extends State<ExternalDetailItem> {
), ),
child: Icon(Icons.add, color: context.isDark ? null : AppColor.neutral60), child: Icon(Icons.add, color: context.isDark ? null : AppColor.neutral60),
).onPress(() async { ).onPress(() async {
if(widget.model.supplier==null) { if (widget.model.supplier == null) {
"Please select supplier".showToast; "Please select supplier".showToast;
return; return;
} }

@ -108,7 +108,7 @@ class _UpdatePpmState extends State<UpdatePpm> with TickerProviderStateMixin {
if (typeOfService == null) { if (typeOfService == null) {
return; return;
} }
if (typeOfService?.id == 66) { if (typeOfService?.value == 2) {
ppmProvider.totalTabs = 4; ppmProvider.totalTabs = 4;
} else { } else {
ppmProvider.totalTabs = 3; ppmProvider.totalTabs = 3;

@ -299,7 +299,7 @@ class _WoInfoFormState extends State<WoInfoForm> {
onSelect: (value) { onSelect: (value) {
if (value != null) { if (value != null) {
widget.planPreventiveVisit.typeOfService = value; widget.planPreventiveVisit.typeOfService = value;
if (widget.planPreventiveVisit.typeOfService?.id == 66) { if (widget.planPreventiveVisit.typeOfService?.value == 2) {
ppmProvider.totalTabs = 4; ppmProvider.totalTabs = 4;
} else { } else {
ppmProvider.totalTabs = 3; ppmProvider.totalTabs = 3;

@ -264,6 +264,11 @@ class AppColor {
return green15; return green15;
case 370: case 370:
return green15; return green15;
case 0:
return green15;
case 1:
//high priority
return white10;
case 82: case 82:
//high priority //high priority
return white10; return white10;
@ -279,9 +284,13 @@ class AppColor {
return greenStatus(context); return greenStatus(context);
case 370: case 370:
return greenStatus(context); return greenStatus(context);
case 0:
return greenStatus(context);
//high priority //high priority
case 82: case 82:
return redStatus(context); return redStatus(context);
case 1:
return redStatus(context);
default: default:
return blueStatus(context); return blueStatus(context);
} }

@ -25,6 +25,7 @@ class AppTextFormField extends StatefulWidget {
final TextStyle? style; final TextStyle? style;
final TextStyle? labelStyle; final TextStyle? labelStyle;
final TextStyle? hintStyle; final TextStyle? hintStyle;
final TextStyle? floatingLabelStyle;
final bool enable; final bool enable;
final TextAlign? textAlign; final TextAlign? textAlign;
final FocusNode? node; final FocusNode? node;
@ -58,6 +59,7 @@ class AppTextFormField extends StatefulWidget {
this.hintText, this.hintText,
this.labelText, this.labelText,
this.hintStyle, this.hintStyle,
this.floatingLabelStyle,
this.textInputType = TextInputType.text, this.textInputType = TextInputType.text,
this.initialValue, // Provide default value this.initialValue, // Provide default value
this.enable = true, this.enable = true,
@ -183,12 +185,16 @@ class _AppTextFormFieldState extends State<AppTextFormField> {
onChanged: widget.onChange, onChanged: widget.onChange,
obscureText: widget.obscureText ?? false, obscureText: widget.obscureText ?? false,
keyboardType: widget.textInputType, keyboardType: widget.textInputType,
maxLines: widget.makeMultiLinesNull ? null:widget.textInputType == TextInputType.multiline ? 4 : 1, maxLines: widget.makeMultiLinesNull
? null
: widget.textInputType == TextInputType.multiline
? 4
: 1,
obscuringCharacter: "*", obscuringCharacter: "*",
controller: widget.controller, controller: widget.controller,
textInputAction: widget.textInputType == TextInputType.multiline ? null : widget.textInputAction ?? TextInputAction.next, textInputAction: widget.textInputType == TextInputType.multiline ? null : widget.textInputAction ?? TextInputAction.next,
onEditingComplete: widget.onAction ?? () => FocusScope.of(context).nextFocus(), onEditingComplete: widget.onAction ?? () => FocusScope.of(context).nextFocus(),
style: widget.style ?? AppTextStyle.body1.copyWith(fontWeight: FontWeight.w500,color:context.isDark?AppColor.white10: AppColor.black10), style: widget.style ?? AppTextStyle.body1.copyWith(fontWeight: FontWeight.w500, color: context.isDark ? AppColor.white10 : AppColor.black10),
onTap: widget.onTap, onTap: widget.onTap,
decoration: InputDecoration( decoration: InputDecoration(
alignLabelWithHint: widget.alignLabelWithHint, alignLabelWithHint: widget.alignLabelWithHint,
@ -208,9 +214,12 @@ class _AppTextFormFieldState extends State<AppTextFormField> {
? (widget.enableColor ?? AppColor.neutral40) ? (widget.enableColor ?? AppColor.neutral40)
: AppColor.background(context)), : AppColor.background(context)),
errorStyle: AppTextStyle.tiny.copyWith(color: context.isDark ? AppColor.red50 : AppColor.red60), errorStyle: AppTextStyle.tiny.copyWith(color: context.isDark ? AppColor.red50 : AppColor.red60),
floatingLabelStyle: AppTextStyle.body1.copyWith(fontWeight: FontWeight.w500, color: context.isDark ? AppColor.white10 : AppColor.neutral20), floatingLabelStyle: widget.floatingLabelStyle ?? AppTextStyle.body1.copyWith(fontWeight: FontWeight.w500, color: context.isDark ? AppColor.white10 : AppColor.neutral20),
hintText: widget.hintText ?? "", hintText: widget.hintText ?? "",
labelText: (widget.showSpeechToText && _speechToText.isListening) ? "Listening..." : widget.labelText ?? "", // labelText: (widget.showSpeechToText && _speechToText.isListening) ? "Listening..." : widget.labelText ?? "",
label: Text(
(widget.showSpeechToText && _speechToText.isListening) ? "Listening..." : widget.labelText ?? "",
),
labelStyle: widget.labelStyle, labelStyle: widget.labelStyle,
hintStyle: widget.labelStyle, hintStyle: widget.labelStyle,
prefixIcon: widget.prefixIcon ?? prefixIcon: widget.prefixIcon ??

@ -72,7 +72,7 @@ class CreateRequestTypeBottomSheet extends StatelessWidget {
size: 32, size: 32,
), ),
//24.height, //24.height,
label.bodyText2(context).custom(color: context.isDark ? Colors.white : AppColor.black20), label.bodyText2(context).custom(color: context.isDark ? Colors.white : AppColor.black20, fontSize: context.isTablet() ? 10.toScreenWidth : null),
], ],
), ),
), ),

@ -110,8 +110,9 @@ class _LoginPageState extends State<LoginPage> {
backgroundColor: AppColor.fieldBgColor(context), backgroundColor: AppColor.fieldBgColor(context),
validator: (value) => Validator.hasValue(value!) ? null : context.translation.requiredField, validator: (value) => Validator.hasValue(value!) ? null : context.translation.requiredField,
labelText: context.translation.username, labelText: context.translation.username,
style: TextStyle(fontWeight: FontWeight.w500, fontSize: 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)), style: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)),
labelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 11, color: context.isDark ? Colors.white : const Color(0xff767676)), floatingLabelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)),
labelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff767676)),
textInputType: TextInputType.text, textInputType: TextInputType.text,
showWithoutDecoration: true, showWithoutDecoration: true,
contentPadding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 12.toScreenHeight), contentPadding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 12.toScreenHeight),
@ -125,8 +126,9 @@ class _LoginPageState extends State<LoginPage> {
showWithoutDecoration: true, showWithoutDecoration: true,
labelText: context.translation.password, labelText: context.translation.password,
backgroundColor: AppColor.fieldBgColor(context), backgroundColor: AppColor.fieldBgColor(context),
style: TextStyle(fontWeight: FontWeight.w500, fontSize: 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)), style: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)),
labelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 11, color: context.isDark ? Colors.white : const Color(0xff767676)), labelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff767676)),
floatingLabelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)),
contentPadding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 12.toScreenHeight), contentPadding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 12.toScreenHeight),
obscureText: !_passwordVisible, obscureText: !_passwordVisible,
suffixIcon: Icon( suffixIcon: Icon(

@ -11,23 +11,23 @@ class StatusLabel extends StatelessWidget {
final double radius; final double radius;
final bool labelInCenter; final bool labelInCenter;
StatusLabel({Key? key, this.id = 0, this.label, this.backgroundColor, this.textColor, this.isPriority = false, this.radius = 4,this.labelInCenter=false}) : super(key: key); StatusLabel({Key? key, this.id = 0, this.label, this.backgroundColor, this.textColor, this.isPriority = false, this.radius = 4, this.labelInCenter = false}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (id == 82) label = context.translation.highPriority;
if (id == 81) label = context.translation.lowPriority;
if (label?.toLowerCase() == 'In progress'.toLowerCase()) label = context.translation.inProgress; if (label?.toLowerCase() == 'In progress'.toLowerCase()) label = context.translation.inProgress;
if (label?.toLowerCase() == 'Completed'.toLowerCase()) label = context.translation.completed; if (label?.toLowerCase() == 'Completed'.toLowerCase()) label = context.translation.completed;
if (label?.toLowerCase() == 'Open'.toLowerCase()) label = context.translation.open; if (label?.toLowerCase() == 'Open'.toLowerCase()) label = context.translation.open;
if (label?.toLowerCase() == 'Closed'.toLowerCase()) label = context.translation.closed; if (label?.toLowerCase() == 'Closed'.toLowerCase()) label = context.translation.closed;
if (label?.toLowerCase() == 'Low'.toLowerCase()) label = context.translation.lowPriority; if (label?.toLowerCase() == 'Low'.toLowerCase()) label = context.translation.lowPriority;
if (label?.toLowerCase() == 'No'.toLowerCase()) label = context.translation.lowPriority;
if (label?.toLowerCase() == 'High'.toLowerCase()) label = context.translation.highPriority; if (label?.toLowerCase() == 'High'.toLowerCase()) label = context.translation.highPriority;
if (label?.toLowerCase() == 'Yes'.toLowerCase()) label = context.translation.highPriority;
if (label?.toLowerCase() == 'Waiting for quotation'.toLowerCase()) label = context.translation.waitingForQuotation; if (label?.toLowerCase() == 'Waiting for quotation'.toLowerCase()) label = context.translation.waitingForQuotation;
return Container( return Container(
padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 10), padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 10),
alignment: labelInCenter ? Alignment.center: null, alignment: labelInCenter ? Alignment.center : null,
decoration: ShapeDecoration( decoration: ShapeDecoration(
color: backgroundColor, color: backgroundColor,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(

@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.3.10+29 version: 1.3.11+30
environment: environment:
sdk: ">=3.5.0 <4.0.0" sdk: ">=3.5.0 <4.0.0"

Loading…
Cancel
Save