merge-requests/1/merge
Sultan Khan 2 years ago
parent 57f789ca6d
commit fad58931f3

@ -0,0 +1,5 @@
{
"cSpell.words": [
"MPLOYEEIMAGE"
]
}

@ -7,7 +7,6 @@
<uses-permission android:name="android.permission.NFC"/>
<application
android:label="Mohemm"
tools:replace="icon, label"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"

@ -231,12 +231,21 @@
"myAttendance": "حضوري",
"workOnBreak": "العمل على استراحة",
"next": "التالي",
"completingYear": "نحن نقدر لك لاستكمال خدمة",
"year": "سنة",
"month": "شهر",
"day": "يوم",
"profile": {
"reset_password": {
"label": "Reset Password",
"username": "Username",
"password": "password"
}
},
"profileCompletionPer": "استكمال الملف الشخصي",
"completeProfile": "الملف الشخصي الكامل",
"personalInformation": "معلومات شخصية",
"basicDetails": "تفاصيل أساسية",
"familyDetails": "تفاصيل عائلية"
},
"clicked": {
"zero": "You clicked {} times!",

@ -54,22 +54,22 @@
"itemsForSale": "Items for Sale",
"attendanceDetails": "Attendance Details",
"order": "order",
"earlyOut" : "Early Out",
"shortage" : "Shortage",
"excess" : "Excess",
"lateIn" : "Late In",
"earlyOut": "Early Out",
"shortage": "Shortage",
"excess": "Excess",
"lateIn": "Late In",
"approvedCheckOut": "Approved Check Out",
"approvedCheckIn":"Approved Check In",
"approvedCheckIn": "Approved Check In",
"actualCheckOut": "Actual Check Out",
"actualCheckIn": "Actual Check In",
"present": "PRESENT 11",
"pres" : "present",
"pres": "present",
"shiftTime": "Shift Time",
"absent": "ABSENT 10",
"attendance": "Attendance",
"scheduleDays" :"Schedule\nDays",
"offDays":"Off\nDays",
"nonAnalyzed" : "Non\nAnalyzed",
"scheduleDays": "Schedule\nDays",
"offDays": "Off\nDays",
"nonAnalyzed": "Non\nAnalyzed",
"shortageHour": "Shortage\nHour",
"stats": "Stats",
"completed": "Completed",
@ -224,7 +224,7 @@
"relatedTo": "Related To",
"requestDate": "Request Date",
"analyzedDate": "Analyzed Date",
"approvedCheckIn" : "Approved Check In",
"approvedCheckIn": "Approved Check In",
"urgent": "Urgent",
"requestDetails": "Request Details",
"approvalLevel": "Approval Level",
@ -232,12 +232,21 @@
"myAttendance": "My Attendance",
"workOnBreak": "Work On Break",
"next": "Next",
"year": "Year",
"month": "Month",
"day": "Day",
"completingYear": "We appreciate you for completing the service of",
"profile": {
"reset_password": {
"label": "Reset Password",
"username": "Username",
"password": "password"
}
},
"profileCompletionPer": "Profile Completion",
"completeProfile": "Complete Profile",
"personalInformation": "Personal Information",
"basicDetails": "Basic Details",
"familyDetails": "Family Details"
},
"clicked": {
"zero": "You clicked {} times!",

@ -1,3 +1,6 @@
import 'dart:convert';
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
@ -108,4 +111,21 @@ class Utils {
),
);
}
static getPostBytes(img) {
try {
var b64 = img.replaceFirst('data:image/png;base64,', '');
if (img != null && Utils.isBase64(b64)) return Utils.dataFromBase64String(b64);
} catch (e) {}
return null;
}
static bool isBase64(String str) {
RegExp _base64 = RegExp(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{4})$');
return _base64.hasMatch(str);
}
static Uint8List dataFromBase64String(String base64String) {
return base64Decode(base64String);
}
}

