Merge branch 'master' into development_haroon

merge-requests/1/merge
haroon amjad 3 years ago
commit 492a1a9736

@ -416,209 +416,214 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
} else if (value!.indexOf('%') == 0 || value!.indexOf('%') == "") { } else if (value!.indexOf('%') == 0 || value!.indexOf('%') == "") {
percentage = 0; percentage = 0;
} }
showModalBottomSheet( if (details.date!.month == formattedDate.month && details.date!.year == formattedDate.year) {
context: context, int val = details.date!.day;
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)), getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'Y' ?
isScrollControlled: true, showModalBottomSheet(
backgroundColor: MyColors.backgroundBlackColor, context: context,
builder: (_) { shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)),
return DraggableScrollableSheet( isScrollControlled: true,
maxChildSize: 0.9, backgroundColor: MyColors.backgroundBlackColor,
expand: false, builder: (_) {
builder: (_, controller) { return DraggableScrollableSheet(
dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE; maxChildSize: 0.9,
DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss a").parse(dmyString); expand: false,
return Column( builder: (_, controller) {
children: [ dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE;
Container( DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss a").parse(dmyString);
width: 49, return Column(
height: 7, children: [
margin: const EdgeInsets.symmetric(vertical: 10), Container(
decoration: BoxDecoration( width: 49,
borderRadius: BorderRadius.circular(25), height: 7,
color: MyColors.darkGreyColor, margin: const EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: MyColors.darkGreyColor,
),
), ),
), Expanded(
Expanded( child: ListView.builder(
child: ListView.builder( controller: controller,
controller: controller, itemCount: 1,
itemCount: 1, itemBuilder: (_, i) =>
itemBuilder: (_, i) => Container( Container(
decoration: const BoxDecoration( decoration: const BoxDecoration(
borderRadius: BorderRadius.vertical( borderRadius: BorderRadius.vertical(
top: Radius.circular(25.0), top: Radius.circular(25.0),
), ),
color: MyColors.backgroundBlackColor, color: MyColors.backgroundBlackColor,
), ),
child: Column( child: Column(
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, 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: [ children: [
"${getScheduleShiftsDetailsList!.pERCENTAGE}".toText44(color: Colors.white, isBold: true), "${DateFormat("MMMM-dd-yyyy").format(dateTime1).replaceAll('-', " ")}".toText24(isBold: true, color: Colors.white),
LocaleKeys.completed.tr().toText11(color: MyColors.greyACColor), LocaleKeys.attendanceDetails.tr().toText16(color: MyColors.greyACColor),
28.height, 12.height,
LocaleKeys.shiftTime.tr().toText11(color: MyColors.greyACColor), CircularStepProgressBar(
"${getScheduleShiftsDetailsList!.sHTNAME}".toText22(color: Colors.white, isBold: true), 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),
).center, Stack(
],
).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: [ children: [
Row( Container(
children: [ width: double.infinity,
Column( decoration: const BoxDecoration(borderRadius: BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)), color: Colors.white),
crossAxisAlignment: CrossAxisAlignment.start, padding: const EdgeInsets.only(left: 31, right: 31, top: 30, bottom: 29),
children: [ child: Column(
LocaleKeys.actualCheckIn.tr().toText11( children: [
color: MyColors.grey67Color, Row(
), children: [
"${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}" != "" Column(
? "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}".toText22(color: Colors.black, isBold: true) crossAxisAlignment: CrossAxisAlignment.start,
: "__".toText22(color: Colors.black, isBold: true), children: [
], LocaleKeys.actualCheckIn.tr().toText11(
).expanded, color: MyColors.grey67Color,
Column( ),
crossAxisAlignment: CrossAxisAlignment.start, "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}" != ""
children: [ ? "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}".toText22(color: Colors.black, isBold: true)
LocaleKeys.actualCheckOut.tr().toText11( : "__".toText22(color: Colors.black, isBold: true),
color: MyColors.grey67Color, ],
), ).expanded,
"${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}" != "" Column(
? "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}".toText22(color: Colors.black, isBold: true) crossAxisAlignment: CrossAxisAlignment.start,
: "__".toText22(color: Colors.black, isBold: true), children: [
], LocaleKeys.actualCheckOut.tr().toText11(
).expanded, color: MyColors.grey67Color,
], ),
), "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}" != ""
25.height, ? "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}".toText22(color: Colors.black, isBold: true)
const Divider( : "__".toText22(color: Colors.black, isBold: true),
height: 1, ],
thickness: 1, ).expanded,
color: MyColors.lightGreyEFColor, ],
), ),
25.height, 25.height,
Row( const Divider(
children: [ height: 1,
Column( thickness: 1,
crossAxisAlignment: CrossAxisAlignment.start, color: MyColors.lightGreyEFColor,
children: [ ),
LocaleKeys.approvedCheckIn.tr().toText11( 25.height,
color: MyColors.grey67Color, Row(
), children: [
"${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}" != "" Column(
? "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}".toText22(color: MyColors.greenColor, isBold: true) crossAxisAlignment: CrossAxisAlignment.start,
: "__".toText22(color: MyColors.greenColor, isBold: true), children: [
], LocaleKeys.approvedCheckIn.tr().toText11(
).expanded, color: MyColors.grey67Color,
Column( ),
crossAxisAlignment: CrossAxisAlignment.start, "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}" != ""
children: [ ? "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}".toText22(color: MyColors.greenColor, isBold: true)
LocaleKeys.approvedCheckOut.tr().toText11( : "__".toText22(color: MyColors.greenColor, isBold: true),
color: MyColors.grey67Color, ],
), ).expanded,
"${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}" != "" Column(
? "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}".toText22(color: MyColors.greenColor, isBold: true) crossAxisAlignment: CrossAxisAlignment.start,
: "__".toText22(color: MyColors.greenColor, isBold: true), children: [
], LocaleKeys.approvedCheckOut.tr().toText11(
).expanded, color: MyColors.grey67Color,
], ),
), "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}" != ""
25.height, ? "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}".toText22(color: MyColors.greenColor, isBold: true)
const Divider( : "__".toText22(color: MyColors.greenColor, isBold: true),
height: 1, ],
thickness: 1, ).expanded,
color: MyColors.lightGreyEFColor, ],
), ),
25.height, 25.height,
Row( const Divider(
children: [ height: 1,
Column( thickness: 1,
crossAxisAlignment: CrossAxisAlignment.start, color: MyColors.lightGreyEFColor,
children: [ ),
LocaleKeys.lateIn.tr().toText11( 25.height,
color: MyColors.grey67Color, Row(
), children: [
"${getDayHoursTypeDetailsList[index].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true), Column(
], crossAxisAlignment: CrossAxisAlignment.start,
).expanded, children: [
Column( LocaleKeys.lateIn.tr().toText11(
crossAxisAlignment: CrossAxisAlignment.start, color: MyColors.grey67Color,
children: [ ),
LocaleKeys.excess.tr().toText11( "${getDayHoursTypeDetailsList[index].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true),
color: MyColors.grey67Color, ],
), ).expanded,
"${getDayHoursTypeDetailsList[index].eXCESSHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true), Column(
], crossAxisAlignment: CrossAxisAlignment.start,
).expanded, children: [
], LocaleKeys.excess.tr().toText11(
), color: MyColors.grey67Color,
25.height, ),
const Divider( "${getDayHoursTypeDetailsList[index].eXCESSHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true),
height: 1, ],
thickness: 1, ).expanded,
color: MyColors.lightGreyEFColor, ],
), ),
25.height, 25.height,
Row( const Divider(
children: [ height: 1,
Column( thickness: 1,
crossAxisAlignment: CrossAxisAlignment.start, color: MyColors.lightGreyEFColor,
children: [ ),
LocaleKeys.shortage.tr().toText11( 25.height,
color: MyColors.grey67Color, Row(
), children: [
"${getDayHoursTypeDetailsList[index].sHORTAGEHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true), Column(
], crossAxisAlignment: CrossAxisAlignment.start,
).expanded, children: [
Column( LocaleKeys.shortage.tr().toText11(
crossAxisAlignment: CrossAxisAlignment.start, color: MyColors.grey67Color,
children: [ ),
LocaleKeys.earlyOut.tr().toText11( "${getDayHoursTypeDetailsList[index].sHORTAGEHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true),
color: MyColors.grey67Color, ],
), ).expanded,
"${getDayHoursTypeDetailsList[index].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true), Column(
], crossAxisAlignment: CrossAxisAlignment.start,
).expanded, children: [
], LocaleKeys.earlyOut.tr().toText11(
color: MyColors.grey67Color,
),
"${getDayHoursTypeDetailsList[index].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true),
],
).expanded,
],
),
],
),
), ),
], ],
), ),
), ],
], ),
), ),
],
),
), ),
), ),
), ],
], );
); },
}, );
); },
}, ):null;
); }
} }
List<Meeting> _getDataSource() { List<Meeting> _getDataSource() {

@ -91,7 +91,7 @@ class _ChangePasswordScreenState extends State<ChangePasswordScreen> {
LocaleKeys.confirmPassword.tr(), LocaleKeys.confirmPassword.tr(),
"**********", "**********",
confirmPassword, confirmPassword,
isObscureText: true, isTextIsPassword: true,
onChange: (value) { onChange: (value) {
setState(() {}); setState(() {});
}, },

@ -179,7 +179,7 @@ class _LoginScreenState extends State<LoginScreen> {
16.height, 16.height,
InputWidget(LocaleKeys.username.tr(), "123456", username), InputWidget(LocaleKeys.username.tr(), "123456", username),
12.height, 12.height,
InputWidget(LocaleKeys.password.tr(), "xxxxxx", password, isObscureText: true), InputWidget(LocaleKeys.password.tr(), "xxxxxx", password, isTextIsPassword: true),
9.height, 9.height,
Align( Align(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,

@ -85,7 +85,7 @@ class _NewPasswordScreenState extends State<NewPasswordScreen> {
LocaleKeys.confirmPassword.tr(), LocaleKeys.confirmPassword.tr(),
"**********", "**********",
confirmPassword, confirmPassword,
isObscureText: true, isTextIsPassword: true,
onChange: (value) { onChange: (value) {
setState(() {}); setState(() {});
}, },

@ -424,209 +424,214 @@ class _ViewAttendanceState extends State<ViewAttendance> {
} else if (value!.indexOf('%') == 0 || value!.indexOf('%') == "") { } else if (value!.indexOf('%') == 0 || value!.indexOf('%') == "") {
percentage = 0; percentage = 0;
} }
showModalBottomSheet( if (details.date!.month == formattedDate.month && details.date!.year == formattedDate.year) {
context: context, int val = details.date!.day;
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)), getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'Y' ?
isScrollControlled: true, showModalBottomSheet(
backgroundColor: MyColors.backgroundBlackColor, context: context,
builder: (_) { shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)),
return DraggableScrollableSheet( isScrollControlled: true,
maxChildSize: 0.9, backgroundColor: MyColors.backgroundBlackColor,
expand: false, builder: (_) {
builder: (_, controller) { return DraggableScrollableSheet(
dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE; maxChildSize: 0.9,
DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss a").parse(dmyString); expand: false,
return Column( builder: (_, controller) {
children: [ dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE;
Container( DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss a").parse(dmyString);
width: 49, return Column(
height: 7, children: [
margin: const EdgeInsets.symmetric(vertical: 10), Container(
decoration: BoxDecoration( width: 49,
borderRadius: BorderRadius.circular(25), height: 7,
color: MyColors.darkGreyColor, margin: const EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: MyColors.darkGreyColor,
),
), ),
), Expanded(
Expanded( child: ListView.builder(
child: ListView.builder( controller: controller,
controller: controller, itemCount: 1,
itemCount: 1, itemBuilder: (_, i) =>
itemBuilder: (_, i) => Container( Container(
decoration: const BoxDecoration( decoration: const BoxDecoration(
borderRadius: BorderRadius.vertical( borderRadius: BorderRadius.vertical(
top: Radius.circular(25.0), top: Radius.circular(25.0),
), ),
color: MyColors.backgroundBlackColor, color: MyColors.backgroundBlackColor,
), ),
child: Column( child: Column(
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, 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: [ children: [
"${getScheduleShiftsDetailsList!.pERCENTAGE}".toText44(color: Colors.white, isBold: true), "${DateFormat("MMMM-dd-yyyy").format(dateTime1).replaceAll('-', " ")}".toText24(isBold: true, color: Colors.white),
LocaleKeys.completed.tr().toText11(color: MyColors.greyACColor), LocaleKeys.attendanceDetails.tr().toText16(color: MyColors.greyACColor),
28.height, 12.height,
LocaleKeys.shiftTime.tr().toText11(color: MyColors.greyACColor), CircularStepProgressBar(
"${getScheduleShiftsDetailsList!.sHTNAME}".toText22(color: Colors.white, isBold: true), 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),
).center, Stack(
],
).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: [ children: [
Row( Container(
children: [ width: double.infinity,
Column( decoration: const BoxDecoration(borderRadius: BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)), color: Colors.white),
crossAxisAlignment: CrossAxisAlignment.start, padding: const EdgeInsets.only(left: 31, right: 31, top: 30, bottom: 29),
children: [ child: Column(
LocaleKeys.actualCheckIn.tr().toText11( children: [
color: MyColors.grey67Color, Row(
), children: [
"${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}" != "" Column(
? "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}".toText22(color: Colors.black, isBold: true) crossAxisAlignment: CrossAxisAlignment.start,
: "__".toText22(color: Colors.black, isBold: true), children: [
], LocaleKeys.actualCheckIn.tr().toText11(
).expanded, color: MyColors.grey67Color,
Column( ),
crossAxisAlignment: CrossAxisAlignment.start, "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}" != ""
children: [ ? "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}".toText22(color: Colors.black, isBold: true)
LocaleKeys.actualCheckOut.tr().toText11( : "__".toText22(color: Colors.black, isBold: true),
color: MyColors.grey67Color, ],
), ).expanded,
"${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}" != "" Column(
? "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}".toText22(color: Colors.black, isBold: true) crossAxisAlignment: CrossAxisAlignment.start,
: "__".toText22(color: Colors.black, isBold: true), children: [
], LocaleKeys.actualCheckOut.tr().toText11(
).expanded, color: MyColors.grey67Color,
], ),
), "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}" != ""
25.height, ? "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}".toText22(color: Colors.black, isBold: true)
const Divider( : "__".toText22(color: Colors.black, isBold: true),
height: 1, ],
thickness: 1, ).expanded,
color: MyColors.lightGreyEFColor, ],
), ),
25.height, 25.height,
Row( const Divider(
children: [ height: 1,
Column( thickness: 1,
crossAxisAlignment: CrossAxisAlignment.start, color: MyColors.lightGreyEFColor,
children: [ ),
LocaleKeys.approvedCheckIn.tr().toText11( 25.height,
color: MyColors.grey67Color, Row(
), children: [
"${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}" != "" Column(
? "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}".toText22(color: MyColors.greenColor, isBold: true) crossAxisAlignment: CrossAxisAlignment.start,
: "__".toText22(color: MyColors.greenColor, isBold: true), children: [
], LocaleKeys.approvedCheckIn.tr().toText11(
).expanded, color: MyColors.grey67Color,
Column( ),
crossAxisAlignment: CrossAxisAlignment.start, "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}" != ""
children: [ ? "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}".toText22(color: MyColors.greenColor, isBold: true)
LocaleKeys.approvedCheckOut.tr().toText11( : "__".toText22(color: MyColors.greenColor, isBold: true),
color: MyColors.grey67Color, ],
), ).expanded,
"${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}" != "" Column(
? "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}".toText22(color: MyColors.greenColor, isBold: true) crossAxisAlignment: CrossAxisAlignment.start,
: "__".toText22(color: MyColors.greenColor, isBold: true), children: [
], LocaleKeys.approvedCheckOut.tr().toText11(
).expanded, color: MyColors.grey67Color,
], ),
), "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}" != ""
25.height, ? "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}".toText22(color: MyColors.greenColor, isBold: true)
const Divider( : "__".toText22(color: MyColors.greenColor, isBold: true),
height: 1, ],
thickness: 1, ).expanded,
color: MyColors.lightGreyEFColor, ],
), ),
25.height, 25.height,
Row( const Divider(
children: [ height: 1,
Column( thickness: 1,
crossAxisAlignment: CrossAxisAlignment.start, color: MyColors.lightGreyEFColor,
children: [ ),
LocaleKeys.lateIn.tr().toText11( 25.height,
color: MyColors.grey67Color, Row(
), children: [
"${getDayHoursTypeDetailsList[index].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true), Column(
], crossAxisAlignment: CrossAxisAlignment.start,
).expanded, children: [
Column( LocaleKeys.lateIn.tr().toText11(
crossAxisAlignment: CrossAxisAlignment.start, color: MyColors.grey67Color,
children: [ ),
LocaleKeys.excess.tr().toText11( "${getDayHoursTypeDetailsList[index].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true),
color: MyColors.grey67Color, ],
), ).expanded,
"${getDayHoursTypeDetailsList[index].eXCESSHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true), Column(
], crossAxisAlignment: CrossAxisAlignment.start,
).expanded, children: [
], LocaleKeys.excess.tr().toText11(
), color: MyColors.grey67Color,
25.height, ),
const Divider( "${getDayHoursTypeDetailsList[index].eXCESSHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true),
height: 1, ],
thickness: 1, ).expanded,
color: MyColors.lightGreyEFColor, ],
), ),
25.height, 25.height,
Row( const Divider(
children: [ height: 1,
Column( thickness: 1,
crossAxisAlignment: CrossAxisAlignment.start, color: MyColors.lightGreyEFColor,
children: [ ),
LocaleKeys.shortage.tr().toText11( 25.height,
color: MyColors.grey67Color, Row(
), children: [
"${getDayHoursTypeDetailsList[index].sHORTAGEHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true), Column(
], crossAxisAlignment: CrossAxisAlignment.start,
).expanded, children: [
Column( LocaleKeys.shortage.tr().toText11(
crossAxisAlignment: CrossAxisAlignment.start, color: MyColors.grey67Color,
children: [ ),
LocaleKeys.earlyOut.tr().toText11( "${getDayHoursTypeDetailsList[index].sHORTAGEHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true),
color: MyColors.grey67Color, ],
), ).expanded,
"${getDayHoursTypeDetailsList[index].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true), Column(
], crossAxisAlignment: CrossAxisAlignment.start,
).expanded, children: [
], LocaleKeys.earlyOut.tr().toText11(
color: MyColors.grey67Color,
),
"${getDayHoursTypeDetailsList[index].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true),
],
).expanded,
],
),
],
),
), ),
], ],
), ),
), ],
], ),
), ),
],
),
), ),
), ),
), ],
], );
); },
}, );
); },
}, ):null;
); }
} }
List<Meeting> _getDataSource() { List<Meeting> _getDataSource() {
List<Meeting> meetings = <Meeting>[]; List<Meeting> meetings = <Meeting>[];

@ -1,7 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
class InputWidget extends StatelessWidget { class InputWidget extends StatefulWidget {
final String labelText; final String labelText;
final String hintText; final String hintText;
final TextEditingController controller; final TextEditingController controller;
@ -10,7 +12,7 @@ class InputWidget extends StatelessWidget {
final bool hasSelection; final bool hasSelection;
final int? lines; final int? lines;
final bool isInputTypeNum; final bool isInputTypeNum;
final bool isObscureText; final bool isTextIsPassword;
final bool isBackgroundEnable; final bool isBackgroundEnable;
final bool isEnableBorder; final bool isEnableBorder;
final double verticalPadding; final double verticalPadding;
@ -21,7 +23,8 @@ class InputWidget extends StatelessWidget {
this.labelText, this.labelText,
this.hintText, this.hintText,
this.controller, { this.controller, {
this.isObscureText = false, Key? key,
this.isTextIsPassword = false,
this.suffixTap, this.suffixTap,
this.isEnable = true, this.isEnable = true,
this.hasSelection = false, this.hasSelection = false,
@ -32,23 +35,43 @@ class InputWidget extends StatelessWidget {
this.isBackgroundEnable = false, this.isBackgroundEnable = false,
this.verticalPadding = 15, this.verticalPadding = 15,
this.horizontalPadding = 16, this.horizontalPadding = 16,
}); }) : super(key: key);
@override
_InputWidgetState createState() {
return _InputWidgetState();
}
}
class _InputWidgetState extends State<InputWidget> {
late bool isObscureText;
@override
void initState() {
super.initState();
isObscureText = widget.isTextIsPassword;
}
@override
void dispose() {
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: EdgeInsets.only(left: horizontalPadding, right: horizontalPadding, bottom: verticalPadding, top: verticalPadding), padding: EdgeInsets.only(left: widget.horizontalPadding, right: widget.horizontalPadding, bottom: widget.verticalPadding, top: widget.verticalPadding),
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
color: isBackgroundEnable ? Color(0xffF7F7F7) : Colors.white, color: widget.isBackgroundEnable ? Color(0xffF7F7F7) : Colors.white,
border: Border.all( border: Border.all(
color: isEnableBorder ? Color(0xffefefef) : Colors.transparent, color: widget.isEnableBorder ? Color(0xffefefef) : Colors.transparent,
width: 1, width: 1,
), ),
), ),
child: InkWell( child: InkWell(
onTap: hasSelection ? () {} : null, onTap: widget.hasSelection ? () {} : null,
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
@ -57,7 +80,7 @@ class InputWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
labelText, widget.labelText,
style: const TextStyle( style: const TextStyle(
fontSize: 11, fontSize: 11,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -66,14 +89,14 @@ class InputWidget extends StatelessWidget {
), ),
), ),
TextField( TextField(
enabled: isEnable, enabled: widget.isEnable,
scrollPadding: EdgeInsets.zero, scrollPadding: EdgeInsets.zero,
keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text, keyboardType: widget.isInputTypeNum ? TextInputType.number : TextInputType.text,
controller: controller, controller: widget.controller,
maxLines: lines, maxLines: widget.lines,
obscuringCharacter: "*", obscuringCharacter: "*",
obscureText: isObscureText, obscureText: isObscureText,
onChanged: onChange, onChanged: widget.onChange,
style: const TextStyle( style: const TextStyle(
fontSize: 14, fontSize: 14,
height: 21 / 14, height: 21 / 14,
@ -83,7 +106,7 @@ class InputWidget extends StatelessWidget {
), ),
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
hintText: hintText, hintText: widget.hintText,
hintStyle: const TextStyle( hintStyle: const TextStyle(
fontSize: 14, fontSize: 14,
height: 21 / 14, height: 21 / 14,
@ -92,7 +115,7 @@ class InputWidget extends StatelessWidget {
letterSpacing: -0.56, letterSpacing: -0.56,
), ),
suffixIconConstraints: const BoxConstraints(minWidth: 50), suffixIconConstraints: const BoxConstraints(minWidth: 50),
suffixIcon: suffixTap == null ? null : IconButton(icon: const Icon(Icons.mic, color: MyColors.darkTextColor), onPressed: suffixTap), suffixIcon: widget.suffixTap == null ? null : IconButton(icon: const Icon(Icons.mic, color: MyColors.darkTextColor), onPressed: widget.suffixTap),
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
border: InputBorder.none, border: InputBorder.none,
focusedBorder: InputBorder.none, focusedBorder: InputBorder.none,
@ -102,7 +125,15 @@ class InputWidget extends StatelessWidget {
], ],
), ),
), ),
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), if (widget.isTextIsPassword) ...[
16.width,
Icon(isObscureText ? Icons.visibility_rounded : Icons.visibility_off_rounded).onPress(() {
setState(() {
isObscureText = !isObscureText;
});
})
],
if (widget.hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
], ],
), ),
), ),

Loading…
Cancel
Save