From 416a33b2fdc663fe0b0a5318fa99d110c237fe9a Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Mon, 29 Aug 2022 14:12:13 +0300 Subject: [PATCH] fix design --- assets/images/call.svg | 7 + assets/images/create_request.svg | 6 + assets/images/profile_details.svg | 14 + assets/images/team.svg | 34 ++ assets/images/view_attendance.svg | 8 + assets/langs/ar-SA.json | 11 + assets/langs/en-US.json | 11 + lib/classes/colors.dart | 5 + lib/config/routes.dart | 2 +- lib/generated/codegen_loader.g.dart | 20 ++ lib/generated/locale_keys.g.dart | 10 + lib/models/profile_menu.model.dart | 6 +- .../attendance/monthly_attendance_screen.dart | 4 +- lib/ui/login/login_screen.dart | 2 +- lib/ui/my_team/employee_details.dart | 129 +++---- lib/ui/my_team/my_team.dart | 241 +++++-------- lib/ui/my_team/profile_details.dart | 36 +- lib/ui/my_team/team_members.dart | 156 +++------ lib/ui/my_team/view_attendance.dart | 32 +- lib/ui/profile/add_update_family_member.dart | 28 +- lib/ui/profile/basic_details.dart | 111 +++--- lib/ui/profile/contact_details.dart | 2 +- lib/ui/profile/delete_family_member.dart | 39 ++- lib/ui/profile/family_members.dart | 317 ++++++++---------- lib/ui/work_list/worklist_settings.dart | 131 ++++---- 25 files changed, 645 insertions(+), 717 deletions(-) create mode 100644 assets/images/call.svg create mode 100644 assets/images/create_request.svg create mode 100644 assets/images/profile_details.svg create mode 100644 assets/images/team.svg create mode 100644 assets/images/view_attendance.svg diff --git a/assets/images/call.svg b/assets/images/call.svg new file mode 100644 index 0000000..f98d059 --- /dev/null +++ b/assets/images/call.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/images/create_request.svg b/assets/images/create_request.svg new file mode 100644 index 0000000..c5bdeea --- /dev/null +++ b/assets/images/create_request.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/profile_details.svg b/assets/images/profile_details.svg new file mode 100644 index 0000000..9daf5ad --- /dev/null +++ b/assets/images/profile_details.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/images/team.svg b/assets/images/team.svg new file mode 100644 index 0000000..aff9c19 --- /dev/null +++ b/assets/images/team.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/view_attendance.svg b/assets/images/view_attendance.svg new file mode 100644 index 0000000..256bf7a --- /dev/null +++ b/assets/images/view_attendance.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 0c6ce54..c14d655 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -339,6 +339,17 @@ "pleaseSelectEmployeeForReplacement": "الرجاء تحديد موظف للاستبدال", "pleaseSelectAction": "الرجاء تحديد الإجراء", "pleaseSelectDate": "الرجاء تحديد التاريخ", + "todayAttendance": "حضور اليوم", + "viewAttendance": "عرض الحضور", + "teamMembers":"اعضاءالفريق", + "profileDetails": "الملف الشخصي", + "noResultsFound" : "لايوجد نتائج", + "searchBy": "بحث بواسطة", + "myTeamMembers": "اعضاء فريقي", + "save": "حفظ", + "itemType": "نوع العنصر", + "TurnNotificationsFor": "تفعيل الاشعارات", + "worklistSettings": "اعدادات الاشعارات", "profile": { "reset_password": { "label": "Reset Password", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 812fa49..69adbf2 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -339,6 +339,17 @@ "pleaseSelectEmployeeForReplacement": "Please select employee for replacement", "pleaseSelectAction": "Please select action", "pleaseSelectDate": "Please select date", + "todayAttendance": "Today's Attendance", + "viewAttendance": "View Attendance", + "teamMembers":"Team Members", + "profileDetails": "Profile Details", + "noResultsFound" : "No Results Found", + "searchBy": "Search by", + "myTeamMembers": "My Team Members", + "save": "Save", + "itemType": "Item Type", + "TurnNotificationsFor": "Turn on notifications for", + "worklistSettings": "Worklist Settings", "profile": { "reset_password": { "label": "Reset Password", diff --git a/lib/classes/colors.dart b/lib/classes/colors.dart index feabaea..322bac6 100644 --- a/lib/classes/colors.dart +++ b/lib/classes/colors.dart @@ -43,4 +43,9 @@ class MyColors { static const Color lightGrayColor = Color(0xff808080); static const Color DarkRedColor = Color(0xffD02127); static const Color lightGreyColor = Color(0xffC7C7C7); + static const Color green69Color = Color(0xff1FA169); + static const Color redA3Color = Color(0xffCA3332); + static const Color green9CColor = Color(0xff259CB8); + static const Color green2DColor = Color(0xff32D892); + static const Color greyC4Color = Color(0xffC4C4C4); } diff --git a/lib/config/routes.dart b/lib/config/routes.dart index 4742b0d..92d39ab 100644 --- a/lib/config/routes.dart +++ b/lib/config/routes.dart @@ -14,7 +14,7 @@ import 'package:mohem_flutter_app/ui/misc/request_submit_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/services_menu_list_screen.dart'; -import 'package:mohem_flutter_app/ui/my_attendance/my_attendance_screen.dart'; +// import 'package:mohem_flutter_app/ui/my_attendance/my_attendance_screen.dart'; import 'package:mohem_flutter_app/ui/my_team/create_request.dart'; import 'package:mohem_flutter_app/ui/my_team/employee_details.dart'; import 'package:mohem_flutter_app/ui/my_team/my_team.dart'; diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 57323da..ae25a1e 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -355,6 +355,16 @@ class CodegenLoader extends AssetLoader{ "pleaseSelectEmployeeForReplacement": "الرجاء تحديد موظف للاستبدال", "pleaseSelectAction": "الرجاء تحديد الإجراء", "pleaseSelectDate": "الرجاء تحديد التاريخ", + "todayAttendance": "حضور اليوم", + "viewAttendance": "عرض الحضور", + "teamMembers": "اعضاءالفريق", + "profileDetails": "الملف الشخصي", + "noResultsFound": "لايوجد نتائج", + "searchBy": "بحث بواسطة", + "myTeamMembers": "اعضاء فريقي", + "save": "حفظ", + "TurnNotificationsFor": "تفعيل الاشعارات", + "worklistSettings": "اعدادات الاشعارات", "profile": { "reset_password": { "label": "Reset Password", @@ -730,6 +740,16 @@ static const Map en_US = { "pleaseSelectEmployeeForReplacement": "Please select employee for replacement", "pleaseSelectAction": "Please select action", "pleaseSelectDate": "Please select date", + "todayAttendance": "Today's Attendance", + "viewAttendance": "View Attendance", + "teamMembers": "Team Members", + "profileDetails": "Profile Details", + "noResultsFound": "No Results Found", + "searchBy": "Search by", + "myTeamMembers": "My Team Members", + "save": "Save", + "TurnNotificationsFor": "Turn on notifications for", + "worklistSettings": "Worklist Settings", "profile": { "reset_password": { "label": "Reset Password", diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index d736c34..c3e3081 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -340,6 +340,16 @@ abstract class LocaleKeys { static const pleaseSelectEmployeeForReplacement = 'pleaseSelectEmployeeForReplacement'; static const pleaseSelectAction = 'pleaseSelectAction'; static const pleaseSelectDate = 'pleaseSelectDate'; + static const todayAttendance = 'todayAttendance'; + static const viewAttendance = 'viewAttendance'; + static const teamMembers = 'teamMembers'; + static const profileDetails = 'profileDetails'; + static const noResultsFound = 'noResultsFound'; + static const searchBy = 'searchBy'; + static const myTeamMembers = 'myTeamMembers'; + static const save = 'save'; + static const TurnNotificationsFor = 'TurnNotificationsFor'; + static const worklistSettings = 'worklistSettings'; static const profile_reset_password_label = 'profile.reset_password.label'; static const profile_reset_password_username = 'profile.reset_password.username'; static const profile_reset_password_password = 'profile.reset_password.password'; diff --git a/lib/models/profile_menu.model.dart b/lib/models/profile_menu.model.dart index b14198f..0fdfb6b 100644 --- a/lib/models/profile_menu.model.dart +++ b/lib/models/profile_menu.model.dart @@ -2,10 +2,6 @@ class ProfileMenu { final String name; final String icon; final String route; - final String dynamicUrl; - final String functionName; - final String requestID; - final GetMenuEntriesList menuEntries; final dynamic arguments; - ProfileMenu({this.name = '', this.icon = '', this.route = '', this.arguments = '', this.dynamicUrl = '', this.functionName = '', this.requestID = '', required this.menuEntries}); + ProfileMenu({this.name = '', this.icon = '', this.route = '', this.arguments = ''}); } diff --git a/lib/ui/attendance/monthly_attendance_screen.dart b/lib/ui/attendance/monthly_attendance_screen.dart index 6a73f70..614fc94 100644 --- a/lib/ui/attendance/monthly_attendance_screen.dart +++ b/lib/ui/attendance/monthly_attendance_screen.dart @@ -113,8 +113,8 @@ class _MonthlyAttendanceScreenState extends State { LocaleKeys.attendance.tr().toText24(isBold: true, color: MyColors.darkIconColor), Row( children: [ - "${DateFormat("MMMM-yyyy").format(formattedDate)}".toText16(color: MyColors.greyACColor), - const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.greyACColor), + "${DateFormat("MMMM-yyyy").format(formattedDate)}".toText16(color: MyColors.grey3AColor), + const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.grey3AColor), ], ).onPress(() async { showMonthPicker( diff --git a/lib/ui/login/login_screen.dart b/lib/ui/login/login_screen.dart index a2ef87a..7cccca8 100644 --- a/lib/ui/login/login_screen.dart +++ b/lib/ui/login/login_screen.dart @@ -135,7 +135,7 @@ class _LoginScreenState extends State { @override Widget build(BuildContext context) { username.text = "15153"; - password.text = "Abcd@1234"; + password.text = "Abcd@12345"; // username.text = "15444"; return Scaffold( diff --git a/lib/ui/my_team/employee_details.dart b/lib/ui/my_team/employee_details.dart index 064158c..2ef488b 100644 --- a/lib/ui/my_team/employee_details.dart +++ b/lib/ui/my_team/employee_details.dart @@ -2,6 +2,7 @@ import 'dart:collection'; import 'dart:ui'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_html/html_parser.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:mohem_flutter_app/api/my_team/my_team_api_client.dart'; import 'package:mohem_flutter_app/api/worklist/worklist_api_client.dart'; @@ -42,7 +43,7 @@ class _EmployeeDetailsState extends State { @override void initState() { super.initState(); - setState(() {}); + // setState(() {}); } //favorite @@ -126,67 +127,67 @@ class _EmployeeDetailsState extends State { width: _width, //height: 150, margin: EdgeInsets.only(top: 50), - padding: EdgeInsets.only(top: 50), + //padding: EdgeInsets.only(right: 17, left: 17), decoration: BoxDecoration( - color: Colors.white, + color: MyColors.whiteColor, borderRadius: const BorderRadius.all(Radius.circular(15)), boxShadow: [BoxShadow(color: MyColors.lightGreyColor, blurRadius: 15, spreadRadius: 3)], ), - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - /// card header - customLabel(getEmployeeSubordinates!.eMPLOYEENAME.toString(), 22, Colors.black, true), - customLabel(getEmployeeSubordinates!.eMPLOYEENUMBER.toString() + ' | ' + getEmployeeSubordinates!.jOBNAME.toString(), 14, Colors.grey, false), - customLabel(getEmployeeSubordinates!.eMPLOYEEEMAILADDRESS.toString(), 13, Colors.black, true), - ], - ).paddingOnly(top: 10, bottom: 10), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + IconButton( + onPressed: (){ + if(getEmployeeSubordinates!.isFavorite != true){ + showFavoriteAlertDialog(context); + setState(() {}); + }else{ + fetchChangeFav( + email: getEmployeeSubordinates?.eMPLOYEEEMAILADDRESS ?? "", + employeName: getEmployeeSubordinates!.eMPLOYEENAME ?? "", + image: getEmployeeSubordinates!.eMPLOYEEIMAGE ?? "", + userName: getEmployeeSubordinates!.eMPLOYEENUMBER ?? "", + isFav: false,); + setState(() {}); + } }, + icon: getEmployeeSubordinates!.isFavorite != true + ? Icon( + Icons.star_outline, + size: 35, + color: MyColors.green9CColor, + ) + : Icon( + Icons.star_outlined, + size: 35, + color: MyColors.green9CColor, + ), + ), + // Container(height: 100, alignment: Alignment.center, child: ProfileImage()), + InkWell( + onTap:() { + launchUrl(phoneNumber); + }, + child: SvgPicture.asset("assets/images/call.svg"), + ), + ], + ).paddingOnly(left:6, right: 17, top: 16), + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + /// card header + customLabel(getEmployeeSubordinates!.eMPLOYEENAME.toString(), 21, MyColors.grey3AColor, true), + customLabel(getEmployeeSubordinates!.eMPLOYEENUMBER.toString() + ' | ' + getEmployeeSubordinates!.jOBNAME.toString(), 13, MyColors.grey80Color, true), + customLabel(getEmployeeSubordinates!.eMPLOYEEEMAILADDRESS.toString(), 13, MyColors.grey3AColor, true), + ], + ).paddingOnly(bottom: 10), + ], ), ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - IconButton( - onPressed: (){ - if(getEmployeeSubordinates!.isFavorite != true){ - showFavoriteAlertDialog(context); - setState(() {}); - }else{ - fetchChangeFav( - email: getEmployeeSubordinates?.eMPLOYEEEMAILADDRESS ?? "", - employeName: getEmployeeSubordinates!.eMPLOYEENAME ?? "", - image: getEmployeeSubordinates!.eMPLOYEEIMAGE ?? "", - userName: getEmployeeSubordinates!.eMPLOYEENUMBER ?? "", - isFav: false,); - setState(() {}); - } }, - icon: getEmployeeSubordinates!.isFavorite != true - ? Icon( - Icons.star_outline, - size: 35, - color: Colors.green, - ) - : Icon( - Icons.star_outlined, - size: 35, - color: Colors.green, - ), - ).paddingOnly(top: 50), - Container(height: 100, alignment: Alignment.center, child: ProfileImage()), - IconButton( - onPressed: () { - launchUrl(phoneNumber); - }, - icon: Icon( - Icons.whatsapp, - color: Colors.green, - size: 30, - ).paddingOnly(top: 30), - ), - ], - ) - ])), + Container(height: 100, alignment: Alignment.center, child: ProfileImage()), + ]) + ), Container( margin: EdgeInsets.fromLTRB(21, 8, 21, 10), height: 260, @@ -228,17 +229,21 @@ class _EmployeeDetailsState extends State { }, child: ListTile( leading: SvgPicture.asset('assets/images/' + obj.icon), - title: Text(obj.name), - trailing: Icon(Icons.arrow_forward), + title: Text(obj.name, + style: TextStyle(color: MyColors.grey3AColor, + fontWeight: FontWeight.w600, + fontSize: 16)), + trailing: Icon(Icons.arrow_forward, + color: MyColors.grey3AColor,), ), ); } void setMenu(){ menu = [ - ProfileMenu(name: "Profile Details", icon: 'personal-info.svg', route: AppRoutes.profileDetails, arguments:getEmployeeSubordinates, dynamicUrl: '', menuEntries: getMenuEntries('')), - ProfileMenu(name: "Create Request", icon: 'personal-info.svg', route: AppRoutes.createRequest,arguments: getEmployeeSubordinates, menuEntries: getMenuEntries('')), - ProfileMenu(name: "View Attendance", icon: 'personal-info.svg', route: AppRoutes.viewAttendance, arguments: getEmployeeSubordinates, dynamicUrl: '', menuEntries: getMenuEntries('')), - ProfileMenu(name: "Team Members", icon: 'family-members.svg', route: AppRoutes.teamMembers, arguments: getEmployeeSubordinates, dynamicUrl: '', menuEntries: getMenuEntries('')), + ProfileMenu(name: "Profile Details", icon: "profile_details.svg", route: AppRoutes.profileDetails, arguments:getEmployeeSubordinates), + ProfileMenu(name: "Create Request", icon: "create_request.svg", route: AppRoutes.createRequest,arguments: getEmployeeSubordinates), + ProfileMenu(name: "View Attendance", icon: "view_attendance.svg", route: AppRoutes.viewAttendance, arguments: getEmployeeSubordinates), + ProfileMenu(name: "Team Members", icon: "team.svg", route: AppRoutes.teamMembers, arguments: getEmployeeSubordinates), ]; } diff --git a/lib/ui/my_team/my_team.dart b/lib/ui/my_team/my_team.dart index 5cb89ef..7366128 100644 --- a/lib/ui/my_team/my_team.dart +++ b/lib/ui/my_team/my_team.dart @@ -1,16 +1,18 @@ - +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:mohem_flutter_app/api/my_team/my_team_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'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/models/my_team/get_employee_subordinates_list.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:url_launcher/url_launcher.dart'; - class MyTeam extends StatefulWidget { const MyTeam({Key? key}) : super(key: key); @@ -19,8 +21,8 @@ class MyTeam extends StatefulWidget { } class _MyTeamState extends State { - String searchEmpEmail =""; - String searchEmpName =""; + String searchEmpEmail = ""; + String searchEmpName = ""; String searchEmpNo = ""; String? empId; List getEmployeeSubordinatesList = []; @@ -38,7 +40,7 @@ class _MyTeamState extends State { try { Utils.showLoading(context); getEmployeeSubordinatesList = await MyTeamApiClient().getEmployeeSubordinates(searchEmpEmail.toString(), searchEmpName.toString(), searchEmpNo.toString()); - getEmployeeSListOnSearch =getEmployeeSubordinatesList; + getEmployeeSListOnSearch = getEmployeeSubordinatesList; Utils.hideLoading(context); setState(() {}); } catch (ex) { @@ -51,191 +53,132 @@ class _MyTeamState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBarWidget( - context, - title:"My Team Members", + context, + title: LocaleKeys.myTeamMembers.tr(), ), - backgroundColor: MyColors.backgroundColor, + backgroundColor: MyColors.backgroundColor, body: SingleChildScrollView( child: Column( children: [ - Container( - width: double.infinity, - margin: EdgeInsets.only( - top: 28, - left: 18, - right: 18, - // bottom: 28 - ), - padding: EdgeInsets.only( left: 10, right: 10), - height: 65, - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 5, - blurRadius: 26, - offset: Offset(0, 3), - ), - ], - color: Colors.white, - borderRadius: BorderRadius.circular(10.0), - ), - child: - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children : [ - Expanded( - child: - TextField( - onChanged: dropdownValue =="Name" ? - (String value){ - getEmployeeSListOnSearch = getEmployeeSubordinatesList.where((GetEmployeeSubordinatesList element) - => element.eMPLOYEENAME!.toLowerCase().contains(value.toLowerCase())).toList(); + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + Expanded( + child: TextField( + onChanged: dropdownValue == "Name" + ? (String value) { + getEmployeeSListOnSearch = + getEmployeeSubordinatesList.where((GetEmployeeSubordinatesList element) => element.eMPLOYEENAME!.toLowerCase().contains(value.toLowerCase())).toList(); + setState(() {}); + } + : (String value) { + getEmployeeSListOnSearch = + getEmployeeSubordinatesList.where((GetEmployeeSubordinatesList element) => element.eMPLOYEEEMAILADDRESS!.toLowerCase().contains(value.toLowerCase())).toList(); setState(() {}); - }: (String value){ - getEmployeeSListOnSearch = getEmployeeSubordinatesList.where((GetEmployeeSubordinatesList element) - => element.eMPLOYEEEMAILADDRESS!.toLowerCase().contains(value.toLowerCase())).toList(); - setState(() {}); }, - controller: _textEditingController, - decoration: InputDecoration( - filled: true, - fillColor: Colors.white, - border: InputBorder.none, - enabledBorder: InputBorder.none, - focusedBorder: InputBorder.none, - // contentPadding: EdgeInsets.fromLTRB(10, 15, 10, 15), - hintText: 'Search by $dropdownValue', - hintStyle: TextStyle(fontSize: 16.0, color: Colors.black,), - ), - )), - dropDown() - ]), - ), + controller: _textEditingController, + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + border: InputBorder.none, + enabledBorder: InputBorder.none, + focusedBorder: InputBorder.none, + // contentPadding: EdgeInsets.fromLTRB(10, 15, 10, 15), + hintText: LocaleKeys.searchBy.tr() + " $dropdownValue", + hintStyle: TextStyle(fontSize: 14.0, color: MyColors.grey57Color, fontWeight: FontWeight.w600), + ), + )), + Row( + children: [ + "|".toText16(color: MyColors.greyC4Color), + 10.width, + dropDown(), + ], + ) + ]).objectContainerBorderView(), + // ), Container( + margin: EdgeInsets.only(left: 21, right: 21), width: MediaQuery.of(context).size.width, child: SingleChildScrollView( scrollDirection: Axis.vertical, child: Column( children: [ - _textEditingController!.text.isNotEmpty && getEmployeeSListOnSearch.isEmpty ? - Container( - child: "No Results found".toText16(color: MyColors.blackColor),).paddingOnly(top: 10) - : ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: _textEditingController!.text.isNotEmpty ? getEmployeeSListOnSearch.length : getEmployeeSubordinatesList.length, - itemBuilder: (context, index) { - var phoneNumber = Uri.parse('tel:${getEmployeeSListOnSearch[index].eMPLOYEEMOBILENUMBER}'); - return Container( - width: double.infinity, - margin: EdgeInsets.only( - top: 18, - left: 18, - right: 18, - ), - padding: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10), - // height: 110, - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 5, - blurRadius: 26, - offset: Offset(0, 3), - ), - ], - color: Colors.white, - borderRadius: BorderRadius.circular(10.0), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( + _textEditingController!.text.isNotEmpty && getEmployeeSListOnSearch.isEmpty + ? Container( + child: LocaleKeys.noResultsFound.tr().toText16(color: MyColors.blackColor), + ).paddingOnly(top: 10) + : ListView.separated( + scrollDirection: Axis.vertical, + shrinkWrap: true, + // padding: EdgeInsets.only(left: 21, right: 21), + physics: ScrollPhysics(), + separatorBuilder: (cxt, index) => 12.height, + itemCount: _textEditingController!.text.isNotEmpty ? getEmployeeSListOnSearch.length : getEmployeeSubordinatesList.length, + itemBuilder: (context, index) { + var phoneNumber = Uri.parse('tel:${getEmployeeSListOnSearch[index].eMPLOYEEMOBILENUMBER}'); + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + CircleAvatar( + radius: 25, + backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSListOnSearch[index].eMPLOYEEIMAGE)), + backgroundColor: Colors.black, + ), + 10.width, Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - - CircleAvatar( - radius: 25, - backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSListOnSearch[index].eMPLOYEEIMAGE)), - backgroundColor: Colors.black, - ), + // "Present".toText13(color: MyColors.greenColor), + "${getEmployeeSListOnSearch[index].eMPLOYEENAME}".toText16(isBold: true, color: MyColors.grey3AColor), + "${getEmployeeSListOnSearch[index].pOSITIONNAME}".toText10(isBold: true, color: MyColors.grey57Color), ], - ), - SizedBox( - width: 10, - ), + ).expanded, Column( - crossAxisAlignment: CrossAxisAlignment.start, children: [ - "Present".toText13(color: MyColors.greenColor), - "${getEmployeeSListOnSearch[index].eMPLOYEENAME}".toText16(color: MyColors.blackColor), - "${getEmployeeSListOnSearch[index].pOSITIONNAME}".toText13(color: MyColors.blackColor), - + InkWell( + onTap: () { + launchUrl(phoneNumber); + }, + child: SvgPicture.asset("assets/images/call.svg"), + ), + 21.height, + InkWell( + onTap: () async { + Navigator.pushNamed(context, AppRoutes.employeeDetails, arguments: getEmployeeSListOnSearch[index]); + }, + child: Icon(Icons.arrow_forward_outlined, color: MyColors.grey3AColor), + ), ], ), ], - ), - Column( - children: [ - IconButton( - onPressed: () { - launchUrl(phoneNumber); - }, - icon: Icon( - Icons.whatsapp, - color: Colors.green, - ), - ), - IconButton( - onPressed: () async{ - Navigator.pushNamed(context,AppRoutes.employeeDetails,arguments: getEmployeeSListOnSearch[index]); - // Navigator.of(context).push(MaterialPageRoute(builder: (context)=> EmployeeDetails(getEmployeeSubordinates: getEmployeeSubordinatesList[index])),); - }, - icon: Icon( - Icons.arrow_forward_outlined, - color: Colors.grey, - ), - ), - - - ], - ), - ], - ), - ); - }) + ).objectContainerView(); + }) ], ), - ) + ), ) ], ), - ) - ); + )); } - Widget dropDown(){ + Widget dropDown() { return DropdownButton( value: dropdownValue, - icon: const Icon(Icons.keyboard_arrow_down), + icon: const Icon(Icons.keyboard_arrow_down, + color: MyColors.grey57Color), elevation: 16, onChanged: (String? newValue) { setState(() { dropdownValue = newValue!; }); }, - items: ['Name', 'Email'] - .map>((String value) { + items: ['Name', 'Email'].map>((String value) { return DropdownMenuItem( value: value, child: Text(value), ); }).toList(), + style: TextStyle(fontSize: 14.0, color: MyColors.grey57Color, fontWeight: FontWeight.w600), ); } - } - diff --git a/lib/ui/my_team/profile_details.dart b/lib/ui/my_team/profile_details.dart index 49690f0..419f897 100644 --- a/lib/ui/my_team/profile_details.dart +++ b/lib/ui/my_team/profile_details.dart @@ -2,6 +2,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; @@ -33,7 +34,7 @@ class _ProfileDetailsState extends State { return Scaffold( appBar: AppBarWidget( context, - title: "Profile Details", + title: LocaleKeys.profileDetails.tr(), ), backgroundColor: MyColors.backgroundColor, body: Column( @@ -41,12 +42,11 @@ class _ProfileDetailsState extends State { Container( width: double.infinity, margin: EdgeInsets.only( - top: 28, - left: 26, - right: 26, + top: 20, + left: 21, + right: 21, ), padding: EdgeInsets.only(left: 14, right: 14, top: 13, bottom: 20), - height: 350, decoration: BoxDecoration( boxShadow: [ BoxShadow( @@ -61,27 +61,19 @@ class _ProfileDetailsState extends State { ), child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ LocaleKeys.category.tr().toText13(color: MyColors.lightGrayColor), - "${getEmployeeSubordinates?.eMPLOYMENTCATEGORYMEANING}".toText16(isBold: true, color: MyColors.blackColor), - SizedBox( - height: 20, - ), + "${getEmployeeSubordinates?.eMPLOYMENTCATEGORYMEANING}".toText16(isBold: true, color: MyColors.darkTextColor), + 23.height, LocaleKeys.address.tr().toText13(color: MyColors.lightGrayColor), - "${getEmployeeSubordinates?.lOCATIONNAME}".toText16(isBold: true, color: MyColors.blackColor), - SizedBox( - height: 20, - ), + "${getEmployeeSubordinates?.lOCATIONNAME}".toText16(isBold: true, color: MyColors.darkTextColor), + 23.height, LocaleKeys.phoneNumber.tr().toText13(color: MyColors.lightGrayColor), - "${getEmployeeSubordinates?.eMPLOYEEMOBILENUMBER}".toText16(isBold: true, color: MyColors.blackColor), - SizedBox( - height: 20, - ), + "${getEmployeeSubordinates?.eMPLOYEEMOBILENUMBER}".toText16(isBold: true, color: MyColors.darkTextColor), + 23.height, LocaleKeys.businessGroup.tr().toText13(color: MyColors.lightGrayColor), - "${getEmployeeSubordinates?.bUSINESSGROUPNAME}".toText16(isBold: true, color: MyColors.blackColor), - SizedBox( - height: 20, - ), + "${getEmployeeSubordinates?.bUSINESSGROUPNAME}".toText16(isBold: true, color: MyColors.darkTextColor), + 23.height, LocaleKeys.Payroll.tr().toText13(color: MyColors.lightGrayColor), - "${getEmployeeSubordinates?.pAYROLLNAME}".toText16(isBold: true, color: MyColors.blackColor), + "${getEmployeeSubordinates?.pAYROLLNAME}".toText16(isBold: true, color: MyColors.darkTextColor), ]), ), ], diff --git a/lib/ui/my_team/team_members.dart b/lib/ui/my_team/team_members.dart index 7dccf5e..f36a13b 100644 --- a/lib/ui/my_team/team_members.dart +++ b/lib/ui/my_team/team_members.dart @@ -1,9 +1,13 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:mohem_flutter_app/api/my_team/my_team_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'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/models/my_team/get_employee_subordinates_list.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -26,8 +30,6 @@ class _TeamMembersState extends State { void initState() { super.initState(); employeeSubordinates(); - setState(() {}); - } void employeeSubordinates() async { @@ -49,108 +51,58 @@ class _TeamMembersState extends State { return Scaffold( appBar: AppBarWidget( context, - title: "Team Members", + title: LocaleKeys.teamMembers.tr(), ), backgroundColor: MyColors.backgroundColor, body: SingleChildScrollView( - child: Column( - children: [ - Container( - width: MediaQuery.of(context).size.width, - child: SingleChildScrollView( - scrollDirection: Axis.vertical, - child: Column( - children: [ - if(getEmployeeSubordinatesList != 0) - ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: getEmployeeSubordinatesList.length, - itemBuilder: (context, index) { - var phoneNumber = Uri.parse('tel:${getEmployeeSubordinatesList[index].eMPLOYEENUMBER}'); - return Container( - width: double.infinity, - margin: EdgeInsets.only( - top: 18, - left: 18, - right: 18, - ), - padding: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10), - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 5, - blurRadius: 26, - offset: Offset(0, 3), - ), - ], - color: Colors.white, - borderRadius: BorderRadius.circular(10.0), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Column( - children: [ - CircleAvatar( - radius: 25, - backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSubordinatesList[index].eMPLOYEEIMAGE)), - backgroundColor: Colors.black, - ), - // MyTeamImage() - ], - ), - SizedBox( - width: 10, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - "Present".toText13(color: MyColors.greenColor), - "${getEmployeeSubordinatesList[index].eMPLOYEENAME}".toText16(color: MyColors.blackColor), - "${getEmployeeSubordinatesList[index].pOSITIONNAME}".toText13(color: MyColors.blackColor), - ], - ), - ], - ), - Column( - children: [ - IconButton( - onPressed: () { - launchUrl(phoneNumber); - }, - icon: Icon( - Icons.whatsapp, - color: Colors.green, - ), - ), - ], - ), - ], - ), - ); - }), - Container( - margin: EdgeInsets.only(top:30), - child: "No Members".toText16(isBold: true, color: MyColors.black), - ) - ], - ), - ) - // SizedBox(height: 20), - ) - ], - ), - )); + scrollDirection: Axis.vertical, + child: Column( + children: [ + getEmployeeSubordinatesList != 0 + ? ListView.separated( + scrollDirection: Axis.vertical, + shrinkWrap: true, + padding: EdgeInsets.all(21), + physics: ScrollPhysics(), + separatorBuilder: (cxt, index) => 12.height, + itemCount: getEmployeeSubordinatesList.length, + itemBuilder: (context, index) { + var phoneNumber = Uri.parse('tel:${getEmployeeSubordinatesList[index].eMPLOYEEMOBILENUMBER}'); + return Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + CircleAvatar( + radius: 25, + backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSubordinatesList[index].eMPLOYEEIMAGE)), + backgroundColor: Colors.black, + ), + SizedBox(width: 10,), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // "Present".toText13(color: MyColors.greenColor), + "${getEmployeeSubordinatesList[index].eMPLOYEENAME}".toText16(isBold: true, color: MyColors.grey3AColor), + "${getEmployeeSubordinatesList[index].pOSITIONNAME}".toText10(isBold: true, color: MyColors.grey57Color), + ], + ).expanded, + Column( + children: [ + IconButton( + onPressed: () { + launchUrl(phoneNumber); + }, + icon: Icon( + Icons.whatsapp, + color: Colors.green, + ),),], + ),], + ),).objectContainerView(); + }): Container( + child: LocaleKeys.noResultsFound.tr().toText16(color: MyColors.blackColor), + ).paddingOnly(top: 10), + ], + ) + )); } - - Widget MyTeamImage() => CircleAvatar( - radius: 30, - //backgroundImage: MemoryImage(Utils.getPostBytes(memberInformationList.eMPLOYEEIMAGE)), - backgroundColor: Colors.black, - ); } diff --git a/lib/ui/my_team/view_attendance.dart b/lib/ui/my_team/view_attendance.dart index f08ca3b..b24a895 100644 --- a/lib/ui/my_team/view_attendance.dart +++ b/lib/ui/my_team/view_attendance.dart @@ -91,7 +91,7 @@ class _ViewAttendanceState extends State { return Scaffold( appBar: AppBarWidget( context, - title: "View Attendance", + title: LocaleKeys.viewAttendance.tr(), ), backgroundColor: MyColors.backgroundColor, body: SingleChildScrollView( @@ -99,11 +99,11 @@ class _ViewAttendanceState extends State { Container( width: double.infinity, margin: EdgeInsets.only( - top: 28, - left: 18, - right: 18, + top: 21, + left: 21, + right: 21, ), - padding: EdgeInsets.only(left: 16, right: 16, top: 16, bottom: 16), + padding: EdgeInsets.only(left: 14, right: 14, top: 15, bottom: 15), // height: 120, decoration: BoxDecoration( boxShadow: [ @@ -120,7 +120,7 @@ class _ViewAttendanceState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "Today's Attendance".toText20(color: MyColors.blackColor), + LocaleKeys.todayAttendance.tr().toText16(isBold: true, color: MyColors.darkColor), SizedBox( height: 10, ), @@ -129,20 +129,20 @@ class _ViewAttendanceState extends State { children: [ Column( children: [ - LocaleKeys.checkIn.tr().toText12(isBold: true, color: MyColors.greenColor), - "${(attendanceTracking?.pSwipeIn)?? "- - : - -"}".toText16(isBold: true, color: MyColors.grey57Color), + LocaleKeys.checkIn.tr().toText10(isBold: true, color: MyColors.green69Color), + "${(attendanceTracking?.pSwipeIn)?? "- - : - -"}".toText14(isBold: true, color: MyColors.grey57Color), ], ), Column( children: [ - LocaleKeys.checkOut.tr().toText12(isBold: true, color: MyColors.redColor), - "${(attendanceTracking?.pSwipeOut)?? "- - : - -"}".toText16(isBold: true, color: MyColors.grey57Color), + LocaleKeys.checkOut.tr().toText10(isBold: true, color: MyColors.redA3Color), + "${(attendanceTracking?.pSwipeOut)?? "- - : - -"}".toText14(isBold: true, color: MyColors.grey57Color), ], ), Column( children: [ - LocaleKeys.lateIn.tr().toText12(isBold: true, color: MyColors.blackColor), - "${(attendanceTracking?.pLateInHours)?? "- - : - -"}".toText16(isBold: true, color: MyColors.grey57Color), + LocaleKeys.lateIn.tr().toText10(isBold: true, color: MyColors.darkGreyColor), + "${(attendanceTracking?.pLateInHours)?? "- - : - -"}".toText14(isBold: true, color: MyColors.grey57Color), ], ), ], @@ -179,8 +179,8 @@ class _ViewAttendanceState extends State { children: [ Row( children: [ - "${DateFormat("MMMM-yyyy").format(formattedDate)}".toText16(color: MyColors.blackColor), - const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.blackColor), + "${DateFormat("MMMM-yyyy").format(formattedDate)}".toText16(color: MyColors.grey3AColor), + const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.grey3AColor), ], ).onPress(() async { showMonthPicker( @@ -438,10 +438,6 @@ class _ViewAttendanceState extends State { ), ), ); - // return Container( - // alignment: Alignment.center, - // child: Text("$val"), - // ); } else { return const SizedBox(); } diff --git a/lib/ui/profile/add_update_family_member.dart b/lib/ui/profile/add_update_family_member.dart index 9a0bd66..107f289 100644 --- a/lib/ui/profile/add_update_family_member.dart +++ b/lib/ui/profile/add_update_family_member.dart @@ -19,6 +19,7 @@ import 'package:mohem_flutter_app/ui/misc/request_submit_screen.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'dart:io'; import 'package:flutter/cupertino.dart'; +import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart'; import 'package:easy_localization/src/public_ext.dart'; @@ -37,13 +38,12 @@ class _AddUpdateFamilyMemberState extends State { SubmitContactTransactionList? submitContactTransactionList; dynamic args; String? date = "MM/DD/YYYY"; - // String actionType = "UPDATE"; + GetApprovesList? getApprovesList; @override void initState() { - // super.initState(); } @@ -89,15 +89,12 @@ class _AddUpdateFamilyMemberState extends State { Widget build(BuildContext context) { if (args == null) { args = ModalRoute.of(context)!.settings.arguments; - callAddAndUpdateFamilyMember(); - } + callAddAndUpdateFamilyMember();} return Scaffold( appBar: AppBarWidget( context, - title: LocaleKeys.profile_familyDetails.tr(), - ), + title: LocaleKeys.profile_familyDetails.tr(),), backgroundColor: MyColors.backgroundColor, - bottomSheet: footer(), body: args['flag'] == 1 ? Column( children: [ @@ -128,9 +125,11 @@ class _AddUpdateFamilyMemberState extends State { separatorBuilder: (cxt, index) => 0.height, itemCount: getContactDffStructureList!.length), ]).expanded, - SizedBox( - height: 50, - ), + DefaultButton( + LocaleKeys.next.tr(), () async { + submitUpdateForm(); + } + ).insideContainer, ], ) : args['flag'] == 2 @@ -165,9 +164,11 @@ class _AddUpdateFamilyMemberState extends State { separatorBuilder: (cxt, index) => 0.height, itemCount: getContactDffStructureList!.length), ]).expanded, - SizedBox( - height: 50, - ), + DefaultButton( + LocaleKeys.next.tr(), () async { + submitUpdateForm(); + } + ).insideContainer, ], ) : Container(), @@ -405,7 +406,6 @@ class _AddUpdateFamilyMemberState extends State { return ValidateEitTransactionModel(dATEVALUE: dateVal, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: numberVal, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: vatcherVal.toString()).toJson(); }).toList(); List> values2 = getContactDffStructureList!.map((e) { - //String tempVar = e!.getContactDetailsList!.vARCHAR2VALUE ?? ""; String? dateVal = ''; String? vatcherVal = ''; int? numberVal; diff --git a/lib/ui/profile/basic_details.dart b/lib/ui/profile/basic_details.dart index eae5c3d..35f2071 100644 --- a/lib/ui/profile/basic_details.dart +++ b/lib/ui/profile/basic_details.dart @@ -6,6 +6,7 @@ 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/string_extensions.dart'; +import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart'; import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; @@ -43,7 +44,6 @@ class _BasicDetailsState extends State { menuEntries = menuData.where((e) => e.requestType == 'BASIC_DETAILS').toList()[0]; getEmployeeBasicDetails(); - basicDetails(); } void getEmployeeBasicDetails() async { @@ -51,7 +51,6 @@ class _BasicDetailsState extends State { Utils.showLoading(context); getEmployeeBasicDetailsList = await ProfileApiClient().getEmployeeBasicDetails(); Utils.hideLoading(context); - basicDetails(); setState(() {}); } catch (ex) { Utils.hideLoading(context); @@ -59,23 +58,6 @@ class _BasicDetailsState extends State { } } - void basicDetails() { - for (int i = 0; i < getEmployeeBasicDetailsList.length; i++) { - if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'FULL_NAME') { - fullName = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; - } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'MARITAL_STATUS') { - maritalStatus = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; - } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'DATE_OF_BIRTH') { - birthDate = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; - } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'NATIONAL_IDENTIFIER') { - civilIdentityNumber = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; - } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'EMAIL_ADDRESS') { - emailAddress = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; - } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'EMPLOYEE_NUMBER') { - employeeNo = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; - } - } - } Widget build(BuildContext context) { return Scaffold( @@ -84,69 +66,54 @@ class _BasicDetailsState extends State { title: LocaleKeys.profile_basicDetails.tr(), ), backgroundColor: MyColors.backgroundColor, - bottomSheet: footer(), body: Column( children: [ - Container( - width: double.infinity, - margin: EdgeInsets.only(top: 20, left: 21, right: 21, bottom: 20), - padding: EdgeInsets.only(left: 14, right: 14, top: 13, bottom: 5), - height: 280, - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 5, - blurRadius: 26, - offset: Offset(0, 3), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 20, left: 21, right: 21, bottom: 20), + padding: EdgeInsets.only(left: 14, right: 14, top: 13, bottom: 5), + height: 300, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 5, + blurRadius: 26, + offset: Offset(0, 3), + ), + ], + color: Colors.white, + borderRadius: BorderRadius.circular(10.0), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: getEmployeeBasicDetailsList.map((e) => + Column( + children: [ + e.dISPLAYFLAG == "Y" ? Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + "${e.sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), + "${e.sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), + SizedBox(height: 12,) + ]): Container(), + ], + )).toList()), ), ], - color: Colors.white, - borderRadius: BorderRadius.circular(10.0), ), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - LocaleKeys.fullName.tr().toText13(color: MyColors.lightGrayColor), - "$fullName".toText16(isBold: true, color: MyColors.blackColor), - SizedBox( - height: 20, - ), - LocaleKeys.maritalStatus.tr().toText13(color: MyColors.lightGrayColor), - "$maritalStatus".toText16(isBold: true, color: MyColors.blackColor), - SizedBox( - height: 20, - ), - LocaleKeys.dateOfBirth.tr().toText13(color: MyColors.lightGrayColor), - "$birthDate".toText16(isBold: true, color: MyColors.blackColor), - SizedBox( - height: 20, - ), - LocaleKeys.civilIdentityNumber.tr().toText13(color: MyColors.lightGrayColor), - "$civilIdentityNumber".toText16(isBold: true, color: MyColors.blackColor), - ]), ), + DefaultButton( + LocaleKeys.update.tr(), + menuEntries.updateButton == 'Y' ? () async { + showAlertDialog(context);} + : null).insideContainer, ], )); } - Widget footer() { - return Container( - decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(10), - color: MyColors.white, - boxShadow: [ - BoxShadow(color: MyColors.lightGreyEFColor, spreadRadius: 3), - ], - ), - child: DefaultButton( - LocaleKeys.update.tr(), - menuEntries.updateButton == 'Y' - ? () async { - showAlertDialog(context); - } - : null) - .insideContainer, - ); - } void showAlertDialog(BuildContext context) { Widget cancelButton = TextButton( diff --git a/lib/ui/profile/contact_details.dart b/lib/ui/profile/contact_details.dart index c0af0c5..9eda586 100644 --- a/lib/ui/profile/contact_details.dart +++ b/lib/ui/profile/contact_details.dart @@ -134,7 +134,7 @@ class _ContactDetailsState extends State { ])) .toList()) ])), - Container( + Container( width: double.infinity, margin: EdgeInsets.only( top: 20, diff --git a/lib/ui/profile/delete_family_member.dart b/lib/ui/profile/delete_family_member.dart index 58ec825..ab4e1d2 100644 --- a/lib/ui/profile/delete_family_member.dart +++ b/lib/ui/profile/delete_family_member.dart @@ -12,6 +12,7 @@ import 'package:mohem_flutter_app/ui/misc/request_submit_screen.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'dart:io'; import 'package:flutter/cupertino.dart'; +import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart'; class DeleteFamilyMember extends StatefulWidget { @@ -66,25 +67,29 @@ class _DeleteFamilyMemberState extends State { title: LocaleKeys.profile_familyDetails.tr(), ), backgroundColor: MyColors.backgroundColor, - bottomSheet: footer(), body: Column( children: [ - DynamicTextFieldWidget( - LocaleKeys.endDate.tr(), date.toString(), - // suffixIconData: Icons.calendar_today, - isEnable: false, - onTap: () async { - DateTime dateValue = await _selectDate(context); - // DateTime date1 = DateTime(dateValue.year, dateValue.month, dateValue.day); - date = DateFormat('yyyy/MM/dd').format(dateValue); - datePar = DateFormat('yyyy/MM/dd hh:mm:ss').format(dateValue); - setState(() {}); - // if (date !=null) { - // print(datePar); - // deleteFamilyMember(datePar); - // } - }, - ).paddingOnly(bottom: 12) + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + DynamicTextFieldWidget( + LocaleKeys.endDate.tr(), date.toString(), + isEnable: false, + onTap: () async { + DateTime dateValue = await _selectDate(context); + date = DateFormat('yyyy/MM/dd').format(dateValue); + datePar = DateFormat('yyyy/MM/dd hh:mm:ss').format(dateValue); + setState(() {}); + }, + ).paddingOnly(bottom: 12), + ], + ), + ), + DefaultButton( + LocaleKeys.next.tr(), () async { + deleteFamilyMember(datePar);} + ).insideContainer, ], )); } diff --git a/lib/ui/profile/family_members.dart b/lib/ui/profile/family_members.dart index 6b30347..3aef900 100644 --- a/lib/ui/profile/family_members.dart +++ b/lib/ui/profile/family_members.dart @@ -34,7 +34,6 @@ class _FamilyMembersState extends State { super.initState(); List menuData = Provider.of(context, listen: false).getMenuEntriesList!; menuEntries = menuData.where((GetMenuEntriesList e) => e.requestType == 'CONTACT').toList()[0]; - setState(() {}); getEmployeeContacts(); } @@ -57,196 +56,164 @@ class _FamilyMembersState extends State { title: LocaleKeys.profile_familyDetails.tr(), ), backgroundColor: MyColors.backgroundColor, - bottomSheet: footer(), - body: Container( - width: MediaQuery.of(context).size.width, - child: getEmployeeContactsList.length != 0 - ? SingleChildScrollView( - scrollDirection: Axis.vertical, - child: Column( - children: [ - ListView.builder( + body: Column( + children: [ + Expanded( + child: getEmployeeContactsList.length != 0 + ? SingleChildScrollView( + scrollDirection: Axis.vertical, + child: ListView.builder( scrollDirection: Axis.vertical, shrinkWrap: true, physics: ScrollPhysics(), itemCount: getEmployeeContactsList.length, itemBuilder: (context, index) { - return Container( - child: Column( - children: [ - Container( - width: double.infinity, - margin: EdgeInsets.only( - top: 20, - left: 21, - right: 21, + return Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 20, + left: 21, + right: 21, + ), + padding: EdgeInsets.only( + left: 14, + right: 14, + top: 13, + ), + height: 110, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 5, + blurRadius: 26, + offset: Offset(0, 3), ), - padding: EdgeInsets.only( - left: 14, - right: 14, - top: 13, - ), - height: 110, - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 5, - blurRadius: 26, - offset: Offset(0, 3), - ), - ], - color: Colors.white, - borderRadius: BorderRadius.circular(10.0), - ), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - "${getEmployeeContactsList[index].cONTACTNAME}".toText16(color: MyColors.blackColor), - "${getEmployeeContactsList[index].rELATIONSHIP}".toText11(isBold: true, color: MyColors.textMixColor), - SizedBox( - height: 5, - ), - Divider( - color: MyColors.lightGreyEFColor, - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Container( - child: menuEntries.updateButton == 'Y' - ? InkWell( - onTap: () async{ - relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID!.toInt(); - showUpdateAlertDialog(context, relationId!.toInt(), 2, LocaleKeys.update.tr()); - }, - child: RichText( - text: TextSpan( - children: [ - WidgetSpan( - child: Icon( - Icons.edit, - size: 15, - color: MyColors.grey67Color, - ), - ), - TextSpan( - text: LocaleKeys.update.tr(), - style: TextStyle( - color: MyColors.grey67Color, - fontSize: 12, - fontWeight: FontWeight.bold, - ), - ), - ], + ], + color: MyColors.whiteColor, + borderRadius: BorderRadius.circular(10.0), + ), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + "${getEmployeeContactsList[index].cONTACTNAME}".toText16(isBold: true, color: MyColors.grey3AColor), + "${getEmployeeContactsList[index].rELATIONSHIP}".toText11(isBold: true, color: MyColors.textMixColor), + SizedBox( + height: 5, + ), + Divider( + color: MyColors.lightGreyEFColor, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container( + child: menuEntries.updateButton == 'Y' + ? InkWell( + onTap: () async{ + relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID!.toInt(); + showUpdateAlertDialog(context, relationId!.toInt(), 2, LocaleKeys.update.tr()); + }, + child: RichText( + text: TextSpan( + children: [ + WidgetSpan( + child: Icon( + Icons.edit, + size: 15, + color: MyColors.grey67Color, + ), ), - ), - ) - : RichText( - text: TextSpan( - children: [ - WidgetSpan( - child: Icon( - Icons.edit, - size: 15, - color: MyColors.lightGreyColor, - ), - ), - TextSpan( - text: LocaleKeys.update.tr(), - style: TextStyle( - color: MyColors.lightGreyColor, - fontSize: 12, - fontWeight: FontWeight.bold, - ), - ), - ], + TextSpan( + text: LocaleKeys.update.tr(), + style: TextStyle( + color: MyColors.grey67Color, + fontSize: 12, + fontWeight: FontWeight.bold, ), - ) ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: SizedBox( - child: Container( - width: 3, - color: MyColors.lightGreyEFColor, ), - ), + ], ), - Container( - child: InkWell( - onTap: () { - relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID!.toInt(); - showRemoveAlertDialog(context, relationId!.toInt()); - }, - child: RichText( - text: TextSpan( - children: [ - WidgetSpan( - child: Icon( - Icons.delete, - size: 15, - color: Color(0x99FF0000), - ), + ), + ) + : RichText( + text: TextSpan( + children: [ + WidgetSpan( + child: Icon( + Icons.edit, + size: 15, + color: MyColors.lightGreyColor, ), - TextSpan( - text: LocaleKeys.remove.tr(), - style: TextStyle( - color: MyColors.DarkRedColor, - fontSize: 12, - fontWeight: FontWeight.bold, - ), + ), + TextSpan( + text: LocaleKeys.update.tr(), + style: TextStyle( + color: MyColors.lightGreyColor, + fontSize: 12, + fontWeight: FontWeight.bold, ), - ], - ), + ), + ], ), - )), - // ElevatedButton.icon( - // icon: Icon( - // Icons.delete, - // size: 15, - // color: Color(0x99FF0000), - // ), - // style: ElevatedButton.styleFrom( - // shadowColor: Colors.white, - // primary: Colors.white, - // ), - // label: "remove".toText12(color: MyColors.DarkRedColor), - // onPressed: (){}, - // ), - ], + ) ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: SizedBox( + child: Container( + width: 3, + color: MyColors.lightGreyEFColor, + ), + ), ), - ]), + Container( + child: InkWell( + onTap: () { + relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID!.toInt(); + showRemoveAlertDialog(context, relationId!.toInt()); + }, + child: RichText( + text: TextSpan( + children: [ + WidgetSpan( + child: Icon( + Icons.delete, + size: 15, + color: MyColors.redColor, + ), + ), + TextSpan( + text: LocaleKeys.remove.tr(), + style: TextStyle( + color: MyColors.redColor, + fontSize: 12, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ), + )), + ], ), - ], - )); - }) - ], - ), - ) - : Container(), - // SizedBox(height: 20), + ]), + ); + }), + ) + : Container(), + ), + DefaultButton( + LocaleKeys.addNewFamilyMember.tr(), () async { + Navigator.pushNamed(context, AppRoutes.addUpdateFamilyMember, arguments: {"relationID": relationId, "flag": 1, "actionType": "ADD"}); + ProfileScreen(); + } + ).insideContainer, + ], )); } - Widget footer() { - return Container( - decoration: BoxDecoration( - color: MyColors.white, - boxShadow: [ - BoxShadow(color: MyColors.lightGreyEFColor, spreadRadius: 3), - ], - ), - child: DefaultButton( - LocaleKeys.addNewFamilyMember.tr(), () async { - Navigator.pushNamed(context, AppRoutes.addUpdateFamilyMember, arguments: {"relationID": relationId, "flag": 1, "actionType": "ADD"}); - ProfileScreen(); - } - ) - .insideContainer, - ); - } void showUpdateAlertDialog(BuildContext context, int relationId, int flag, String actionType) { Widget cancelButton = TextButton( @@ -323,7 +290,5 @@ class _FamilyMembersState extends State { ); } - // void continueDynamicForms() { - // Navigator.pushNamed(context, AppRoutes.addDynamicInputProfile, arguments: DynamicFamilyMembersParams(LocaleKeys.profile_familyDetails.tr(), getEmployeeContactsList: getEmployeeContactsList)); - // } + } diff --git a/lib/ui/work_list/worklist_settings.dart b/lib/ui/work_list/worklist_settings.dart index 8c72d71..47771ee 100644 --- a/lib/ui/work_list/worklist_settings.dart +++ b/lib/ui/work_list/worklist_settings.dart @@ -2,7 +2,6 @@ import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_svg/svg.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'; @@ -10,7 +9,6 @@ import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; -import 'package:mohem_flutter_app/models/generic_response_model.dart'; import 'package:mohem_flutter_app/models/get_user_item_type_list.dart'; import 'package:mohem_flutter_app/models/update_user_item_type_list.dart'; import 'package:mohem_flutter_app/models/worklist/update_user_type_list.dart'; @@ -46,13 +44,11 @@ class _WorklistSettingsState extends State { } } - void updateUserItem() async { try { Utils.showLoading(context); List> itemList=[]; for (var element in getUserItemTypesList) { - itemList.add(UpdateUserTypesList(itemID: element.uSERITEMTYPEID, pITEMTYPE: element.iTEMTYPE,pFYAENABLEDFALG: element.fYAENABLEDFALG, pFYIENABLEDFALG: element.fYIENABLEDFLAG).toJson()); } @@ -66,86 +62,71 @@ class _WorklistSettingsState extends State { } } - - @override Widget build(BuildContext context) { return Scaffold(backgroundColor: Colors.white, appBar: AppBarWidget( context, - title: "Worklist Settings", + title: LocaleKeys.worklistSettings.tr(), ), - body:Container( - margin: const EdgeInsets.only(top: 21, left: 21, right: 21), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: "Turn on notifications for".tr().toText22(color: MyColors.blackColor), - ).paddingOnly(top: 10, bottom: 50), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - child: "Item Type".tr().toText14(color: MyColors.blackColor) , - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Container( - child: "FYA".tr().toText14(color: MyColors.blackColor) , - ), - Container( - child: "FYI".tr().toText14(color: MyColors.blackColor) , - ).paddingOnly(left: 30, right: 30), - ], - ) - ], - ), - Divider( - color: MyColors.greyA5Color, + body:Column( + children: [ + Expanded( + child: Container( + margin: const EdgeInsets.only(top: 21, left: 21, right: 21), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: LocaleKeys.TurnNotificationsFor.tr().toText22(color: MyColors.blackColor), + ).paddingOnly(top: 10, bottom: 50), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + child: LocaleKeys.itemType.tr().toText14(color: MyColors.blackColor) , + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Container( + child: "FYA".tr().toText14(color: MyColors.blackColor) , + ), + Container( + child: "FYI".tr().toText14(color: MyColors.blackColor) , + ).paddingOnly(left: 30, right: 30), + ], + ) + ], + ), + 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,), + ]); + } + ), + ), + ], + ), ), - Container( - width: MediaQuery.of(context).size.width, - child: 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 Container( - child: Column( - children:[ - - customSwitch(getUserItemTypesList[index]), - ] ), - ); - } - ), - ) - ), - SizedBox( - height: 30, - ), - Container( - decoration: BoxDecoration( - color: MyColors.white, - boxShadow: [ - BoxShadow(color: MyColors.lightGreyEFColor, spreadRadius: 3), + DefaultButton( + LocaleKeys.save.tr(), () async { + updateUserItem(); + }).insideContainer, ], - ), - child: DefaultButton( - LocaleKeys.submit.tr(), () async { - updateUserItem(); - } - ) - .insideContainer, - ), - ], - ), ) );