Merge branch 'master' into development_sikander

faiz_marathon_signalR_critical
Sikander Saleem 2 years ago
commit c390d87fca

@ -27,7 +27,7 @@ apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 31
compileSdkVersion 32
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
@ -46,7 +46,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "hmg.cloudSolutions.mohem"
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 32
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

@ -6,6 +6,7 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.CAMERA" />
<application
android:icon="@mipmap/ic_launcher"
@ -15,6 +16,7 @@
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:exported="true"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" xml:space="preserve">
<g>
<rect x="38" y="23" width="2" height="5"/>
<rect x="42" y="23" width="2" height="5"/>
<rect x="38" y="30" width="2" height="2"/>
<rect x="42" y="30" width="2" height="2"/>
<rect x="31" y="34" width="2" height="2"/>
<rect x="26" y="54" width="2" height="2"/>
<rect x="42" y="34" width="2" height="2"/>
<rect x="38" y="38" width="2" height="2"/>
<rect x="42" y="38" width="2" height="2"/>
<path d="M2,2h3V0H1C0.448,0,0,0.448,0,1v4h2V2z"/>
<path d="M63,0h-4v2h3v3h2V1C64,0.448,63.552,0,63,0z"/>
<path d="M2,59H0v4c0,0.552,0.448,1,1,1h4v-2H2V59z"/>
<path d="M62,62h-3v2h4c0.552,0,1-0.448,1-1v-4h-2V62z"/>
<path d="M4,5v12c0,0.552,0.448,1,1,1h12c0.552,0,1-0.448,1-1V5c0-0.552-0.448-1-1-1H5C4.448,4,4,4.448,4,5z M6,6h10v10H6V6z"/>
<path d="M13,8H9C8.448,8,8,8.448,8,9v4c0,0.552,0.448,1,1,1h4c0.552,0,1-0.448,1-1V9C14,8.448,13.552,8,13,8z M12,12h-2v-2h2V12z"
/>
<path d="M47,18h12c0.552,0,1-0.448,1-1V5c0-0.552-0.448-1-1-1H47c-0.552,0-1,0.448-1,1v12C46,17.552,46.448,18,47,18z M48,6h10v10
H48V6z"/>
<path d="M55,8h-4c-0.552,0-1,0.448-1,1v4c0,0.552,0.448,1,1,1h4c0.552,0,1-0.448,1-1V9C56,8.448,55.552,8,55,8z M54,12h-2v-2h2V12z
"/>
<path d="M17,46H5c-0.552,0-1,0.448-1,1v12c0,0.552,0.448,1,1,1h12c0.552,0,1-0.448,1-1V47C18,46.448,17.552,46,17,46z M16,58H6V48
h10V58z"/>
<path d="M9,56h4c0.552,0,1-0.448,1-1v-4c0-0.552-0.448-1-1-1H9c-0.552,0-1,0.448-1,1v4C8,55.552,8.448,56,9,56z M10,52h2v2h-2V52z"
/>
<path d="M44,19h-7V7h-2v13c0,0.552,0.448,1,1,1h8V19z"/>
<rect x="22" y="12" width="7" height="2"/>
<rect x="26" y="8" width="7" height="2"/>
<rect x="4" y="19" width="2" height="9"/>
<path d="M18,25H8v2h9v4h2v-5C19,25.448,18.552,25,18,25z"/>
<rect x="9" y="20" width="2" height="2"/>
<rect x="21" y="18" width="2" height="8"/>
<rect x="21" y="28" width="9" height="2"/>
<path d="M61,29h-2v10h-3v2h4c0.552,0,1-0.448,1-1V29z"/>
<rect x="26" y="18" width="2" height="2"/>
<rect x="4" y="33" width="2" height="8"/>
<rect x="4" y="42" width="9" height="2"/>
<path d="M50,28h2v-4c0-0.552-0.448-1-1-1h-5v2h4V28z"/>
<rect x="9" y="33" width="2" height="2"/>
<rect x="20" y="32" width="2" height="8"/>
<rect x="20" y="42" width="9" height="2"/>
<rect x="8" y="38" width="9" height="2"/>
<rect x="21" y="52" width="2" height="4"/>
<rect x="20" y="48" width="9" height="2"/>
<path d="M36,44v-5c0-0.552-0.448-1-1-1H25v2h9v4H36z"/>
<rect x="26" y="32" width="2" height="2"/>
<rect x="15" y="34" width="2" height="2"/>
<rect x="59" y="53" width="2" height="7"/>
<rect x="54" y="58" width="3" height="2"/>
<rect x="54" y="52" width="2" height="4"/>
<path d="M61,44c0-0.552-0.448-1-1-1H49v2h10v6h2V44z"/>
<path d="M48,56v-5c0-0.552-0.448-1-1-1H36v2h10v4H48z"/>
<rect x="50" y="47" width="7" height="2"/>
<rect x="20" y="58" width="7" height="2"/>
<rect x="30" y="51" width="2" height="9"/>
<rect x="32" y="46" width="4" height="2"/>
<path d="M47,36h5v-2h-4v-6h-2v7C46,35.552,46.448,36,47,36z"/>
<rect x="50" y="30" width="5" height="2"/>
<rect x="54" y="20" width="3" height="2"/>
<rect x="59" y="20" width="2" height="5"/>
<rect x="54" y="25" width="2" height="2"/>
<path d="M39,17h4c0.552,0,1-0.448,1-1V3h-2v12h-3V17z"/>
<path d="M24,5h15V3H23c-0.552,0-1,0.448-1,1v5h2V5z"/>
<path d="M25,24h7c0.552,0,1-0.448,1-1v-8h-2v7h-6V24z"/>
<rect x="34" y="23" width="2" height="4"/>
<rect x="36" y="54" width="7" height="2"/>
<rect x="36" y="58" width="9" height="2"/>
<path d="M50,58h-2v2h3c0.552,0,1-0.448,1-1v-8h-2V58z"/>
<rect x="16" y="42" width="2" height="2"/>
<rect x="39" y="42" width="4" height="2"/>
<rect x="46" y="38" width="2" height="3"/>
<rect x="45" y="43" width="2" height="2"/>
<rect x="39" y="46" width="3" height="2"/>
<rect x="50" y="38" width="2" height="2"/>
<rect x="54" y="34" width="3" height="2"/>
<rect x="35" y="34" width="5" height="2"/>
<rect x="34" y="29" width="2" height="3"/>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 KiB

