Merge branch 'development_sikander' into 'master'

Development sikander

See merge request Cloud_Solution/mohemm-flutter-app!120
merge-requests/119/merge
Sikander Saleem 2 years ago
commit f01cf2ac2e

@ -90,9 +90,9 @@ extension EmailValidator on String {
style: TextStyle(fontSize: 13, fontWeight: FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.52, decoration: isUnderLine ? TextDecoration.underline : null),
);
Widget toText14({Color? color, bool isUnderLine = false, bool isBold = false, FontWeight? weight, int? maxlines, bool isCenter = false}) => Text(
Widget toText14({Color? color, bool isUnderLine = false, bool isBold = false, FontWeight? weight, int? maxlines, TextAlign? textAlign, bool isCenter = false}) => Text(
this,
textAlign: isCenter ? TextAlign.center : TextAlign.left,
textAlign: isCenter ? TextAlign.center : (textAlign ?? TextAlign.left),
maxLines: maxlines,
style: TextStyle(
color: color ?? MyColors.darkTextColor,

@ -8,16 +8,16 @@ class UpdateUserTypesList {
UpdateUserTypesList.fromJson(Map<String, dynamic> json) {
itemID = json['ItemID'];
pFYAENABLEDFALG = json['P_FYAENABLED_FALG'];
pFYIENABLEDFALG = json['P_FYIENABLED_FALG'];
pFYAENABLEDFALG = json['P_FYA_ENABLED_FALG'];
pFYIENABLEDFALG = json['P_FYI_ENABLED_FLAG'];
pITEMTYPE = json['P_ITEM_TYPE'];
}
Map<String, dynamic> toJson() {
Map<String, dynamic> data = new Map<String, dynamic>();
data['ItemID'] = this.itemID;
data['P_FYAENABLED_FALG'] = this.pFYAENABLEDFALG;
data['P_FYIENABLED_FALG'] = this.pFYIENABLEDFALG;
data['P_FYA_ENABLED_FALG'] = this.pFYAENABLEDFALG;
data['P_FYI_ENABLED_FLAG'] = this.pFYIENABLEDFALG;
data['P_ITEM_TYPE'] = this.pITEMTYPE;
return data;
}

@ -820,8 +820,8 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
sFileType = "";
deleteData();
favUsersList.clear();
if (searchedChats != null) searchedChats!.clear();
if (pChatHistory != null) pChatHistory!.clear();
searchedChats?.clear();
pChatHistory?.clear();
chatHubConnection.stop();
AppState().chatDetails = null;
}

@ -85,8 +85,8 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
@override
Widget build(BuildContext context) {
Map<String, double> dataMap = {
"Present": getTimeCardSummaryList?.aTTENDEDDAYS?.toDouble() ?? 75,
"Absent": getTimeCardSummaryList?.aBSENTDAYS?.toDouble() ?? 25,
"Present": getTimeCardSummaryList?.aTTENDEDDAYS?.toDouble() ?? 0,
"Absent": getTimeCardSummaryList?.aBSENTDAYS?.toDouble() ?? 0,
};
return Scaffold(
backgroundColor: Colors.white,
@ -112,7 +112,8 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
],
).onPress(() async {
showMonthPicker(
context: context, //locale: EasyLocalization.of(context)?.locale,
context: context,
//locale: EasyLocalization.of(context)?.locale,
initialDate: formattedDate,
firstDate: DateTime(searchYear - 2),
lastDate: DateTime.now(),
@ -419,211 +420,211 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
}
if (details.date!.month == formattedDate.month && details.date!.year == formattedDate.year) {
int val = details.date!.day;
getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'Y' ?
showModalBottomSheet(
context: context,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)),
isScrollControlled: true,
backgroundColor: MyColors.backgroundBlackColor,
builder: (_) {
return DraggableScrollableSheet(
maxChildSize: 0.9,
expand: false,
builder: (_, controller) {
dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE;
DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss").parse(dmyString);
return Column(
children: [
Container(
width: 49,
height: 7,
margin: const EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: MyColors.darkGreyColor,
),
),
Expanded(
child: ListView.builder(
controller: controller,
itemCount: 1,
itemBuilder: (_, i) =>
Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.vertical(
top: Radius.circular(25.0),
getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'Y'
? showModalBottomSheet(
context: context,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)),
isScrollControlled: true,
backgroundColor: MyColors.backgroundBlackColor,
builder: (_) {
return DraggableScrollableSheet(
maxChildSize: 0.9,
expand: false,
builder: (_, controller) {
dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE;
DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss").parse(dmyString);
return Column(
children: [
Container(
width: 49,
height: 7,
margin: const EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: MyColors.darkGreyColor,
),
),
Expanded(
child: ListView.builder(
controller: controller,
itemCount: 1,
itemBuilder: (_, i) => Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.vertical(
top: Radius.circular(25.0),
),
color: MyColors.backgroundBlackColor,
),
color: MyColors.backgroundBlackColor,
),
child: Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"${DateFormat("MMMM-dd-yyyy").format(dateTime1).replaceAll('-', " ")}".toText24(isBold: true, color: Colors.white),
LocaleKeys.attendanceDetails.tr().toText16(color: MyColors.greyACColor),
12.height,
CircularStepProgressBar(
totalSteps: 16 * 4,
currentStep: percentage,
width: 224,
height: 236,
selectedColor: MyColors.gradiantEndColor,
unselectedColor: MyColors.grey70Color,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
"${getScheduleShiftsDetailsList!.pERCENTAGE}".toText44(color: Colors.white, isBold: true),
LocaleKeys.completed.tr().toText11(color: MyColors.greyACColor),
28.height,
LocaleKeys.shiftTime.tr().toText11(color: MyColors.greyACColor),
"${getScheduleShiftsDetailsList!.sHTNAME}".toText22(color: Colors.white, isBold: true),
],
child: Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"${DateFormat("MMMM-dd-yyyy").format(dateTime1).replaceAll('-', " ")}".toText24(isBold: true, color: Colors.white),
LocaleKeys.attendanceDetails.tr().toText16(color: MyColors.greyACColor),
12.height,
CircularStepProgressBar(
totalSteps: 16 * 4,
currentStep: percentage,
width: 224,
height: 236,
selectedColor: MyColors.gradiantEndColor,
unselectedColor: MyColors.grey70Color,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
"${getScheduleShiftsDetailsList!.pERCENTAGE}".toText44(color: Colors.white, isBold: true),
LocaleKeys.completed.tr().toText11(color: MyColors.greyACColor),
28.height,
LocaleKeys.shiftTime.tr().toText11(color: MyColors.greyACColor),
"${getScheduleShiftsDetailsList!.sHTNAME}".toText22(color: Colors.white, isBold: true),
],
).center,
).center,
).center,
],
).paddingOnly(left: 21, right: 21, top: 27, bottom: 37),
Stack(
children: [
Container(
width: double.infinity,
decoration: const BoxDecoration(borderRadius: BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)), color: Colors.white),
padding: const EdgeInsets.only(left: 31, right: 31, top: 30, bottom: 29),
child: Column(
children: [
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.actualCheckIn.tr().toText11(
color: MyColors.grey67Color,
),
"${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}" != ""
? "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}".toText22(color: Colors.black, isBold: true)
: "__".toText22(color: Colors.black, isBold: true),
],
).expanded,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.actualCheckOut.tr().toText11(
color: MyColors.grey67Color,
),
"${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}" != ""
? "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}".toText22(color: Colors.black, isBold: true)
: "__".toText22(color: Colors.black, isBold: true),
],
).expanded,
],
),
25.height,
const Divider(
height: 1,
thickness: 1,
color: MyColors.lightGreyEFColor,
),
25.height,
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.approvedCheckIn.tr().toText11(
color: MyColors.grey67Color,
),
"${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}" != ""
? "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}".toText22(color: MyColors.greenColor, isBold: true)
: "__".toText22(color: MyColors.greenColor, isBold: true),
],
).expanded,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.approvedCheckOut.tr().toText11(
color: MyColors.grey67Color,
),
"${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}" != ""
? "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}".toText22(color: MyColors.greenColor, isBold: true)
: "__".toText22(color: MyColors.greenColor, isBold: true),
],
).expanded,
],
),
25.height,
const Divider(
height: 1,
thickness: 1,
color: MyColors.lightGreyEFColor,
),
25.height,
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.lateIn.tr().toText11(
color: MyColors.grey67Color,
),
"${getDayHoursTypeDetailsList[index].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true),
],
).expanded,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.excess.tr().toText11(
color: MyColors.grey67Color,
),
"${getDayHoursTypeDetailsList[index].eXCESSHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true),
],
).expanded,
],
),
25.height,
const Divider(
height: 1,
thickness: 1,
color: MyColors.lightGreyEFColor,
),
25.height,
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.shortage.tr().toText11(
color: MyColors.grey67Color,
),
"${getDayHoursTypeDetailsList[index].sHORTAGEHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true),
],
).expanded,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.earlyOut.tr().toText11(
color: MyColors.grey67Color,
),
"${getDayHoursTypeDetailsList[index].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true),
],
).expanded,
],
),
],
],
).paddingOnly(left: 21, right: 21, top: 27, bottom: 37),
Stack(
children: [
Container(
width: double.infinity,
decoration: const BoxDecoration(borderRadius: BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)), color: Colors.white),
padding: const EdgeInsets.only(left: 31, right: 31, top: 30, bottom: 29),
child: Column(
children: [
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.actualCheckIn.tr().toText11(
color: MyColors.grey67Color,
),
"${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}" != ""
? "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}".toText22(color: Colors.black, isBold: true)
: "__".toText22(color: Colors.black, isBold: true),
],
).expanded,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.actualCheckOut.tr().toText11(
color: MyColors.grey67Color,
),
"${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}" != ""
? "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}".toText22(color: Colors.black, isBold: true)
: "__".toText22(color: Colors.black, isBold: true),
],
).expanded,
],
),
25.height,
const Divider(
height: 1,
thickness: 1,
color: MyColors.lightGreyEFColor,
),
25.height,
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.approvedCheckIn.tr().toText11(
color: MyColors.grey67Color,
),
"${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}" != ""
? "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}".toText22(color: MyColors.greenColor, isBold: true)
: "__".toText22(color: MyColors.greenColor, isBold: true),
],
).expanded,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.approvedCheckOut.tr().toText11(
color: MyColors.grey67Color,
),
"${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}" != ""
? "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}".toText22(color: MyColors.greenColor, isBold: true)
: "__".toText22(color: MyColors.greenColor, isBold: true),
],
).expanded,
],
),
25.height,
const Divider(
height: 1,
thickness: 1,
color: MyColors.lightGreyEFColor,
),
25.height,
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.lateIn.tr().toText11(
color: MyColors.grey67Color,
),
"${getDayHoursTypeDetailsList[index].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true),
],
).expanded,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.excess.tr().toText11(
color: MyColors.grey67Color,
),
"${getDayHoursTypeDetailsList[index].eXCESSHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true),
],
).expanded,
],
),
25.height,
const Divider(
height: 1,
thickness: 1,
color: MyColors.lightGreyEFColor,
),
25.height,
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.shortage.tr().toText11(
color: MyColors.grey67Color,
),
"${getDayHoursTypeDetailsList[index].sHORTAGEHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true),
],
).expanded,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.earlyOut.tr().toText11(
color: MyColors.grey67Color,
),
"${getDayHoursTypeDetailsList[index].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true),
],
).expanded,
],
),
],
),
),
),
],
),
],
],
),
],
),
),
),
),
),
],
);
},
);
},
):null;
),
],
);
},
);
},
)
: null;
}
}

