diff --git a/assets/images/files.svg b/assets/images/files.svg
new file mode 100644
index 0000000..dfc862e
--- /dev/null
+++ b/assets/images/files.svg
@@ -0,0 +1,14 @@
+
diff --git a/assets/images/gallery.svg b/assets/images/gallery.svg
new file mode 100644
index 0000000..ec1c45e
--- /dev/null
+++ b/assets/images/gallery.svg
@@ -0,0 +1,11 @@
+
diff --git a/assets/images/open_camera.svg b/assets/images/open_camera.svg
new file mode 100644
index 0000000..171452a
--- /dev/null
+++ b/assets/images/open_camera.svg
@@ -0,0 +1,7 @@
+
diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json
index 5fe5472..afdb821 100644
--- a/assets/langs/ar-SA.json
+++ b/assets/langs/ar-SA.json
@@ -387,6 +387,10 @@
"itemPrice": "سعر السلعة",
"itemPhotos": "صور البند",
"itemInfo": "معلومات العنصر",
+ "uploadAttachment": "تحميل المرفق",
+ "selectFromGalleryOrOpenCamera": "اختر من المعرض أو فتح الكاميرا",
+ "openCamera": "فتح\nآلة تصوير",
+ "uploadFromGallery": "تحميل من\nصالة عرض",
"profile": {
"reset_password": {
"label": "Reset Password",
diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json
index 5635c59..3527630 100644
--- a/assets/langs/en-US.json
+++ b/assets/langs/en-US.json
@@ -387,6 +387,10 @@
"itemPrice": "Item Price",
"itemPhotos": "Item Photos",
"itemInfo": "Item Info",
+ "uploadAttachment": "Upload Attachment",
+ "selectFromGalleryOrOpenCamera": "Select from gallery or open camera",
+ "openCamera": "Open\nCamera",
+ "uploadFromGallery": "Upload from\nGallery",
"profile": {
"reset_password": {
"label": "Reset Password",
diff --git a/lib/classes/colors.dart b/lib/classes/colors.dart
index 040d41c..c97a784 100644
--- a/lib/classes/colors.dart
+++ b/lib/classes/colors.dart
@@ -12,6 +12,7 @@ class MyColors {
static const Color grey57Color = Color(0xff575757);
static const Color grey67Color = Color(0xff676767);
static const Color grey77Color = Color(0xff777777);
+ static const Color greyF7Color = Color(0xffF7F7F7);
static const Color grey80Color = Color(0xff808080);
static const Color grey70Color = Color(0xff707070);
static const Color greyACColor = Color(0xffACACAC);
@@ -22,6 +23,7 @@ class MyColors {
static const Color lightGreyE3Color = Color(0xffE3E3E3);
static const Color lightGreyE6Color = Color(0xffE6E6E6);
static const Color lightGreyEAColor = Color(0xffEAEAEA);
+ static const Color lightGreyE5Color = Color(0xffE5E5E5);
static const Color darkWhiteColor = Color(0xffE0E0E0);
static const Color redColor = Color(0xffD02127);
static const Color yellowColor = Color(0xffF4E31C);
diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart
index 930c32c..556d011 100644
--- a/lib/extensions/string_extensions.dart
+++ b/lib/extensions/string_extensions.dart
@@ -21,11 +21,11 @@ extension EmailValidator on String {
style: TextStyle(fontSize: 10, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4),
);
- Widget toText11({Color? color, bool isUnderLine = false, bool isBold = false}) => Text(
+ Widget toText11({Color? color, FontWeight? weight, bool isUnderLine = false, bool isBold = false}) => Text(
this,
style: TextStyle(
fontSize: 11,
- fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
+ fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.w600),
color: color ?? MyColors.darkTextColor,
letterSpacing: -0.33,
decoration: isUnderLine ? TextDecoration.underline : null,
diff --git a/lib/extensions/widget_extensions.dart b/lib/extensions/widget_extensions.dart
index fc4d8f4..dc3bdb7 100644
--- a/lib/extensions/widget_extensions.dart
+++ b/lib/extensions/widget_extensions.dart
@@ -42,7 +42,7 @@ extension WidgetExtensions on Widget {
child: this,
);
- Widget objectContainerView({String title = "", String note = "", bool disablePadding = false,double radius =15}) {
+ Widget objectContainerView({String title = "", String note = "", bool disablePadding = false, double radius = 15}) {
return Container(
padding: disablePadding ? EdgeInsets.zero : const EdgeInsets.only(top: 15, bottom: 15, left: 14, right: 14),
decoration: BoxDecoration(
@@ -69,14 +69,14 @@ extension WidgetExtensions on Widget {
);
}
- Widget objectContainerBorderView({String title = "", String note = ""}) {
+ Widget objectContainerBorderView({String title = "", String note = "", bool disablePadding = false, double radius = 15, Color? color, Color borderColor = MyColors.lightGreyEFColor}) {
return Container(
- padding: const EdgeInsets.only(top: 15, bottom: 15, left: 14, right: 14),
- alignment: Alignment.center,
+ padding: disablePadding ? EdgeInsets.zero : const EdgeInsets.only(top: 15, bottom: 15, left: 14, right: 14),
decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(15),
+ borderRadius: BorderRadius.circular(radius),
+ color: color,
border: Border.all(
- color: MyColors.lightGreyEFColor,
+ color: borderColor,
width: 1,
),
),
diff --git a/lib/ui/my_team/employee_details.dart b/lib/ui/my_team/employee_details.dart
index c9d723c..629c236 100644
--- a/lib/ui/my_team/employee_details.dart
+++ b/lib/ui/my_team/employee_details.dart
@@ -1,11 +1,9 @@
-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';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart';
@@ -19,7 +17,6 @@ import 'package:mohem_flutter_app/models/my_team/get_employee_subordinates_list.
import 'package:mohem_flutter_app/models/profile_menu.model.dart';
import 'package:mohem_flutter_app/models/worklist/get_favorite_replacements_model.dart';
import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart';
-import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/widgets/circular_avatar.dart';
import 'package:url_launcher/url_launcher.dart';
@@ -28,13 +25,12 @@ class EmployeeDetails extends StatefulWidget {
@override
_EmployeeDetailsState createState() => _EmployeeDetailsState();
-
}
class _EmployeeDetailsState extends State {
GetEmployeeSubordinatesList? getEmployeeSubordinates;
static List menuData = [];
- List menu =[];
+ List menu = [];
String? selectedFavLetter;
List? favLetters;
List? favUsersList;
@@ -62,15 +58,13 @@ class _EmployeeDetailsState extends State {
setState(() {});
}
-
@override
Widget build(BuildContext context) {
- if(getEmployeeSubordinates == null) {
+ if (getEmployeeSubordinates == null) {
getEmployeeSubordinates = ModalRoute.of(context)?.settings.arguments as GetEmployeeSubordinatesList;
setMenu();
}
-
return Scaffold(
extendBody: true,
backgroundColor: MyColors.lightGreyEFColor,
@@ -118,108 +112,107 @@ class _EmployeeDetailsState extends State {
Widget myTeamInfo() {
Uri phoneNumber = Uri.parse('tel:${getEmployeeSubordinates?.eMPLOYEEMOBILENUMBER}');
- double _width = MediaQuery
- .of(context)
- .size
- .width;
+ double _width = MediaQuery.of(context).size.width;
return Column(
children: [
Stack(children: [
Container(
margin: EdgeInsets.fromLTRB(21, 40, 21, 0),
- child: Column(
+ child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
- onPressed: (){
- if(getEmployeeSubordinates!.isFavorite != true){
+ padding: EdgeInsets.zero,
+ constraints: const BoxConstraints(),
+ onPressed: () {
+ if (getEmployeeSubordinates!.isFavorite != true) {
showFavoriteAlertDialog(context);
setState(() {});
- }else{
+ } else {
fetchChangeFav(
email: getEmployeeSubordinates?.eMPLOYEEEMAILADDRESS ?? "",
employeName: getEmployeeSubordinates!.eMPLOYEENAME ?? "",
image: getEmployeeSubordinates!.eMPLOYEEIMAGE ?? "",
userName: getEmployeeSubordinates!.eMPLOYEENUMBER ?? "",
- isFav: false,);
+ isFav: false,
+ );
setState(() {});
- } },
- icon: getEmployeeSubordinates!.isFavorite != true
- ? Icon(
- Icons.star_outline,
- size: 35,
- color: MyColors.green9CColor,
- )
- : Icon(
- Icons.star_outlined,
+ }
+ },
+ icon: Icon(
+ getEmployeeSubordinates!.isFavorite != true ? Icons.star_outline : Icons.star_outlined,
size: 35,
color: MyColors.green9CColor,
),
),
getEmployeeSubordinates?.eMPLOYEEMOBILENUMBER == ""
- ? SvgPicture.asset("assets/images/call-disable.svg", height: 25, width: 25,).paddingOnly(left:6, right: 17)
- : InkWell(
- onTap:() {
- launchUrl(phoneNumber);
- },
- child: SvgPicture.asset("assets/images/call.svg", height: 25, width: 25,).paddingOnly(left:6, right: 17),
- ),
+ ? SvgPicture.asset(
+ "assets/images/call-disable.svg",
+ height: 25,
+ width: 25,
+ )
+ : InkWell(
+ onTap: () {
+ launchUrl(phoneNumber);
+ },
+ child: SvgPicture.asset(
+ "assets/images/call.svg",
+ height: 25,
+ width: 25,
+ ),
+ ),
],
),
- getEmployeeSubordinates!.eMPLOYEENAME!.toText21(maxlines: 2),
- ("${getEmployeeSubordinates!.eMPLOYEENUMBER!} | ${getEmployeeSubordinates!.jOBNAME!}").toText13(color: MyColors.grey80Color),
- getEmployeeSubordinates!.eMPLOYEEEMAILADDRESS!.toText13(),
+ getEmployeeSubordinates!.eMPLOYEENAME!.toText21(maxlines: 2),
+ ("${getEmployeeSubordinates!.eMPLOYEENUMBER!} | ${getEmployeeSubordinates!.jOBNAME!}").toText13(color: MyColors.grey80Color),
+ getEmployeeSubordinates!.eMPLOYEEEMAILADDRESS!.toText13(),
],
- ).objectContainerView(),
- ),
- Container(
- height: 68, alignment: Alignment.center, child: ProfileImage()).paddingOnly(top: 10),
- ]),
- 12.height,
- Container(
- margin: EdgeInsets.fromLTRB(21, 0, 21, 0),
- child: Column(
- children: menu.map((ProfileMenu i) => rowItem(i, context)).toList(),
- ).objectContainerView(),
+ ).paddingOnly(top: 16, bottom: 12, right: 14, left: 14).objectContainerView(radius: 10, disablePadding: true),
),
- // ),
+ Container(height: 68, alignment: Alignment.center, child: ProfileImage()).paddingOnly(top: 10),
+ ]),
+ 12.height,
+ ListView.separated(
+ padding: EdgeInsets.only(bottom: 21),
+ shrinkWrap: true,
+ physics: const NeverScrollableScrollPhysics(),
+ itemBuilder: (cxt, index) => Row(
+ children: [
+ SvgPicture.asset('assets/images/' + menu[index].icon, width: 20, height: 20),
+ 16.width,
+ menu[index].name.toText16().expanded,
+ 16.width,
+ const Icon(Icons.arrow_forward, color: MyColors.darkIconColor)
+ ],
+ ).onPress(() {
+ Navigator.pushNamed(context, menu[index].route, arguments: menu[index].arguments);
+ }).paddingOnly(left: 21, right: 21, top: 21),
+ separatorBuilder: (cxt, index) => 12.height,
+ itemCount: menu.length)
+ .objectContainerView(disablePadding: true, radius: 10)
+ .paddingOnly(left: 21, right: 21),
],
);
}
- Widget ProfileImage() =>
- getEmployeeSubordinates?.eMPLOYEEIMAGE == null
- ? SvgPicture.asset("assets/images/user.svg",height: 68, width: 68, )
+ Widget ProfileImage() => getEmployeeSubordinates?.eMPLOYEEIMAGE == null
+ ? SvgPicture.asset(
+ "assets/images/user.svg",
+ height: 68,
+ width: 68,
+ )
: CircleAvatar(
- radius: 70,
- backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSubordinates?.eMPLOYEEIMAGE)),
- backgroundColor: Colors.black,
- );
-
-
- Widget rowItem(obj, context) {
- return InkWell(
- onTap: () {
-
- Navigator.pushNamed(context, obj.route, arguments:obj.arguments);
+ radius: 68,
+ backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSubordinates?.eMPLOYEEIMAGE)),
+ backgroundColor: Colors.black,
+ );
- },
- child: ListTile(
- leading: SvgPicture.asset('assets/images/' + obj.icon),
- title: Text(obj.name,
- style: TextStyle(color: MyColors.grey3AColor,
- fontSize: 16)),
- trailing: Icon(Icons.arrow_forward,
- color: MyColors.grey3AColor,),
- ),
- );
- }
- void setMenu(){
+ void setMenu() {
menu = [
- ProfileMenu(name: LocaleKeys.profileDetails.tr(), icon: "profile_details.svg", route: AppRoutes.profileDetails, arguments:getEmployeeSubordinates),
- ProfileMenu(name: LocaleKeys.createRequest.tr(), icon: "create_request.svg", route: AppRoutes.createRequest,arguments: getEmployeeSubordinates),
+ ProfileMenu(name: LocaleKeys.profileDetails.tr(), icon: "profile_details.svg", route: AppRoutes.profileDetails, arguments: getEmployeeSubordinates),
+ ProfileMenu(name: LocaleKeys.createRequest.tr(), icon: "create_request.svg", route: AppRoutes.createRequest, arguments: getEmployeeSubordinates),
ProfileMenu(name: LocaleKeys.viewAttendance.tr(), icon: "view_attendance.svg", route: AppRoutes.viewAttendance, arguments: getEmployeeSubordinates),
ProfileMenu(name: LocaleKeys.teamMembers.tr(), icon: "team.svg", route: AppRoutes.teamMembers, arguments: getEmployeeSubordinates),
];
@@ -239,15 +232,15 @@ class _EmployeeDetailsState extends State {
LocaleKeys.ok.tr(),
),
onPressed: () {
- fetchChangeFav(
+ fetchChangeFav(
email: getEmployeeSubordinates?.eMPLOYEEEMAILADDRESS ?? "",
employeName: getEmployeeSubordinates!.eMPLOYEENAME ?? "",
image: getEmployeeSubordinates!.eMPLOYEEIMAGE ?? "",
userName: getEmployeeSubordinates!.eMPLOYEENUMBER ?? "",
isFav: true,
);
- setState(() {});
- Navigator.pop(context);
+ setState(() {});
+ Navigator.pop(context);
},
);
AlertDialog alert = AlertDialog(
@@ -265,7 +258,7 @@ class _EmployeeDetailsState extends State {
width: 50,
isImageBase64: true,
).paddingOnly(top: 21),
- // 16.width,
+ // 16.width,
],
),
),
@@ -283,15 +276,11 @@ class _EmployeeDetailsState extends State {
}
}
- GetMenuEntriesList getMenuEntries(String type) {
- List data = _EmployeeDetailsState.menuData.where((GetMenuEntriesList test) => test.functionName == type).toList();
- if (data.isNotEmpty) {
- return data[0];
- } else {
- return GetMenuEntriesList();
- }
-
-
+GetMenuEntriesList getMenuEntries(String type) {
+ List data = _EmployeeDetailsState.menuData.where((GetMenuEntriesList test) => test.functionName == type).toList();
+ if (data.isNotEmpty) {
+ return data[0];
+ } else {
+ return GetMenuEntriesList();
+ }
}
-
-
diff --git a/lib/ui/my_team/my_team.dart b/lib/ui/my_team/my_team.dart
index 4639741..0e3aaf5 100644
--- a/lib/ui/my_team/my_team.dart
+++ b/lib/ui/my_team/my_team.dart
@@ -29,10 +29,13 @@ class _MyTeamState extends State {
TextEditingController? _textEditingController = TextEditingController();
List getEmployeeSListOnSearch = [];
- String dropdownValue = 'Name';
+ String dropdownValue = '';
+
+ int index = 0;
void initState() {
super.initState();
+ dropdownValue = list[index];
getEmployeeSubordinates();
}
@@ -52,155 +55,153 @@ class _MyTeamState extends State {
@override
Widget build(BuildContext context) {
return Scaffold(
- appBar: AppBarWidget(
- context,
- title: LocaleKeys.myTeamMembers.tr(),
- showMemberButton: true,
- ),
- backgroundColor: MyColors.backgroundColor,
- body: SingleChildScrollView(
- child: Column(
+ appBar: AppBarWidget(
+ context,
+ title: LocaleKeys.myTeamMembers.tr(),
+ showMemberButton: true,
+ ),
+ backgroundColor: MyColors.backgroundColor,
+ body: ListView(
+ padding: const EdgeInsets.all(21),
+ children: [
+ Row(
children: [
- Container(
- margin: EdgeInsets.only(left: 21, right: 21, top: 20, bottom: 6),
- padding: EdgeInsets.only(left: 14, right: 14, top: 21, bottom: 21),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(15),
- color: Color(0xffFFFFFF),
- border: Border.all(
- color: Color(0xffefefef),
- width: 1,
- ),
- ),
- child: Row(
- 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(() {});
- },
- 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.grey3AColor),
- ),
- )),
- Container(
- height: 36,
- width: 1,
- color: Color(0xffC4C4C4),
- ),
- 10.width,
- dropDown(),
- ],
+ 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(() {});
+ },
+ style: const TextStyle(
+ fontSize: 14.0,
+ color: MyColors.grey3AColor,
+ fontWeight: FontWeight.w600,
+ letterSpacing: -0.56,
),
- ),
- 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
- ? Utils.getNoDataWidget(context)
- : ListView.separated(
- scrollDirection: Axis.vertical,
- shrinkWrap: true,
- 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 InkWell(
- onTap: () async {
- Navigator.pushNamed(context, AppRoutes.employeeDetails, arguments: getEmployeeSListOnSearch[index]);
- },
- child: Row(
- //mainAxisAlignment: MainAxisAlignment.spaceBetween,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- getEmployeeSListOnSearch[index].eMPLOYEEIMAGE == null
- ? SvgPicture.asset("assets/images/user.svg",height: 34, width: 34, ).paddingOnly(top: 4)
- : Container(
- height: 34,
- width: 34,
- child: CircleAvatar(
- radius: 25,
- backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSListOnSearch[index].eMPLOYEEIMAGE)),
- backgroundColor: Colors.black,
- ).paddingOnly(top: 4),
- ),
- 9.width,
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- // "Present".toText13(color: MyColors.greenColor),
- "${getEmployeeSListOnSearch[index].eMPLOYEENAME}".toText16(color: MyColors.grey3AColor),
- "${getEmployeeSListOnSearch[index].pOSITIONNAME}".toText10(color: MyColors.grey57Color),
- ],
- ).expanded,
- Column(
- crossAxisAlignment: CrossAxisAlignment.end,
- children: [
- getEmployeeSListOnSearch[index].eMPLOYEEMOBILENUMBER == ""
- ? SvgPicture.asset("assets/images/call-disable.svg", width: 22, height: 22).paddingOnly(bottom: 23)
- : InkWell(
- onTap: () {
- launchUrl(phoneNumber);
- },
- child: SvgPicture.asset("assets/images/call.svg", width: 22, height: 22).paddingOnly(bottom: 23),
- ),
- // 21.height,
- Icon(Icons.arrow_forward_outlined, color: MyColors.grey3AColor),
- ],
- ).expanded,
- ],
- ).objectContainerView(),
- );
- })
- ],
+ controller: _textEditingController,
+ decoration: InputDecoration(
+ filled: true,
+ isDense: true,
+ fillColor: Colors.white,
+ border: InputBorder.none,
+ enabledBorder: InputBorder.none,
+ focusedBorder: InputBorder.none,
+ contentPadding: EdgeInsets.zero,
+ //contentPadding: EdgeInsets.fromLTRB(14, 15, 10, 15),
+ hintText: LocaleKeys.searchBy.tr() + " $dropdownValue",
+ hintStyle: const TextStyle(
+ fontSize: 14.0,
+ color: MyColors.grey3AColor,
+ fontWeight: FontWeight.w600,
+ letterSpacing: -0.56,
),
),
- )
+ ).paddingOnly(top: 21, bottom: 21).expanded,
+ Container(height: 15, width: 1, color: const Color(0xffC4C4C4)),
+ 10.width,
+ dropDown(),
],
- ),
- ));
+ ).paddingOnly(left: 14, right: 14).objectContainerBorderView(disablePadding: true, color: Colors.white, radius: 10),
+ _textEditingController!.text.isNotEmpty && getEmployeeSListOnSearch.isEmpty
+ ? Utils.getNoDataWidget(context).paddingOnly(top: 120)
+ : ListView.separated(
+ //scrollDirection: Axis.vertical,
+ shrinkWrap: true,
+ physics: const NeverScrollableScrollPhysics(),
+ padding: const EdgeInsets.only(top: 12),
+ 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 InkWell(
+ onTap: () async {
+ Navigator.pushNamed(context, AppRoutes.employeeDetails, arguments: getEmployeeSListOnSearch[index]);
+ },
+ child: Row(
+ //mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ getEmployeeSListOnSearch[index].eMPLOYEEIMAGE == null
+ ? SvgPicture.asset(
+ "assets/images/user.svg",
+ height: 34,
+ width: 34,
+ ).paddingOnly(top: 4)
+ : Container(
+ height: 34,
+ width: 34,
+ child: CircleAvatar(
+ radius: 25,
+ backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSListOnSearch[index].eMPLOYEEIMAGE)),
+ backgroundColor: Colors.black,
+ ).paddingOnly(top: 4),
+ ),
+ 9.width,
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ // "Present".toText13(color: MyColors.greenColor),
+ "${getEmployeeSListOnSearch[index].eMPLOYEENAME}".toText16(color: MyColors.grey3AColor),
+ "${getEmployeeSListOnSearch[index].pOSITIONNAME}".toText10(color: MyColors.grey57Color),
+ ],
+ ).expanded,
+ Column(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ crossAxisAlignment: CrossAxisAlignment.end,
+ children: [
+ getEmployeeSListOnSearch[index].eMPLOYEEMOBILENUMBER == ""
+ ? SvgPicture.asset("assets/images/call-disable.svg", width: 22, height: 22)
+ : InkWell(
+ onTap: () {
+ launchUrl(phoneNumber);
+ },
+ child: SvgPicture.asset("assets/images/call.svg", width: 22, height: 22)),
+ 8.height,
+ const Icon(
+ Icons.arrow_forward_outlined,
+ color: MyColors.grey3AColor,
+ size: 18,
+ ),
+ ],
+ ),
+ ],
+ ).paddingOnly(top: 13, bottom: 13, right: 12, left: 14).objectContainerView(radius: 10, disablePadding: true),
+ );
+ })
+ ],
+ ),
+ );
}
+ // todo @fatima add translation for below list
+ List list = ["Name", "Email"];
+
Widget dropDown() {
- return
- DropdownButton(
- value: dropdownValue,
- icon: const Icon(Icons.keyboard_arrow_down,
- color: MyColors.grey35Color).paddingOnly(left: 4),
- elevation: 16,
- onChanged: (String? newValue) {
- setState(() {
- dropdownValue = newValue!;
- });
- },
- items: ['Name', 'Email'].map>((String value) {
- return DropdownMenuItem(
- value: value,
- child: Text(value),
- );
- }).toList(),
- style: TextStyle(fontSize: 14.0, color: MyColors.grey57Color),
- );
+ return PopupMenuButton(
+ itemBuilder: (_) => >[
+ for (int i = 0; i < list.length; i++) PopupMenuItem(value: i, child: Text(list[i])),
+ ],
+ onSelected: (int popupIndex) {
+ index = popupIndex;
+ dropdownValue = list[popupIndex];
+ setState(() {});
+ },
+ child: Row(
+ children: [
+ dropdownValue.toText14(),
+ 10.width,
+ const Icon(
+ Icons.keyboard_arrow_down_rounded,
+ color: Color(0xff535353),
+ )
+ ],
+ ),
+ );
}
}
diff --git a/lib/ui/profile/family_members.dart b/lib/ui/profile/family_members.dart
index 48535f8..340082c 100644
--- a/lib/ui/profile/family_members.dart
+++ b/lib/ui/profile/family_members.dart
@@ -59,134 +59,105 @@ class _FamilyMembersState extends State {
backgroundColor: MyColors.backgroundColor,
body: Column(
children: [
- 20.height,
Expanded(
child: getEmployeeContactsList.length != 0
- ? SingleChildScrollView(
- padding: const EdgeInsets.all(21),
- scrollDirection: Axis.vertical,
- child: ListView.separated(
- scrollDirection: Axis.vertical,
- shrinkWrap: true,
- physics: ScrollPhysics(),
- separatorBuilder: (cxt, index) => 12.height,
- itemCount: getEmployeeContactsList.length,
- itemBuilder: (context, index) {
- return Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- "${getEmployeeContactsList[index].cONTACTNAME}".toText16(isBold: true, color: MyColors.grey3AColor),
- "${getEmployeeContactsList[index].rELATIONSHIP}".toText11(isBold: true, color: MyColors.textMixColor),
- ]),
- const Divider(
- color: Color(0xffEFEFEF),
- thickness: 1,
- indent: 0,
- endIndent: 0,
- ),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: [
- menuEntries.updateButton == 'Y'
- ? InkWell(
- onTap: () async{
- relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID!.toInt();
- showUpdateAlertDialog(context, relationId!.toInt(), 2, LocaleKeys.update.tr());
- },
+ ? ListView.separated(
+ padding: const EdgeInsets.all(21),
+ separatorBuilder: (cxt, index) => 12.height,
+ itemCount: getEmployeeContactsList.length,
+ itemBuilder: (context, index) {
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
+ "${getEmployeeContactsList[index].cONTACTNAME}".toText16(color: MyColors.grey3AColor),
+ "${getEmployeeContactsList[index].rELATIONSHIP}".toText11(color: MyColors.textMixColor),
+ ]).paddingOnly(top: 15, left: 13, right: 13, bottom: 12),
+ 1.divider,
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+ children: [
+ // todo @faitma clean below logic and write clean code.
+ 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,
- ),
- ),
- ],
- ),
- ),
- )
- : RichText(
text: TextSpan(
children: [
- WidgetSpan(
+ const WidgetSpan(
child: Icon(
Icons.edit,
size: 15,
- color: MyColors.lightGreyColor,
+ color: MyColors.grey67Color,
),
),
TextSpan(
text: LocaleKeys.update.tr(),
- style: TextStyle(
- color: MyColors.lightGreyColor,
- fontSize: 12,
- ),
+ style: const TextStyle(color: MyColors.grey67Color, fontSize: 12, letterSpacing: -0.36, fontWeight: FontWeight.w600),
),
],
),
),
- Container(
- height: 35,
- width: 1,
- color: Color(0xffEFEFEF),
- ),
- InkWell(
- onTap: () {
- relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID!.toInt();
- showRemoveAlertDialog(context, relationId!.toInt());
- },
- child: RichText(
+ )
+ : RichText(
text: TextSpan(
children: [
- WidgetSpan(
+ const WidgetSpan(
child: Icon(
- Icons.delete,
+ Icons.edit,
size: 15,
- color: MyColors.redColor,
+ color: MyColors.lightGreyColor,
),
),
TextSpan(
- text: LocaleKeys.remove.tr(),
- style: TextStyle(
- color: MyColors.redColor,
- fontSize: 12,
- ),
+ text: LocaleKeys.update.tr(),
+ style: const TextStyle(color: MyColors.lightGreyColor, fontSize: 12, letterSpacing: -0.36, fontWeight: FontWeight.w600),
),
],
),
+ ),
+ Container(height: 35, width: 1, color: const Color(0xffEFEFEF)),
+ InkWell(
+ onTap: () {
+ relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID!.toInt();
+ showRemoveAlertDialog(context, relationId!.toInt());
+ },
+ child: RichText(
+ text: TextSpan(
+ children: [
+ const WidgetSpan(
+ child: Icon(
+ Icons.delete,
+ size: 15,
+ color: MyColors.redColor,
),
),
+ TextSpan(
+ text: LocaleKeys.remove.tr(),
+ style: const TextStyle(color: MyColors.redColor, fontSize: 12, letterSpacing: -0.36, fontWeight: FontWeight.w600),
+ ),
],
),
- ],
- ).objectContainerView();
- }),
- )
+ ),
+ ),
+ ],
+ ),
+ ],
+ ).objectContainerView(disablePadding: true);
+ })
: Container(),
),
- DefaultButton(
- LocaleKeys.addNewFamilyMember.tr(), () async {
+ DefaultButton(LocaleKeys.addNewFamilyMember.tr(), () async {
Navigator.pushNamed(context, AppRoutes.addUpdateFamilyMember, arguments: {"relationID": relationId, "flag": 1, "actionType": "ADD"});
ProfileScreen();
- }
- ).insideContainer,
+ }).insideContainer,
],
));
}
-
void showUpdateAlertDialog(BuildContext context, int relationId, int flag, String actionType) {
Widget cancelButton = TextButton(
child: Text(
@@ -261,6 +232,4 @@ class _FamilyMembersState extends State {
},
);
}
-
-
}
diff --git a/lib/ui/screens/items_for_sale/add_new_item_for_sale.dart b/lib/ui/screens/items_for_sale/add_new_item_for_sale.dart
index aac9d13..1ae7570 100644
--- a/lib/ui/screens/items_for_sale/add_new_item_for_sale.dart
+++ b/lib/ui/screens/items_for_sale/add_new_item_for_sale.dart
@@ -28,7 +28,7 @@ class _AddNewItemForSaleState extends State {
List getSaleCategoriesList = [];
late PageController _controller;
ItemReviewModel? itemReviewModel;
- int pageIndex = 0;
+ int? pageIndex;
@override
void initState() {
@@ -43,7 +43,7 @@ class _AddNewItemForSaleState extends State {
@override
Widget build(BuildContext context) {
- getRequestID();
+ pageIndex ??= (ModalRoute.of(context)?.settings.arguments as int?) ?? 0;
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget(context, title: LocaleKeys.itemsForSale.tr(), showHomeButton: true),
@@ -147,11 +147,6 @@ class _AddNewItemForSaleState extends State {
);
}
- void getRequestID() async {
- int args = (ModalRoute.of(context)?.settings.arguments ?? {}) as int;
- pageIndex = args;
- }
-
void getItemForSaleCategory() async {
try {
Utils.showLoading(context);
diff --git a/lib/ui/screens/items_for_sale/fragments/add_details_fragment.dart b/lib/ui/screens/items_for_sale/fragments/add_details_fragment.dart
index bfb5a5e..fc655a1 100644
--- a/lib/ui/screens/items_for_sale/fragments/add_details_fragment.dart
+++ b/lib/ui/screens/items_for_sale/fragments/add_details_fragment.dart
@@ -188,11 +188,11 @@ class _AddItemDetailsFragmentState extends State {
children: [
title.toText16().expanded,
6.width,
- SimpleButton(LocaleKeys.add.tr(), () async {
- ImageOptions.showImageOptions(context, (String image, File file) {
- setState(() {
- images.add(image);
- });
+ SimpleButton(LocaleKeys.add.tr(), () {
+ ImageOptions.showImageOptionsNew(context, (String image, File file) {
+ // setState(() {
+ // images.add(image);
+ // });
});
}, fontSize: 14),
],
diff --git a/lib/ui/work_list/sheets/search_options_sheet.dart b/lib/ui/work_list/sheets/search_options_sheet.dart
index 9b794bb..05a87d9 100644
--- a/lib/ui/work_list/sheets/search_options_sheet.dart
+++ b/lib/ui/work_list/sheets/search_options_sheet.dart
@@ -47,11 +47,7 @@ class SearchOptionsSheet extends StatelessWidget {
});
},
separatorBuilder: (context, index) {
- return Container(
- width: double.infinity,
- height: 1,
- color: Color(0xffE3E3E3),
- );
+ return 1.divider;
},
itemCount: searchOptions.length,
physics: NeverScrollableScrollPhysics(),
diff --git a/lib/widgets/bottom_sheets/attachment_options.dart b/lib/widgets/bottom_sheets/attachment_options.dart
new file mode 100644
index 0000000..ebcfbe7
--- /dev/null
+++ b/lib/widgets/bottom_sheets/attachment_options.dart
@@ -0,0 +1,54 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_svg/flutter_svg.dart';
+import 'package:mohem_flutter_app/classes/colors.dart';
+import 'package:mohem_flutter_app/extensions/string_extensions.dart';
+import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
+
+class AttachmentOptions extends StatelessWidget {
+ VoidCallback onCameraTap;
+ VoidCallback onGalleryTap;
+ VoidCallback onFilesTap;
+
+ AttachmentOptions({Key? key, required this.onCameraTap, required this.onGalleryTap, required this.onFilesTap}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return SizedBox(
+ width: double.infinity,
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ "Upload Attachment".toSectionHeading(),
+ "Select from gallery or open camera".toText11(weight: FontWeight.w500),
+ GridView(
+ gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 105 / 105, crossAxisSpacing: 9, mainAxisSpacing: 9),
+ physics: const NeverScrollableScrollPhysics(),
+ padding: const EdgeInsets.only(top: 21, bottom: 14),
+ shrinkWrap: true,
+ children: [
+ itemView("open_camera.svg", "Open\nCamera"),
+ itemView("gallery.svg", "Upload from\nGallery"),
+ itemView("files.svg", "Upload from\nFiles"),
+ ],
+ )
+ ],
+ ).paddingOnly(left: 21, right: 21, bottom: 21),
+ );
+ }
+
+ Widget itemView(String icon, String title) {
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ SvgPicture.asset("assets/images/$icon"),
+ title.toText11(isBold: true),
+ ],
+ ).paddingOnly(left: 13, right: 13, top: 16, bottom: 12).expanded.objectContainerBorderView(
+ disablePadding: true,
+ radius: 10,
+ color: MyColors.greyF7Color.withOpacity(.48),
+ borderColor: MyColors.lightGreyE5Color.withOpacity(.48),
+ );
+ }
+}
diff --git a/lib/widgets/image_picker.dart b/lib/widgets/image_picker.dart
index ec57085..484f0a1 100644
--- a/lib/widgets/image_picker.dart
+++ b/lib/widgets/image_picker.dart
@@ -1,16 +1,31 @@
import 'dart:convert';
import 'dart:io';
+import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
+import 'package:mohem_flutter_app/widgets/bottom_sheet.dart';
+import 'package:mohem_flutter_app/widgets/bottom_sheets/attachment_options.dart';
class ImageOptions {
- static void showImageOptions(
- BuildContext context,
- Function(String, File) image,
- ) {
+ static void showImageOptionsNew(BuildContext context, Function(String, File) image) {
+ showMyBottomSheet(
+ context,
+ child: AttachmentOptions(
+ onCameraTap: () async {
+ PickedFile? path = await ImagePicker.platform.pickImage(source: ImageSource.camera, imageQuality: 20);
+ },
+ onGalleryTap: () {},
+ onFilesTap: () async {
+ FilePickerResult? result = await FilePicker.platform.pickFiles();
+ },
+ ),
+ );
+ }
+
+ static void showImageOptions(BuildContext context, Function(String, File) image) {
showModalBottomSheet(
backgroundColor: Colors.transparent,
context: context,