@ -88,7 +88,7 @@ class DashboardApiClient {
}
//Mark Attendance
Future<GenericResponseModel?> markAttendance({String lat = "0", String? long = "0", required int pointType, String nfcValue = "", bool isGpsRequired = false}) async {
Future<GenericResponseModel?> markAttendance({String lat = "0", String? long = "0", required int pointType, String nfcValue = "", bool isGpsRequired = false, String QRValue = ""}) async {
String url = "${ApiConsts.swpRest}AuthenticateAndSwipeUserSupportNFC";
var uuid = Uuid();
// Generate a v4 (random) id
@ -97,7 +97,7 @@ class DashboardApiClient {
"UID": uuid.v4(), //Mobile Id
"Latitude": lat,
"Longitude": long,
"QRValue": "",
"QRValue": QRValue,
"PointType": pointType, // NFC=2, Wifi = 3, QR= 1,
"NFCValue": nfcValue,
"WifiValue": pointType == 3 ? "100" : "",

@ -0,0 +1,67 @@
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
class BusinessCardDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RotatedBox(
quarterTurns: 1,
child: Container(
width: MediaQuery.of(context).size.height / 2,
color: Colors.white,
margin: EdgeInsets.all(20),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Image.asset(
"assets/images/logos/bn_cloud_soloution.jpg",
width: 80,
height: 80,
),
12.height,
(AppState().memberInformationList!.eMPLOYEENAME ?? "").toText20(),
],
),
),
Image.memory(
Utils.getPostBytes(AppState().memberInformationList!.businessCardQR ?? ""),
width: 100,
height: 100,
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
1.height,
(AppState().memberInformationList!.pOSITIONNAME ?? "").toText12(isBold: false),
12.height,
(AppState().memberInformationList!.eMPLOYEENUMBER ?? "").toText12(isBold: false),
1.height,
(AppState().memberInformationList!.eMPLOYEEEMAILADDRESS ?? "").toText12(isBold: false),
1.height,
(AppState().memberInformationList!.jOBNAME ?? "").toText12(isBold: false),
],
),
],
),
),
);
}
}