@ -68,6 +68,30 @@ class CodegenLoader extends AssetLoader{
"confirm": "تؤكد",
"passwordChangedSuccessfully": "تم تغيير الرقم السري بنجاح",
"itemsForSale": "سلع للبيع",
"attendanceDetails": "تفاصيل الحضور",
"order": "الطلبات",
"earlyOut": "الخروج مبكرا",
"shortage": "ساعات التقصير",
"excess": "Excess",
"lateIn": "القدوم المتاخر",
"approvedCheckOut": "وقت الخروج",
"approvedCheckIn": "وقت الدخول",
"actualCheckOut": "وقت الخروج",
"actualCheckIn": "وقت الدخول",
"present": "حضور",
"pres": "حضور",
"shiftTime": "وقت التناوب",
"absent": "غياب",
"attendance": "الحضور",
"scheduleDays": "ايام العمل",
"offDays": "ايام الراحه",
"nonAnalyzed": "لايوجد تحليل",
"shortageHour": "ساعات التقصير",
"stats": "الحاله",
"completed": "تم اكمال",
"msg": "Hello {} in the {} world ",
"msg_named": "{} are written in the {lang} language",
"clickMe": "Click me",
"doNotUseRecentPassword": "لا تستخدم كلمة مرور حديثة",
"atLeastOneLowercase": "حرف صغير واحد على الأقل",
"atLeastOneUppercase": "حرف كبير واحد على الأقل",
@ -187,9 +211,6 @@ class CodegenLoader extends AssetLoader{
"rfqUOM": "RFQ UOM",
"rfqQty": "RFQ الكمية",
"rfqNumber": "رقم RFQ",
"msg": "Hello {} in the {} world ",
"msg_named": "{} are written in the {lang} language",
"clickMe": "Click me",
"human": "بشري",
"resources": "موارد",
"details": "تفاصيل",
@ -223,12 +244,24 @@ class CodegenLoader extends AssetLoader{
"requestDetails": "طلب تفاصيل",
"approvalLevel": "مستوى الموافقة",
"requesterDetails": "تفاصيل مقدم الطلب",
"myAttendance": "حضوري",
"workOnBreak": "العمل على استراحة",
"next": "التالي",
"completingYear": "نحن نقدر لك لاستكمال خدمة",
"year": "سنة",
"month": "شهر",
"day": "يوم",
"profile": {
"reset_password": {
"label": "Reset Password",
"username": "Username",
"password": "password"
}
},
"profileCompletionPer": "استكمال الملف الشخصي",
"completeProfile": "الملف الشخصي الكامل",
"personalInformation": "معلومات شخصية",
"basicDetails": "تفاصيل أساسية",
"familyDetails": "تفاصيل عائلية"
},
"clicked": {
"zero": "You clicked {} times!",
@ -310,6 +343,27 @@ static const Map<String,dynamic> en_US = {
"confirm": "Confirm",
"passwordChangedSuccessfully": "Password changed successfully",
"itemsForSale": "Items for Sale",
"attendanceDetails": "Attendance Details",
"order": "order",
"earlyOut": "Early Out",
"shortage": "Shortage",
"excess": "Excess",
"lateIn": "Late In",
"approvedCheckOut": "Approved Check Out",
"approvedCheckIn": "Approved Check In",
"actualCheckOut": "Actual Check Out",
"actualCheckIn": "Actual Check In",
"present": "PRESENT 11",
"pres": "present",
"shiftTime": "Shift Time",
"absent": "ABSENT 10",
"attendance": "Attendance",
"scheduleDays": "Schedule\nDays",
"offDays": "Off\nDays",
"nonAnalyzed": "Non\nAnalyzed",
"shortageHour": "Shortage\nHour",
"stats": "Stats",
"completed": "Completed",
"doNotUseRecentPassword": "Do not use recent password",
"atLeastOneLowercase": "At least one lowercase",
"atLeastOneUppercase": "At least one uppercase",
@ -465,12 +519,24 @@ static const Map<String,dynamic> en_US = {
"requestDetails": "Request Details",
"approvalLevel": "Approval Level",
"requesterDetails": "Requester Details",
"myAttendance": "My Attendance",
"workOnBreak": "Work On Break",
"next": "Next",
"year": "Year",
"month": "Month",
"day": "Day",
"completingYear": "We appreciate you for completing the service of",
"profile": {
"reset_password": {
"label": "Reset Password",
"username": "Username",
"password": "password"
}
},
"profileCompletionPer": "Profile Completion",
"completeProfile": "Complete Profile",
"personalInformation": "Personal Information",
"basicDetails": "Basic Details",
"familyDetails": "Family Details"
},
"clicked": {
"zero": "You clicked {} times!",

@ -53,6 +53,30 @@ abstract class LocaleKeys {
static const confirm = 'confirm';
static const passwordChangedSuccessfully = 'passwordChangedSuccessfully';
static const itemsForSale = 'itemsForSale';
static const attendanceDetails = 'attendanceDetails';
static const order = 'order';
static const earlyOut = 'earlyOut';
static const shortage = 'shortage';
static const excess = 'excess';
static const lateIn = 'lateIn';
static const approvedCheckOut = 'approvedCheckOut';
static const approvedCheckIn = 'approvedCheckIn';
static const actualCheckOut = 'actualCheckOut';
static const actualCheckIn = 'actualCheckIn';
static const present = 'present';
static const pres = 'pres';
static const shiftTime = 'shiftTime';
static const absent = 'absent';
static const attendance = 'attendance';
static const scheduleDays = 'scheduleDays';
static const offDays = 'offDays';
static const nonAnalyzed = 'nonAnalyzed';
static const shortageHour = 'shortageHour';
static const stats = 'stats';
static const completed = 'completed';
static const msg = 'msg';
static const msg_named = 'msg_named';
static const clickMe = 'clickMe';
static const doNotUseRecentPassword = 'doNotUseRecentPassword';
static const atLeastOneLowercase = 'atLeastOneLowercase';
static const atLeastOneUppercase = 'atLeastOneUppercase';
@ -172,9 +196,6 @@ abstract class LocaleKeys {
static const rfqUOM = 'rfqUOM';
static const rfqQty = 'rfqQty';
static const rfqNumber = 'rfqNumber';
static const msg = 'msg';
static const msg_named = 'msg_named';
static const clickMe = 'clickMe';
static const human = 'human';
static const resources = 'resources';
static const details = 'details';
@ -208,18 +229,27 @@ abstract class LocaleKeys {
static const requestDetails = 'requestDetails';
static const approvalLevel = 'approvalLevel';
static const requesterDetails = 'requesterDetails';
static const myAttendance = 'myAttendance';
static const workOnBreak = 'workOnBreak';
static const next = 'next';
static const completingYear = 'completingYear';
static const year = 'year';
static const month = 'month';
static const day = 'day';
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';
static const profile_reset_password = 'profile.reset_password';
static const profile_profileCompletionPer = 'profile.profileCompletionPer';
static const profile_completeProfile = 'profile.completeProfile';
static const profile_personalInformation = 'profile.personalInformation';
static const profile_basicDetails = 'profile.basicDetails';
static const profile_familyDetails = 'profile.familyDetails';
static const profile = 'profile';
static const clicked = 'clicked';
static const amount = 'amount';
static const gender_with_arg = 'gender.with_arg';
static const gender = 'gender';
static const reset_locale = 'reset_locale';
static const myAttendance = 'myAttendance';
static const workOnBreak = 'workOnBreak';
static const next = 'next';
}

@ -669,9 +669,9 @@ class GenericResponseModel {
}
getEarningsList = json['GetEarningsList'];
if (json['GetEmployeeAddressList'] != null) {
getEmployeeAddressList = <dynamic>[];
getEmployeeAddressList = <dynamic>[].cast<GetEmployeeAddressList>();
json['GetEmployeeAddressList'].forEach((v) {
getEmployeeAddressList!.add(dynamic);
getEmployeeAddressList!.add(v);
});
}
if (json['GetEmployeeBasicDetailsList'] != null) {

@ -0,0 +1,9 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ProfileMenu {
final String name;
final IconData icon;
final String route;
ProfileMenu({this.name = '', this.icon = Icons.home, this.route = ''});
}

@ -2,10 +2,33 @@ import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/profile_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart';
import 'package:mohem_flutter_app/models/member_information_list_model.dart';
import 'package:mohem_flutter_app/ui/screens/profile/widgets/header.dart';
import 'package:mohem_flutter_app/ui/screens/profile/widgets/profile_panel.dart';
class ProfileScreen extends StatelessWidget {
class ProfileScreen extends StatefulWidget {
const ProfileScreen({Key? key}) : super(key: key);
@override
_ProfileScreenState createState() => _ProfileScreenState();
}
class _ProfileScreenState extends State<ProfileScreen> {
late MemberInformationListModel memberInformationList;
List<GetEmployeeBasicDetailsList> getEmployeeBasicDetailsList = [];
@override
void initState() {
super.initState();
memberInformationList = AppState().memberInformationList!;
//getEmployeeBasicDetails();
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -15,12 +38,7 @@ class ProfileScreen extends StatelessWidget {
Container(
height: 300,
margin: EdgeInsets.only(top: 50),
decoration: new BoxDecoration(
image: new DecorationImage(
image: new ExactAssetImage('assets/images/user-avatar.png'),
fit: BoxFit.cover,
),
),
decoration: BoxDecoration(image: DecorationImage(image: MemoryImage(Utils.getPostBytes(memberInformationList.eMPLOYEEIMAGE)), fit: BoxFit.cover)),
child: new BackdropFilter(
filter: new ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
child: new Container(
@ -39,7 +57,9 @@ class ProfileScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
onPressed: () {},
onPressed: () {
Navigator.pop(context);
},
icon: Icon(
Icons.arrow_back_ios,
color: Colors.white,
@ -57,10 +77,25 @@ class ProfileScreen extends StatelessWidget {
]))),
],
)),
HeaderPanel(),
ProfilePanle()
HeaderPanel(memberInformationList),
ProfilePanle(memberInformationList)
]),
)
]));
}
void getEmployeeBasicDetails() async {
try {
Utils.showLoading(context);
getEmployeeBasicDetailsList = await ProfileApiClient().getEmployeeBasicDetails();
Utils.hideLoading(context);
//basicDetails();
print("getEmployeeBasicDetailsList.length");
print(getEmployeeBasicDetailsList.length);
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
}

@ -1,7 +1,10 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/models/member_information_list_model.dart';
class HeaderPanel extends StatelessWidget {
HeaderPanel(this.memberInformationList);
late MemberInformationListModel memberInformationList;
@override
Widget build(BuildContext context) {
double _width = MediaQuery.of(context).size.width;

@ -1,40 +1,47 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/member_information_list_model.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:mohem_flutter_app/models/profile_menu.model.dart';
class ProfileInFo extends StatelessWidget {
ProfileInFo(this.memberInfo);
MemberInformationListModel memberInfo;
String data = '.';
double sliderValue = 75;
List<ProfileMenu> menu = [
ProfileMenu(name: 'Personal information', icon: ''),
ProfileMenu(name: 'Basic Details', icon: ''),
ProfileMenu(name: 'Family Details', icon: ''),
ProfileMenu(name: LocaleKeys.profile_personalInformation.tr(), icon: Icons.info, route: AppRoutes.personalInfo),
ProfileMenu(name: LocaleKeys.profile_basicDetails.tr(), icon: Icons.contacts, route: AppRoutes.basicDetails),
ProfileMenu(name: LocaleKeys.profile_familyDetails.tr(), icon: Icons.reduce_capacity_sharp, route: AppRoutes.familyMembers),
];
@override
Widget build(BuildContext context) {
return Container(
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
/// card header
customLabel('Sultan khan', 22, Colors.black, true),
customLabel(memberInfo.eMPLOYEENAME.toString(), 22, Colors.black, true),
customLabel('217869 | Software Developer', 14, Colors.grey, false),
customLabel(memberInfo.eMPLOYEENUMBER.toString() + ' | ' + memberInfo.jOBNAME.toString(), 14, Colors.grey, false),
customLabel('sultan.khan@cloudsolutions.com.sa', 13, Colors.black, true),
customLabel(memberInfo.eMPLOYEEEMAILADDRESS.toString(), 13, Colors.black, true),
Divider(height: 40, thickness: 8, color: const Color(0xffefefef)),
customLabel('We appreciates you for completing the service of', 10, Colors.black, true),
customLabel(LocaleKeys.completingYear.tr(), 10, Colors.black, true),
SizedBox(height: 10),
Container(
child: Row(mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.center, children: [
Column(
children: [customLabel('Years', 14, const Color(0xff808080), true), customLabel('03', 22, Color(0xff2BB8A6), true)],
children: [customLabel(LocaleKeys.year.tr(), 14, const Color(0xff808080), true), customLabel(memberInfo.sERVICEYEARS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)],
),
Column(
children: [customLabel('Month', 14, const Color(0xff808080), true), customLabel('06', 22, Color(0xff2BB8A6), true)],
children: [customLabel(LocaleKeys.month.tr(), 14, const Color(0xff808080), true), customLabel(memberInfo.sERVICEMONTHS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)],
),
Column(
children: [customLabel('Day', 14, const Color(0xff808080), true), customLabel('20', 22, Color(0xff2BB8A6), true)],
children: [customLabel(LocaleKeys.day.tr(), 14, const Color(0xff808080), true), customLabel(memberInfo.sERVICEDAYS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)],
)
])),
@ -48,7 +55,7 @@ class ProfileInFo extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
customLabel('Profile Completion 75%', 18, Colors.black, true),
customLabel(LocaleKeys.profile_profileCompletionPer.tr() + ' 75%', 18, Colors.black, true),
const SizedBox(height: 10),
Row(
children: [
@ -58,7 +65,7 @@ class ProfileInFo extends StatelessWidget {
),
const SizedBox(height: 10),
Text(
'Complete Profile',
LocaleKeys.profile_completeProfile.tr(),
style: TextStyle(color: Color(0xff2BB8A6), fontWeight: FontWeight.bold, decoration: TextDecoration.underline),
),
],
@ -92,14 +99,13 @@ class ProfileInFo extends StatelessWidget {
Widget rowItem(obj, context) {
return InkWell(
onTap: () {
// Navigator.pushNamed(
// context,
// AppRoutes.addEitScreen,
// arguments: obj,
// );
Navigator.pushNamed(context, obj.route);
},
child: ListTile(
leading: FlutterLogo(),
leading: Icon(
obj.icon,
color: Color(0xff2BB8A6),
),
title: Text(obj.name),
trailing: Icon(Icons.arrow_forward),
),
@ -114,9 +120,3 @@ class ProfileInFo extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
children: [Text(label, style: TextStyle(color: color, fontSize: size, fontWeight: isBold ? FontWeight.bold : FontWeight.normal))]));
}
class ProfileMenu {
final String name;
final String icon;
ProfileMenu({this.name = '', this.icon = ''});
}

@ -1,8 +1,12 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/models/member_information_list_model.dart';
import 'package:mohem_flutter_app/ui/screens/profile/widgets/profile_info.dart';
class ProfilePanle extends StatelessWidget {
ProfilePanle(this.memberInformationList);
late MemberInformationListModel memberInformationList;
@override
Widget build(BuildContext context) {
double _width = MediaQuery.of(context).size.width;
@ -18,11 +22,15 @@ class ProfilePanle extends StatelessWidget {
color: Colors.white,
borderRadius: const BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)),
boxShadow: [BoxShadow(color: Colors.white60, blurRadius: 10, spreadRadius: 10)]),
child: ProfileInFo(),
child: ProfileInFo(memberInformationList),
),
Container(height: 100, alignment: Alignment.center, child: ProfileImage())
]));
}
Widget ProfileImage() => CircleAvatar(radius: 70, backgroundImage: AssetImage('assets/images/user-avatar.png'));
Widget ProfileImage() => CircleAvatar(
radius: 70,
backgroundImage: MemoryImage(Utils.getPostBytes(memberInformationList.eMPLOYEEIMAGE)),
backgroundColor: Colors.black,
);
}

Loading…
Cancel
Save