@ -48,6 +48,9 @@ class _SuccessDialogState extends State<SuccessDialog> with TickerProviderStateM
width: size,
height: size,
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25.0),
),
child: Lottie.asset(
'assets/lottie/lt_success.json',
repeat: false,

@ -1,7 +1,7 @@
import 'dart:async';
import 'dart:io';
import 'dart:ui' as ui;
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
@ -323,12 +323,104 @@ class _DashboardScreenState extends State<DashboardScreen> {
],
),
],
).paddingOnly(left: 21, right: 21, top: 7),
context.watch<MarathonProvider>().isLoading
? const MarathonBannerShimmer().paddingAll(20)
: MarathonBanner(isMarathonUpcoming: context.watch<MarathonProvider>().isUpComingMarathon).paddingAll(20),
ServicesWidget(),
8.height,
).paddingOnly(left: 21, right: 21, top: 7, bottom: 21),
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
LocaleKeys.offers.tr().toText12(),
Row(
children: [
LocaleKeys.discounts.tr().toText24(isBold: true),
6.width,
Container(
padding: const EdgeInsets.only(left: 8, right: 8),
decoration: BoxDecoration(
color: MyColors.yellowColor,
borderRadius: BorderRadius.circular(10),
),
child: LocaleKeys.newString.tr().toText10(isBold: true)),
],
),
],
),
),
LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() {
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
})
],
).paddingOnly(left: 21, right: 21),
Consumer<DashboardProviderModel>(
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
return SizedBox(
height: 103 + 33,
child: ListView.separated(
shrinkWrap: true,
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.only(left: 21, right: 21, top: 13),
scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext cxt, int index) {
return model.isOffersLoading
? const OffersShimmerWidget()
: InkWell(
onTap: () {
navigateToDetails(data.getOffersList[index]);
},
child: SizedBox(
width: 73,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 73,
height: 73,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.all(
Radius.circular(100),
),
border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
),
child: ClipRRect(
borderRadius: const BorderRadius.all(
Radius.circular(50),
),
child: Hero(
tag: "ItemImage" + data.getOffersList[index].rowID!,
transitionOnUserGestures: true,
child: Image.network(
data.getOffersList[index].bannerImage!,
fit: BoxFit.contain,
),
),
),
),
4.height,
Expanded(
child: AppState().isArabic(context)
? data.getOffersList[index].titleAR!.toText12(isCenter: true, maxLine: 1)
: data.getOffersList[index].title!.toText12(isCenter: true, maxLine: 1),
),
],
),
),
);
},
separatorBuilder: (BuildContext cxt, int index) => 8.width,
itemCount: 6),
);
},
),
],
),
Container(
width: double.infinity,
padding: const EdgeInsets.only(top: 31),
@ -339,101 +431,14 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
LocaleKeys.offers.tr().toText12(),
Row(
children: [
LocaleKeys.discounts.tr().toText24(isBold: true),
6.width,
Container(
padding: const EdgeInsets.only(left: 8, right: 8),
decoration: BoxDecoration(
color: MyColors.yellowColor,
borderRadius: BorderRadius.circular(10),
),
child: LocaleKeys.newString.tr().toText10(isBold: true)),
],
),
],
),
),
LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() {
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
})
],
).paddingOnly(left: 21, right: 21),
Consumer<DashboardProviderModel>(
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
return SizedBox(
height: 103 + 33,
child: ListView.separated(
shrinkWrap: true,
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.only(left: 21, right: 21, top: 13),
scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext cxt, int index) {
return model.isOffersLoading
? const OffersShimmerWidget()
: InkWell(
onTap: () {
navigateToDetails(data.getOffersList[index]);
},
child: SizedBox(
width: 73,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 73,
height: 73,
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(
Radius.circular(100),
),
border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
),
child: ClipRRect(
borderRadius: const BorderRadius.all(
Radius.circular(50),
),
child: Hero(
tag: "ItemImage" + data.getOffersList[index].rowID!,
transitionOnUserGestures: true,
child: Image.network(
data.getOffersList[index].bannerImage!,
fit: BoxFit.contain,
),
),
),
),
4.height,
Expanded(
child: AppState().isArabic(context)
? data.getOffersList[index].titleAR!.toText12(isCenter: true, maxLine: 1)
: data.getOffersList[index].title!.toText12(isCenter: true, maxLine: 1),
),
],
),
),
);
},
separatorBuilder: (BuildContext cxt, int index) => 8.width,
itemCount: 6),
);
},
),
ServicesWidget(),
context.watch<MarathonProvider>().isLoading
? const MarathonBannerShimmer().paddingAll(20)
: MarathonBanner(isMarathonUpcoming: context.watch<MarathonProvider>().isUpComingMarathon).paddingOnly(left: 21, right: 21, bottom: 21, top: 8),
],
),
)
),
],
),
),