@ -0,0 +1,77 @@
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:qr_flutter/qr_flutter.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/main.dart';
class EmployeeDigitialIdDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Image.asset("assets/images/bn_logo.png"),
Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
children: [
Container(
width: 80,
height: 80,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.all(Radius.circular(12)),
boxShadow: [BoxShadow(color: Colors.white60, blurRadius: 10, spreadRadius: 10)],
),
clipBehavior: Clip.antiAlias,
child: Image.memory(
Utils.getPostBytes(
AppState().memberInformationList!.eMPLOYEEIMAGE ?? "",
),
fit: BoxFit.cover,
),
),
16.width,
(AppState().memberInformationList!.eMPLOYEENUMBER ?? "").toText20(),
],
),
Container(
width: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
12.height,
(AppState().memberInformationList!.eMPLOYEENAME ?? "").toText16(),
4.height,
(AppState().memberInformationList!.pOSITIONNAME ?? "").toText12(isBold: false),
],
),
),
Image.memory(
Utils.getPostBytes(AppState().memberInformationList!.employeeQR ?? ""),
width: 160,
height: 160,
),
DefaultButton("Cancel", () {
Navigator.pop(context);
})
],
),
),
],
),
);
}
}

@ -29,6 +29,7 @@ class DashboardScreen extends StatefulWidget {
class _DashboardScreenState extends State<DashboardScreen> {
late DashboardProviderModel data;
final GlobalKey<ScaffoldState> _scaffoldState = GlobalKey();
@override
void initState() {
super.initState();

@ -1,5 +1,6 @@
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
@ -15,12 +16,17 @@ 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/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/widgets/circular_step_progress_bar.dart';
import 'package:mohem_flutter_app/widgets/dialogs/dialogs.dart';
import 'package:mohem_flutter_app/widgets/location/Location.dart';
import 'package:mohem_flutter_app/widgets/nfc/nfc_reader_sheet.dart';
import 'package:nfc_manager/nfc_manager.dart';
import 'package:provider/provider.dart';
import 'package:wifi_iot/wifi_iot.dart';
import 'package:mohem_flutter_app/widgets/qr_scanner_dialog.dart';
class TodayAttendanceScreen extends StatefulWidget {
TodayAttendanceScreen({Key? key}) : super(key: key);
@ -33,7 +39,7 @@ class TodayAttendanceScreen extends StatefulWidget {
class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> {
ValueNotifier<dynamic> result = ValueNotifier(null);
late DashboardProviderModel data;
bool isNfcEnabled = true, isNfcLocationEnabled = false, isQrEnabled = false, isQrLocationEnabled = false, isWifiEnabled = false, isWifiLocationEnabled = false;
bool isNfcEnabled = false, isNfcLocationEnabled = false, isQrEnabled = false, isQrLocationEnabled = false, isWifiEnabled = false, isWifiLocationEnabled = false;
@override
void initState() {
@ -189,25 +195,39 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> {
padding: EdgeInsets.zero,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 1 / 1, crossAxisSpacing: 8, mainAxisSpacing: 8),
children: <Widget>[
attendanceMethod("NFC", "assets/images/nfc.svg", isNfcEnabled, () {
if (isNfcLocationEnabled) {
Location.getCurrentLocation((LatLng? latlng) {
performNfcAttendance(model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? "");
});
} else {
performNfcAttendance(model);
}
}),
attendanceMethod("Wifi", "assets/images/wufu.svg", isWifiEnabled, () {
if (isWifiLocationEnabled) {
Location.getCurrentLocation((LatLng? latlng) {
performWifiAttendance(model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? "");
});
} else {
performWifiAttendance(model);
}
// connectWifi();
}),
if (isNfcEnabled)
attendanceMethod("NFC", "assets/images/nfc.svg", isNfcEnabled, () {
if (isNfcLocationEnabled) {
Location.getCurrentLocation((LatLng? latlng) {
performNfcAttendance(model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? "");
});
} else {
performNfcAttendance(model);
}
}),
if (isWifiEnabled)
attendanceMethod("Wifi", "assets/images/wufu.svg", isWifiEnabled, () {
if (isWifiLocationEnabled) {
Location.getCurrentLocation((LatLng? latlng) {
performWifiAttendance(model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? "");
});
} else {
performWifiAttendance(model);
}
// connectWifi();
}),
if (isQrEnabled)
attendanceMethod("QR", "assets/images/ic_qr.svg", isQrEnabled, () async {
if (isQrLocationEnabled) {
Location.getCurrentLocation((LatLng? latlng) {
performQrCodeAttendance(model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? "");
});
} else {
performQrCodeAttendance(model);
}
// performQrCodeAttendance(model);
}),
],
)
],
@ -272,6 +292,7 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> {
} else {
print("wifi not location enabled");
}
bool v = await WiFiForIoTPlugin.connect(AppState().mohemmWifiSSID ?? "", password: AppState().mohemmWifiPassword ?? "", joinOnce: true, security: NetworkSecurity.WPA, withInternet: false);
if (v) {
await WiFiForIoTPlugin.forceWifiUsage(true);
@ -301,6 +322,29 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> {
return v;
}
Future<void> performQrCodeAttendance(DashboardProviderModel model, {String lat = "0", String lng = "0"}) async {
var qrCodeValue = await Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => QrScannerDialog(),
),
);
if(qrCodeValue!=null){
print("qrCode: " + qrCodeValue);
Utils.showLoading(context);
try {
GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 1, isGpsRequired: isQrLocationEnabled, lat: lat, long: lng, QRValue: qrCodeValue);
bool status = await model.fetchAttendanceTracking(context);
Utils.hideLoading(context);
} catch (ex) {
print(ex);
Utils.hideLoading(context);
Utils.handleException(ex, context, (msg) {
Utils.confirmDialog(context, msg);
});
}
}
}
Widget attendanceMethod(String title, String image, bool isEnabled, VoidCallback onPress) => Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
@ -317,7 +361,11 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child: SvgPicture.asset(image)),
Expanded(
child: SvgPicture.asset(
image,
color: Colors.white,
)),
title.toText17(isBold: true, color: Colors.white),
],
),

@ -1,8 +1,12 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/ui/dialogs/id/employee_digital_id_dialog.dart';
import 'package:mohem_flutter_app/ui/landing/widget/drawer_item.dart';
import 'package:mohem_flutter_app/widgets/dialogs/dialogs.dart';
import 'package:mohem_flutter_app/ui/dialogs/id/business_card_dialog.dart';
class AppDrawer extends StatefulWidget {
@override
_AppDrawerState createState() => _AppDrawerState();
@ -36,24 +40,47 @@ class _AppDrawerState extends State<AppDrawer> {
}),
const Divider(),
InkWell(
child: const DrawerItem(
'Mowadhafhi',
icon: Icons.person,
color: Colors.grey,
),
onTap: () {
drawerNavigator(context, AppRoutes.mowadhafhi);
}),
child: const DrawerItem(
'Mowadhafhi',
icon: Icons.person,
color: Colors.grey,
),
onTap: () {
drawerNavigator(context, AppRoutes.mowadhafhi);
},
),
const Divider(),
InkWell(
child: const DrawerItem(
'Pending Transactions',
icon: Icons.person,
color: Colors.grey,
),
onTap: () {
drawerNavigator(context, AppRoutes.pendingTransactions);
})
child: const DrawerItem(
'Pending Transactions',
icon: Icons.person,
color: Colors.grey,
),
onTap: () {
drawerNavigator(context, AppRoutes.pendingTransactions);
},
),
InkWell(
child: DrawerItem(
'Employee Digital ID',
icon: Icons.insert_drive_file_outlined,
color: Colors.grey,
),
onTap: () {
showMDialog(context, child: EmployeeDigitialIdDialog());
},
),
Divider(),
InkWell(
child: DrawerItem(
'Business Card',
icon: Icons.insert_drive_file_outlined,
color: Colors.grey,
),
onTap: () {
showMDialog(context, child: BusinessCardDialog());
},
),
],
),
)