@ -150,13 +150,9 @@ class _AppDrawerState extends State<AppDrawer> {
Widget menuItem(String icon, String title, String routeName, {Color? color, bool closeDrawer = true, VoidCallback? onPress}) {
return Row(
children: [
SvgPicture.asset(
icon,
height: 20,
width: 20,
),
SvgPicture.asset(icon, height: 20, width: 20),
9.width,
title.toText14(color: color).expanded
title.toText14(color: color, textAlign: AppState().isArabic(context) ? TextAlign.right : null).expanded,
],
).paddingOnly(left: 21, top: 10, bottom: 10, right: 21).onPress(closeDrawer
? () async {

@ -1,60 +0,0 @@
import 'dart:ui';
import 'package:flutter/material.dart';
class DrawerItem extends StatefulWidget {
final String title;
final String subTitle;
final IconData icon;
final Color color;
final dynamic assetLink;
const DrawerItem(this.title, {required this.icon, required this.color, this.subTitle = '', this.assetLink});
@override
_DrawerItemState createState() => _DrawerItemState();
}
class _DrawerItemState extends State<DrawerItem> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(top: 0, bottom: 5, left: 0, right: 0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
if (widget.assetLink != null)
Container(
height: 20,
width: 20,
child: Image.asset(widget.assetLink),
),
if (widget.assetLink == null)
Icon(
widget.icon,
color: widget.color,
size: 25,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.45,
child: Text(widget.title,
style: TextStyle(
color: widget.color ?? Color(0xFF2E303A),
fontSize: 14,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
letterSpacing: -0.84,
)),
),
],
),
),
],
));
}
}