@ -32,7 +32,7 @@ class _DrawerItemState extends State<DrawerItem> {
if (widget.assetLink == null)
Icon(
widget.icon,
color: widget.color ?? Colors.black87,
color: widget.color,
size: 25,
),
Expanded(

@ -40,53 +40,63 @@ class _ProfileScreenState extends State<ProfileScreen> {
backgroundColor: const Color(0xffefefef),
body: Stack(children: [
Container(
height: 300,
margin: EdgeInsets.only(top: 50),
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(
decoration: new BoxDecoration(color: Colors.white.withOpacity(0.0)),
),
)),
height: 300,
margin: EdgeInsets.only(top: 50),
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(
decoration: new BoxDecoration(color: Colors.white.withOpacity(0.0)),
),
),
),
SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
SizedBox(
height: 80,
),
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 80,
),
Container(
padding: EdgeInsets.only(left: 15, right: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
onPressed: () {
Navigator.pop(context);
},
icon: Icon(
Icons.arrow_back_ios,
color: Colors.white,
)),
onPressed: () {
Navigator.pop(context);
},
icon: Icon(
Icons.arrow_back_ios,
color: Colors.white,
),
),
InkWell(
onTap: () {
startImageSheet();
},
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 5),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(15), color: Colors.black.withOpacity(.3)),
child: Row(children: [
Icon(Icons.photo, color: Colors.white),
Text(
'Edit',
style: TextStyle(color: Colors.white, fontSize: 12),
)
]))),
onTap: () {
startImageSheet();
},
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 5),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(15), color: Colors.black.withOpacity(.3)),
child: Row(
children: [
Icon(Icons.photo, color: Colors.white),
Text(
'Edit',
style: TextStyle(color: Colors.white, fontSize: 12),
)
],
),
),
),
],
)),
HeaderPanel(memberInformationList),
ProfilePanle(memberInformationList)
]),
),
),
HeaderPanel(memberInformationList),
ProfilePanle(memberInformationList)
],
),
)
]));
}

@ -4,16 +4,19 @@ 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;
return Container(
padding: EdgeInsets.symmetric(horizontal: _width / 10, vertical: 0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [],
));
padding: EdgeInsets.symmetric(horizontal: _width / 10, vertical: 0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [],
),
);
}
}

@ -13,6 +13,7 @@ import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listv
class ProfileInFo extends StatelessWidget {
ProfileInFo(this.memberInfo);
MemberInformationListModel memberInfo;
String data = '.';
double sliderValue = 75;
@ -26,68 +27,79 @@ class ProfileInFo extends StatelessWidget {
ProfileMenu(name: LocaleKeys.profile_contactDetails.tr(), icon: 'contact-details.svg', route: AppRoutes.contactDetails, dynamicUrl: ''),
ProfileMenu(name: LocaleKeys.profile_familyDetails.tr(), icon: 'family-members.svg', route: AppRoutes.familyMembers, dynamicUrl: ''),
];
@override
Widget build(BuildContext context) {
return Container(
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
/// card header
customLabel(memberInfo.eMPLOYEENAME.toString(), 22, Colors.black, true),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
/// card header
customLabel(memberInfo.eMPLOYEENAME.toString(), 22, Colors.black, true),
customLabel(memberInfo.eMPLOYEENUMBER.toString() + ' | ' + memberInfo.jOBNAME.toString(), 14, Colors.grey, false),
customLabel(memberInfo.eMPLOYEENUMBER.toString() + ' | ' + memberInfo.jOBNAME.toString(), 14, Colors.grey, false),
customLabel(memberInfo.eMPLOYEEEMAILADDRESS.toString(), 13, Colors.black, true),
customLabel(memberInfo.eMPLOYEEEMAILADDRESS.toString(), 13, Colors.black, true),
Divider(height: 40, thickness: 8, color: const Color(0xffefefef)),
Divider(height: 40, thickness: 8, color: const Color(0xffefefef)),
customLabel(LocaleKeys.completingYear.tr(), 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(LocaleKeys.year.tr(), 14, const Color(0xff808080), true), customLabel(memberInfo.sERVICEYEARS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)],
),
Column(
children: [customLabel(LocaleKeys.month.tr(), 14, const Color(0xff808080), true), customLabel(memberInfo.sERVICEMONTHS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)],
),
Column(
children: [customLabel(LocaleKeys.day.tr(), 14, const Color(0xff808080), true), customLabel(memberInfo.sERVICEDAYS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)],
)
])),
SizedBox(height: 10),
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Column(
children: [customLabel(LocaleKeys.year.tr(), 14, const Color(0xff808080), true), customLabel(memberInfo.sERVICEYEARS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)],
),
Column(
children: [customLabel(LocaleKeys.month.tr(), 14, const Color(0xff808080), true), customLabel(memberInfo.sERVICEMONTHS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)],
),
Column(
children: [customLabel(LocaleKeys.day.tr(), 14, const Color(0xff808080), true), customLabel(memberInfo.sERVICEDAYS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)],
)
],
),
),
Divider(height: 40, thickness: 8, color: const Color(0xffefefef)),
Container(
padding: EdgeInsets.only(
left: 20,
right: 20,
Divider(height: 40, thickness: 8, color: const Color(0xffefefef)),
Container(
padding: EdgeInsets.only(
left: 20,
right: 20,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
customLabel(LocaleKeys.profile_profileCompletionPer.tr() + ' 75%', 18, Colors.black, true),
const SizedBox(height: 10),
Row(
children: [
for (var i = 0; i < 4; i++)
if (i < 3) Expanded(child: drawSlider(Color(0xff2BB8A6))) else Expanded(child: drawSlider(const Color(0xffefefef)))
],
),
const SizedBox(height: 10),
Text(
LocaleKeys.profile_completeProfile.tr(),
style: TextStyle(color: Color(0xff2BB8A6), fontWeight: FontWeight.bold, decoration: TextDecoration.underline),
),
],
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
customLabel(LocaleKeys.profile_profileCompletionPer.tr() + ' 75%', 18, Colors.black, true),
const SizedBox(height: 10),
Row(
children: [
for (var i = 0; i < 4; i++)
if (i < 3) Expanded(child: drawSlider(Color(0xff2BB8A6))) else Expanded(child: drawSlider(const Color(0xffefefef)))
],
),
const SizedBox(height: 10),
Text(
LocaleKeys.profile_completeProfile.tr(),
style: TextStyle(color: Color(0xff2BB8A6), fontWeight: FontWeight.bold, decoration: TextDecoration.underline),
),
],
)),
/// description
Divider(height: 50, thickness: 8, color: const Color(0xffefefef)),
/// description
Divider(height: 50, thickness: 8, color: const Color(0xffefefef)),
Column(
children: menu.map((i) => rowItem(i, context)).toList(),
)
]));
Column(
children: menu.map((i) => rowItem(i, context)).toList(),
)
],
),
);
}
Widget drawSlider(color) {

@ -6,7 +6,9 @@ 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;
@ -19,9 +21,10 @@ class ProfilePanle extends StatelessWidget {
margin: EdgeInsets.only(top: 50),
padding: EdgeInsets.only(top: 50),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)),
boxShadow: [BoxShadow(color: Colors.white60, blurRadius: 10, spreadRadius: 10)]),
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(memberInformationList),
),
Container(height: 100, alignment: Alignment.center, child: ProfileImage())

@ -0,0 +1,16 @@
import 'package:flutter/material.dart';
void showMDialog(
context, {
Widget? child,
}) async {
return showDialog(
context: context,
barrierDismissible: true,
builder: (context) {
return Dialog(
child: child,
);
},
);
}

@ -0,0 +1,76 @@
import 'package:flutter/material.dart';
import 'package:qr_code_scanner/qr_code_scanner.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
class QrScannerDialog extends StatefulWidget {
@override
State<QrScannerDialog> createState() => _QrScannerDialogState();
}
class _QrScannerDialogState extends State<QrScannerDialog> {
final GlobalKey qrKey = GlobalKey(debugLabel: 'QR');
Barcode? result;
QRViewController? controller;
bool isPicked = false;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
width: double.infinity,
height: double.infinity,
color: Colors.white,
child: Column(
children: [
Expanded(
flex: 1,
child: QRView(
key: qrKey,
onQRViewCreated: _onQRViewCreated,
),
),
// Expanded(
// flex: 1,
// child: Center(
// child: (result != null)
// ? Text(
// 'Barcode Type: ${result!.format} Data: ${result!.code}')
// : Text('Scan a code'),
// ),
// ),
Padding(
padding: const EdgeInsets.all(12.0),
child: DefaultButton(
"Cancel",
() {
Navigator.pop(context);
},
),
),
],
),
),
);
}
void _onQRViewCreated(QRViewController controller) {
this.controller = controller;
controller.scannedDataStream.listen((scanData) {
setState(() {
result = scanData;
if (!isPicked) {
isPicked = true;
Navigator.pop(context, result!.code);
}
});
});
}
@override
void dispose() {
controller?.dispose();
super.dispose();
}
}

@ -40,7 +40,7 @@ dependencies:
easy_localization: ^3.0.0
http: ^0.13.4
permission_handler: ^9.2.0
flutter_svg: ^0.23.0+1
flutter_svg: any
sizer: ^2.0.15
local_auth: ^1.1.9
fluttertoast: ^8.0.8
@ -68,6 +68,14 @@ dependencies:
open_file: ^3.2.1
wifi_iot: ^0.3.16
flutter_html: ^2.2.1
# flutter_barcode_scanner: ^2.0.0
qr_code_scanner: ^1.0.0
qr_flutter: ^4.0.0
dev_dependencies:
flutter_test:

Loading…
Cancel
Save