@ -100,16 +100,16 @@ class _ChangePasswordScreenState extends State<ChangePasswordScreen> {
passwordConstraintsUI(LocaleKeys.doNotUseRecentPassword.tr(), true),
8.height,
passwordConstraintsUI(LocaleKeys.atLeastOneLowercase.tr(), checkRegEx(r'[a-z]')),
8.height,
passwordConstraintsUI(LocaleKeys.atLeastOneUppercase.tr(), checkRegEx(r'[A-Z]')),
// 8.height,
// passwordConstraintsUI(LocaleKeys.atLeastOneUppercase.tr(), checkRegEx(r'[A-Z]')),
8.height,
passwordConstraintsUI(LocaleKeys.atLeastOneNumeric.tr(), checkRegEx(r'[0-9]')),
8.height,
passwordConstraintsUI(LocaleKeys.minimum8Characters.tr(), password.text.length >= 8),
8.height,
passwordConstraintsUI(LocaleKeys.doNotAddRepeatingLetters.tr(), checkRepeatedChars(password.text)),
8.height,
passwordConstraintsUI(LocaleKeys.itShouldContainSpecialCharacter.tr(), checkRegEx(r'[!@#$%^&*(),.?":{}|<>]')),
// 8.height,
// passwordConstraintsUI(LocaleKeys.itShouldContainSpecialCharacter.tr(), checkRegEx(r'[!@#$%^&*(),.?":{}|<>]')),
8.height,
passwordConstraintsUI(LocaleKeys.confirmPasswordMustMatch.tr(), password.text.isNotEmpty && password.text == confirmPassword.text),
],
@ -131,14 +131,14 @@ class _ChangePasswordScreenState extends State<ChangePasswordScreen> {
return false;
}
bool hasUppercase = password.contains(RegExp(r'[A-Z]'));
// bool hasUppercase = password.contains(RegExp(r'[A-Z]'));
bool hasDigits = password.contains(RegExp(r'[0-9]'));
bool hasLowercase = password.contains(RegExp(r'[a-z]'));
bool hasSpecialCharacters = password.contains(RegExp(r'[!@#$%^&*(),.?":{}|<>]'));
// bool hasSpecialCharacters = password.contains(RegExp(r'[!@#$%^&*(),.?":{}|<>]'));
bool hasMinLength = password.length >= minLength;
bool isMatched = password == confirmPassword.text;
return hasDigits && hasUppercase && hasLowercase && hasSpecialCharacters && hasMinLength && isMatched && checkRepeatedChars(password);
return hasDigits && hasLowercase && hasMinLength && isMatched && checkRepeatedChars(password);
}
bool checkRepeatedChars(String password) {

@ -95,6 +95,8 @@ class _LoginScreenState extends State<LoginScreen> {
firebaseToken = await _firebaseMessaging.getToken();
loginInfo = await LoginApiClient().getMobileLoginInfoNEW(firebaseToken ?? "", Platform.isAndroid ? "android" : "ios");
if (loginInfo == null) {
await checkPrefs();
_autoLogin = false;
Utils.hideLoading(context);
return;
} else {

@ -94,8 +94,8 @@ class _NewPasswordScreenState extends State<NewPasswordScreen> {
passwordConstraintsUI(LocaleKeys.doNotUseRecentPassword.tr(), true),
8.height,
passwordConstraintsUI(LocaleKeys.atLeastOneLowercase.tr(), checkRegEx(r'[a-z]')),
8.height,
passwordConstraintsUI(LocaleKeys.atLeastOneUppercase.tr(), checkRegEx(r'[A-Z]')),
// 8.height,
// passwordConstraintsUI(LocaleKeys.atLeastOneUppercase.tr(), checkRegEx(r'[A-Z]')),
8.height,
passwordConstraintsUI(LocaleKeys.atLeastOneNumeric.tr(), checkRegEx(r'[0-9]')),
8.height,
@ -143,14 +143,14 @@ class _NewPasswordScreenState extends State<NewPasswordScreen> {
return false;
}
bool hasUppercase = password.contains(RegExp(r'[A-Z]'));
// bool hasUppercase = password.contains(RegExp(r'[A-Z]'));
bool hasDigits = password.contains(RegExp(r'[0-9]'));
bool hasLowercase = password.contains(RegExp(r'[a-z]'));
// bool hasSpecialCharacters = password.contains(RegExp(r'[!@#$%^&*(),.?":{}|<>]'));
bool hasMinLength = password.length >= minLength;
bool isMatched = password == confirmPassword.text;
return hasDigits && hasUppercase && hasLowercase && hasMinLength && isMatched && checkRepeatedChars(password);
return hasDigits && hasLowercase && hasMinLength && isMatched && checkRepeatedChars(password);
}
bool checkRepeatedChars(String password) {

@ -57,7 +57,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
}
void validateTransaction() async {
try {
// try {
Utils.showLoading(context);
List<Map<String, dynamic>> values = getEitDffStructureList!.map((e) {
String tempVar = e.eSERVICESDV?.pIDCOLUMNNAME ?? "";
@ -98,10 +98,10 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
Utils.showLoading(context);
await LeaveBalanceApiClient().cancelHrTransaction(submitEITTransactionList.pTRANSACTIONID!);
Utils.hideLoading(context);
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
// } catch (ex) {
// Utils.hideLoading(context);
// Utils.handleException(ex, context, null);
// }
}
String dESCFLEXCONTEXTCODE = "";

@ -81,7 +81,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
value: 0, name: 'COC', fullName: LocaleKeys.itemCreation.tr(), active: false, color: [Color(0xff787299), Color(0xff1AB170)], icon: "assets/images/miss_swipe.svg", key: 'COC', disable: true)
];
int workListItemIndex = 0;
int? workListItemIndex;
List<WorkListResponseModel>? workList;
int pageNumber = 1;
@ -99,7 +99,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
super.initState();
providerData = Provider.of<DashboardProviderModel>(context, listen: false);
calculateCounter();
getWorkList();
if (workListItemIndex != null) getWorkList();
}
void calculateCounter() {
@ -115,11 +115,17 @@ class _WorkListScreenState extends State<WorkListScreen> {
}
}
});
workListItemTypes.removeWhere((element) => element.value == 0);
if (workListItemTypes.isNotEmpty) {
workListItemIndex = 0;
} else {
workListItemIndex = null;
}
}
void verifyWorkListCounter() {
workListItemTypes.forEach((workListElement) {
if (workListElement.key == "ITG" && workListItemTypes[workListItemIndex].key == "ITG") {
if (workListElement.key == "ITG" && workListItemTypes[workListItemIndex!].key == "ITG") {
workListElement.value = providerData.itgFormsModel?.totalCount ?? 0;
if ((AppState().requestAllList?.length ?? 0) != workListElement.value) {
workListElement.value = AppState().requestAllList?.length ?? 0;
@ -132,7 +138,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
workListElement.value = providerData.cocFinalCount;
} else {
providerData.getOpenNotificationsList?.forEach((element) {
if ((element.itemType == workListItemTypes[workListItemIndex].key) && element.itemType == workListElement.key) {
if ((element.itemType == workListItemTypes[workListItemIndex!].key) && element.itemType == workListElement.key) {
if ((AppState().workList?.length ?? 0) != (element.openNtfNumber ?? 0)) {
workListElement.value = AppState().workList?.length ?? 0;
providerData.workListCounter = providerData.workListCounter - ((element.openNtfNumber ?? 0) - (AppState().workList?.length ?? 0));
@ -162,7 +168,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
Future<void> getWorkList({bool showLoading = true}) async {
try {
if (showLoading) Utils.showLoading(context);
if (workListItemTypes[workListItemIndex].key == "ITG") {
if (workListItemTypes[workListItemIndex!].key == "ITG") {
itgFormsModel = await WorkListApiClient().getITGTaskCountRequestType();
List<RequestDetails> requestAllList = [];
for (int i = 0; i < (itgFormsModel?.requestType!.length ?? 0); i++) {
@ -178,7 +184,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
}
} else {
itgRequestTypeIndex = null;
workList = await WorkListApiClient().getWorkList(pageNumber, workListItemTypes[workListItemIndex].key, pNotificationType.toString());
workList = await WorkListApiClient().getWorkList(pageNumber, workListItemTypes[workListItemIndex!].key, pNotificationType.toString());
AppState().setWorkList = workList;
}
if (showLoading) Utils.hideLoading(context);
@ -216,127 +222,129 @@ class _WorkListScreenState extends State<WorkListScreen> {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget(context, title: LocaleKeys.workList.tr(), showWorkListSettingButton: true),
body: SizedBox(
width: double.infinity,
height: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 40,
child: ListView.separated(
controller: _controller,
itemBuilder: (context, index) {
return Container(
padding: const EdgeInsets.only(left: 21, right: 21, top: 8, bottom: 8),
alignment: Alignment.center,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(6), color: workListItemIndex == index ? MyColors.darkIconColor : MyColors.lightGreyEAColor),
child: ("${workListItemTypes[index].name} ${workListItemTypes[index].value > 0 ? "(${workListItemTypes[index].value})" : ""}")
.toText12(color: workListItemIndex == index ? MyColors.white : MyColors.black),
).onPress(() {
if (pNotificationType != 1) {
pNotificationType = 1;
}
if (workListItemIndex != index && !workListItemTypes[index].disable) {
workListItemIndex = index;
if (workListItemTypes[index].value == 0) {
workList = [];
itgRequestTypeIndex = null;
} else {
workList = null;
}
setState(() {});
if (workListItemTypes[index].value > 0) {
getWorkList();
}
}
});
},
separatorBuilder: (context, index) => 8.width,
shrinkWrap: true,
itemCount: workListItemTypes.length,
scrollDirection: Axis.horizontal,
padding: const EdgeInsets.only(left: 21, right: 21),
body: workListItemIndex == null
? Utils.getNoDataWidget(context)
: SizedBox(
width: double.infinity,
height: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 40,
child: ListView.separated(
controller: _controller,
itemBuilder: (context, index) {
return Container(
padding: const EdgeInsets.only(left: 21, right: 21, top: 8, bottom: 8),
alignment: Alignment.center,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(6), color: workListItemIndex == index ? MyColors.darkIconColor : MyColors.lightGreyEAColor),
child: ("${workListItemTypes[index].name} ${workListItemTypes[index].value > 0 ? "(${workListItemTypes[index].value})" : ""}")
.toText12(color: workListItemIndex == index ? MyColors.white : MyColors.black),
).onPress(() {
if (pNotificationType != 1) {
pNotificationType = 1;
}
if (workListItemIndex != index && !workListItemTypes[index].disable) {
workListItemIndex = index;
if (workListItemTypes[index].value == 0) {
workList = [];
itgRequestTypeIndex = null;
} else {
workList = null;
}
setState(() {});
if (workListItemTypes[index].value > 0) {
getWorkList();
}
}
});
},
separatorBuilder: (context, index) => 8.width,
shrinkWrap: true,
itemCount: workListItemTypes.length,
scrollDirection: Axis.horizontal,
padding: const EdgeInsets.only(left: 21, right: 21),
),
).paddingOnly(top: 21, bottom: 21),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
workListItemTypes[workListItemIndex!].fullName.toSectionHeading().paddingOnly(left: 21, right: 21),
LocaleKeys.advancedSearch.tr().toText14(isUnderLine: true, color: MyColors.textMixColor).onPress(() {
openBottomSheet(context);
}).paddingOnly(left: 21, right: 21)
],
),
SmartRefresher(
enablePullDown: true,
enablePullUp: false,
header: const MaterialClassicHeader(
color: MyColors.gradiantEndColor,
),
controller: _refreshController,
onRefresh: _onRefresh,
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: itgRequestTypeIndex != null
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// todo this is commented for temporary purpose, have issue when selecting any itg category and click any item showing wrong details
// SizedBox(
// height: 40,
// child: ListView.separated(
// itemBuilder: (context, index) {
// RequestType type = itgFormsModel!.requestType![index];
// return Container(
// padding: const EdgeInsets.only(left: 21, right: 21, top: 8, bottom: 8),
// alignment: Alignment.center,
// decoration: BoxDecoration(borderRadius: BorderRadius.circular(30), color: itgRequestTypeIndex == index ? MyColors.darkIconColor : MyColors.lightGreyEAColor),
// child: ("${type.requestTypeName}").toText12(color: itgRequestTypeIndex == index ? MyColors.white : MyColors.black),
// ).onPress(() {
// if (itgRequestTypeIndex != index) {
// itgRequestTypeIndex = index;
// setState(() {});
// }
// });
// },
// separatorBuilder: (context, index) => 8.width,
// shrinkWrap: true,
// itemCount: itgFormsModel?.requestType?.length ?? 0,
// scrollDirection: Axis.horizontal,
// padding: const EdgeInsets.only(left: 21, right: 21),
// ),
// ).paddingOnly(top: 16, bottom: 16),
ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return itgRowItem(workListItemTypes[workListItemIndex!], itgFormsModel!.requestType![itgRequestTypeIndex!].requestDetails![index], index);
},
separatorBuilder: (context, index) => 12.height,
itemCount: itgFormsModel!.requestType![itgRequestTypeIndex!].requestDetails?.length ?? 0,
padding: const EdgeInsets.all(21),
),
],
)
: workList != null
? ((workList!).isEmpty
? Utils.getNoDataWidget(context).paddingOnly(top: 100)
: ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return rowItem(workListItemTypes[workListItemIndex!], workList![index], index);
},
separatorBuilder: (context, index) => 12.height,
itemCount: workList?.length ?? 0,
padding: const EdgeInsets.all(21),
))
: const SizedBox(),
)).expanded,
],
),
).paddingOnly(top: 21, bottom: 21),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
workListItemTypes[workListItemIndex].fullName.toSectionHeading().paddingOnly(left: 21, right: 21),
LocaleKeys.advancedSearch.tr().toText14(isUnderLine: true, color: MyColors.textMixColor).onPress(() {
openBottomSheet(context);
}).paddingOnly(left: 21, right: 21)
],
),
SmartRefresher(
enablePullDown: true,
enablePullUp: false,
header: const MaterialClassicHeader(
color: MyColors.gradiantEndColor,
),
controller: _refreshController,
onRefresh: _onRefresh,
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: itgRequestTypeIndex != null
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// todo this is commented for temporary purpose, have issue when selecting any itg category and click any item showing wrong details
// SizedBox(
// height: 40,
// child: ListView.separated(
// itemBuilder: (context, index) {
// RequestType type = itgFormsModel!.requestType![index];
// return Container(
// padding: const EdgeInsets.only(left: 21, right: 21, top: 8, bottom: 8),
// alignment: Alignment.center,
// decoration: BoxDecoration(borderRadius: BorderRadius.circular(30), color: itgRequestTypeIndex == index ? MyColors.darkIconColor : MyColors.lightGreyEAColor),
// child: ("${type.requestTypeName}").toText12(color: itgRequestTypeIndex == index ? MyColors.white : MyColors.black),
// ).onPress(() {
// if (itgRequestTypeIndex != index) {
// itgRequestTypeIndex = index;
// setState(() {});
// }
// });
// },
// separatorBuilder: (context, index) => 8.width,
// shrinkWrap: true,
// itemCount: itgFormsModel?.requestType?.length ?? 0,
// scrollDirection: Axis.horizontal,
// padding: const EdgeInsets.only(left: 21, right: 21),
// ),
// ).paddingOnly(top: 16, bottom: 16),
ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return itgRowItem(workListItemTypes[workListItemIndex], itgFormsModel!.requestType![itgRequestTypeIndex!].requestDetails![index], index);
},
separatorBuilder: (context, index) => 12.height,
itemCount: itgFormsModel!.requestType![itgRequestTypeIndex!].requestDetails?.length ?? 0,
padding: const EdgeInsets.all(21),
),
],
)
: workList != null
? ((workList!).isEmpty
? Utils.getNoDataWidget(context).paddingOnly(top: 100)
: ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return rowItem(workListItemTypes[workListItemIndex], workList![index], index);
},
separatorBuilder: (context, index) => 12.height,
itemCount: workList?.length ?? 0,
padding: const EdgeInsets.all(21),
))
: const SizedBox(),
)).expanded,
],
),
),
);
}
@ -350,7 +358,10 @@ class _WorkListScreenState extends State<WorkListScreen> {
if (shouldReloadData.toString() == "delegate_reload") {
providerData.itgFormsModel!.totalCount = providerData.itgFormsModel!.totalCount! - 1;
calculateCounter();
getWorkList();
setState(() {});
if (workListItemIndex != null) {
getWorkList();
}
}
// workList!.remove(data);
// AppState().setWorkList = workList;

@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/worklist/worklist_api_client.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
@ -26,6 +25,7 @@ class _WorklistSettingsState extends State<WorklistSettings> {
List<GetUserItemTypesList> getUserItemTypesList = [];
UpdateUserItemTypesList? updateUserItemTypesList;
@override
void initState() {
super.initState();
userItemTypesList();
@ -47,13 +47,17 @@ class _WorklistSettingsState extends State<WorklistSettings> {
try {
Utils.showLoading(context);
List<Map<String, dynamic>> itemList = [];
for (var element in getUserItemTypesList) {
itemList.add(UpdateUserTypesList(itemID: element.uSERITEMTYPEID, pITEMTYPE: element.iTEMTYPE, pFYAENABLEDFALG: element.fYAENABLEDFALG, pFYIENABLEDFALG: element.fYIENABLEDFLAG).toJson());
for (int index = 0; index < getUserItemTypesList.length; index++) {
itemList.add(UpdateUserTypesList(
itemID: index,
pITEMTYPE: getUserItemTypesList[index].iTEMTYPE,
pFYAENABLEDFALG: getUserItemTypesList[index].fYAENABLEDFALG,
pFYIENABLEDFALG: getUserItemTypesList[index].fYIENABLEDFLAG)
.toJson());
}
updateUserItemTypesList = await WorkListApiClient().updateUserItemTypes(itemList);
Utils.hideLoading(context);
Navigator.pushNamed(context, AppRoutes.workList);
setState(() {});
Navigator.pop(context);
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
@ -63,87 +67,81 @@ class _WorklistSettingsState extends State<WorklistSettings> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget(
context,
title: LocaleKeys.worklistSettings.tr(),
),
body: Column(
children: [
ListView(
padding: const EdgeInsets.only(top: 21, left: 21, right: 21),
children: [
LocaleKeys.TurnNotificationsFor.tr().toText22(color: MyColors.blackColor),
16.height,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
LocaleKeys.itemType.tr().toText14(color: MyColors.blackColor),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: ["FYA".tr().toText14(color: MyColors.blackColor), 30.width, "FYI".tr().toText14(color: MyColors.blackColor), 30.width],
)
],
),
const Divider(color: MyColors.greyA5Color),
SingleChildScrollView(
scrollDirection: Axis.vertical,
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
itemCount: getUserItemTypesList == null ? 0 : getUserItemTypesList.length,
itemBuilder: (BuildContext context, int index) {
return Column(children: [
customSwitch(getUserItemTypesList[index]),
Divider(
color: MyColors.greyC4Color,
thickness: 0.5,
),
]);
}),
),
],
).expanded,
DefaultButton(LocaleKeys.save.tr(), () async {
updateUserItem();
}).insideContainer,
],
));
backgroundColor: Colors.white,
appBar: AppBarWidget(
context,
title: LocaleKeys.worklistSettings.tr(),
),
body: Column(
children: [
ListView(
padding: const EdgeInsets.only(top: 21, left: 21, right: 21),
children: [
LocaleKeys.TurnNotificationsFor.tr().toText22(color: MyColors.blackColor),
16.height,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
LocaleKeys.itemType.tr().toText14(color: MyColors.blackColor),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: ["FYA".tr().toText14(color: MyColors.blackColor), 30.width, "FYI".tr().toText14(color: MyColors.blackColor), 30.width],
)
],
),
const Divider(color: MyColors.greyA5Color),
ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemCount: getUserItemTypesList.length,
separatorBuilder: (cxt, index) => 1.divider,
itemBuilder: (BuildContext context, int index) => customSwitch(getUserItemTypesList[index]),
),
],
).expanded,
DefaultButton(LocaleKeys.save.tr(), () async {
updateUserItem();
}).insideContainer,
],
),
);
}
Widget customSwitch(GetUserItemTypesList list) {
return Padding(
padding: const EdgeInsets.only(top: 21),
padding: const EdgeInsets.only(top: 8, bottom: 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
list.iTEMTYPE.toString(),
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: MyColors.blackColor),
),
list.iTEMTYPE!.toText16(),
const Spacer(),
Row(
children: [
CupertinoSwitch(
trackColor: MyColors.grey57Color,
activeColor: MyColors.textMixColor,
value: list?.fYAENABLEDFALG == 'Y' ? true : false,
onChanged: (value) {
setState(() {
list?.fYAENABLEDFALG = value == true ? 'Y' : 'N';
});
}),
CupertinoSwitch(
Transform.scale(
scale: 0.8,
child: CupertinoSwitch(
trackColor: MyColors.grey57Color,
activeColor: MyColors.textMixColor,
value: list.fYAENABLEDFALG == 'Y',
onChanged: (value) {
setState(() {
list.fYAENABLEDFALG = value ? 'Y' : 'N';
});
}),
),
Transform.scale(
scale: 0.8,
child: CupertinoSwitch(
trackColor: MyColors.grey57Color,
activeColor: MyColors.textMixColor,
value: list?.fYIENABLEDFLAG == 'Y' ? true : false,
value: list.fYIENABLEDFLAG == 'Y',
onChanged: (value) {
setState(() {
// list.isFYI = value;
list?.fYIENABLEDFLAG = value == true ? 'Y' : 'N';
list.fYIENABLEDFLAG = value ? 'Y' : 'N';
});
}),
},
),
),
],
)
],

@ -73,7 +73,7 @@ class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
];
} else {
chartModelList = [
PieChartModel(LocaleKeys.adult.tr(), accrualList[1].accrualNetEntitlement ?? 0, MyColors.textMixColor, titleAppend: ""),
PieChartModel(LocaleKeys.adult.tr(), accrualList[1].accrualNetEntitlement?.toDouble() ?? 0, MyColors.textMixColor, titleAppend: ""),
PieChartModel(LocaleKeys.child.tr(), accrualList[2].accrualNetEntitlement?.toDouble() ?? 0, MyColors.backgroundBlackColor, titleAppend: ""),
PieChartModel(LocaleKeys.infants.tr(), accrualList[3].accrualNetEntitlement?.toDouble() ?? 0, MyColors.pinkColor, titleAppend: ""),
];
@ -101,7 +101,7 @@ class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
ticketBalanceAccrualList = Provider.of<DashboardProviderModel>(context, listen: false).accrualList ?? [];
if (ticketBalanceAccrualList!.isNotEmpty) {
chartModelList = [
PieChartModel(LocaleKeys.adult.tr(), ticketBalanceAccrualList![1].accrualNetEntitlement ?? 0, MyColors.textMixColor, titleAppend: ""),
PieChartModel(LocaleKeys.adult.tr(), ticketBalanceAccrualList![1].accrualNetEntitlement?.toDouble() ?? 0, MyColors.textMixColor, titleAppend: ""),
PieChartModel(LocaleKeys.child.tr(), ticketBalanceAccrualList![2].accrualNetEntitlement?.toDouble() ?? 0, MyColors.backgroundBlackColor, titleAppend: ""),
PieChartModel(LocaleKeys.infants.tr(), ticketBalanceAccrualList![3].accrualNetEntitlement?.toDouble() ?? 0, MyColors.pinkColor, titleAppend: ""),
];
@ -185,7 +185,7 @@ class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
Widget getChart(List<PieChartModel> chartModelList) {
List<Color> _colorList = chartModelList.map((e) => e.color).toList();
return PieChart(
dataMap: {for (var e in chartModelList) e.title: e.parsedValue},
dataMap: {for (var e in chartModelList) e.title: e.value},
animationDuration: const Duration(milliseconds: 800),
chartRadius: MediaQuery.of(context).size.width / 3.2,
colorList: _colorList,

@ -161,16 +161,16 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
);
} else {
bool status = await model.fetchAttendanceTracking(context);
if (Platform.isIOS) await Future.delayed(const Duration(seconds: 3));
Utils.hideLoading(context);
showMDialog(
context,
backgroundColor: Colors.transparent,
isDismissable: false,
isDismissable: true,
child: SuccessDialog(widget.isFromDashboard),
);
}
} catch (ex) {
print(ex);
Utils.hideLoading(context);
Utils.handleException(ex, context, (msg) {
Utils.confirmDialog(context, msg);
@ -239,7 +239,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
child: SuccessDialog(widget.isFromDashboard),
);
} catch (ex) {
print("performWifiAttendance: " + ex.toString());
await closeWifiRequest();
Utils.hideLoading(context);
Utils.handleException(ex, context, (msg) {
@ -274,7 +273,7 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
showMDialog(
context,
backgroundColor: Colors.transparent,
isDismissable: false,
isDismissable: true,
child: SuccessDialog(widget.isFromDashboard),
);
} catch (ex) {

Loading…
Cancel
Save