From 04062a3189f33f94697b70b7e58f433e7069ae93 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 23 Jul 2023 12:15:26 +0300 Subject: [PATCH] HMG Employee digital ID updated --- lib/app_state/app_state.dart | 2 +- lib/classes/consts.dart | 4 +- .../id/employee_digital_id_dialog.dart | 153 +++++++++++------- 3 files changed, 101 insertions(+), 58 deletions(-) diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index bc59b74..f265bf9 100644 --- a/lib/app_state/app_state.dart +++ b/lib/app_state/app_state.dart @@ -90,7 +90,7 @@ class AppState { String get getHuaweiPushToken => _huaweiPushToken; - final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 33, versionID: 4.8, mobileType: Platform.isAndroid ? "android" : "ios"); + final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 33, versionID: 4.9, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { isAuthenticated = false; diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 32b3fc7..45ef661 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -3,8 +3,8 @@ import 'package:mohem_flutter_app/ui/marathon/widgets/question_card.dart'; class ApiConsts { //static String baseUrl = "http://10.200.204.20:2801/"; // Local server // static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server - static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server - // static String baseUrl = "https://hmgwebservices.com"; // Live server + // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server + static String baseUrl = "https://hmgwebservices.com"; // Live server static String baseUrlServices = baseUrl + "/Services/"; // server // static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/"; diff --git a/lib/ui/dialogs/id/employee_digital_id_dialog.dart b/lib/ui/dialogs/id/employee_digital_id_dialog.dart index 63a5e29..62dacab 100644 --- a/lib/ui/dialogs/id/employee_digital_id_dialog.dart +++ b/lib/ui/dialogs/id/employee_digital_id_dialog.dart @@ -1,23 +1,19 @@ -import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_svg/svg.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; +import 'package:mohem_flutter_app/classes/utils.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/widgets/button/default_button.dart'; - -import 'package:mohem_flutter_app/classes/utils.dart'; class EmployeeDigitialIdDialog extends StatelessWidget { @override Widget build(BuildContext context) { return Container( width: double.infinity, + // height: 700.0, child: Column( mainAxisSize: MainAxisSize.min, children: [ - Image.asset("assets/images/bn_logo.png"), Padding( padding: const EdgeInsets.all(20.0), child: Column( @@ -25,69 +21,116 @@ class EmployeeDigitialIdDialog extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Row( - children: [ - Container( - width: 80, - height: 80, - decoration: const BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(12)), - boxShadow: [BoxShadow(color: Colors.white60, blurRadius: 10, spreadRadius: 10)], - ), - clipBehavior: Clip.antiAlias, - child: (AppState().memberInformationList!.eMPLOYEEIMAGE == null || AppState().memberInformationList!.eMPLOYEEIMAGE!.isEmpty) - ? Container( - color: Colors.grey[300], - child: SvgPicture.asset("assets/images/user.svg"), - ) - : Image.memory( - Utils.dataFromBase64String( - AppState().memberInformationList!.eMPLOYEEIMAGE ?? "", - ), - fit: BoxFit.cover, - ), - ), - 16.width, - (AppState().memberInformationList!.eMPLOYEENUMBER ?? "").toText20(), - ], - ), + 44.height, Container( - width: double.infinity, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - 12.height, - (AppState().memberInformationList!.eMPLOYEEDISPLAYNAME ?? "").toText16(), - 4.height, - (showJobName(AppState().memberInformationList!.pOSITIONNAME ?? "")).toText12(isBold: false), - ], + width: 141, + height: 141, + decoration: const BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(12)), + boxShadow: [BoxShadow(color: Colors.white60, blurRadius: 10, spreadRadius: 10)], ), + clipBehavior: Clip.antiAlias, + child: (AppState().memberInformationList!.eMPLOYEEIMAGE == null || AppState().memberInformationList!.eMPLOYEEIMAGE!.isEmpty) + ? Container( + color: Colors.grey[300], + child: SvgPicture.asset("assets/images/user.svg"), + ) + : Image.memory( + Utils.dataFromBase64String( + AppState().memberInformationList!.eMPLOYEEIMAGE ?? "", + ), + fit: BoxFit.cover, + ), ), + 5.height, + (AppState().memberInformationList!.eMPLOYEENUMBER ?? "").toText21(), + 27.height, + (AppState().memberInformationList!.eMPLOYEENAME ?? "").toText21(), + (AppState().memberInformationList!.getPositionName() ?? "").toText16(color: Colors.grey[800]), + 20.height, Image.memory( Utils.getPostBytes(AppState().memberInformationList!.employeeQR ?? ""), - width: 160, - height: 160, + width: 150, + height: 150, ), - DefaultButton(LocaleKeys.close.tr(), () { - Navigator.pop(context); - }) + 27.height, + Image.asset("assets/images/logos/bn_hmg_logo.png"), ], ), ), ], + // 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: const BoxDecoration( + // color: Colors.white, + // borderRadius: BorderRadius.all(Radius.circular(12)), + // boxShadow: [BoxShadow(color: Colors.white60, blurRadius: 10, spreadRadius: 10)], + // ), + // clipBehavior: Clip.antiAlias, + // child: (AppState().memberInformationList!.eMPLOYEEIMAGE == null || AppState().memberInformationList!.eMPLOYEEIMAGE!.isEmpty) + // ? Container( + // color: Colors.grey[300], + // child: SvgPicture.asset("assets/images/user.svg"), + // ) + // : Image.memory( + // Utils.dataFromBase64String( + // 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!.eMPLOYEEDISPLAYNAME ?? "").toText16(), + // 4.height, + // (showJobName(AppState().memberInformationList!.pOSITIONNAME ?? "")).toText12(isBold: false), + // ], + // ), + // ), + // Image.memory( + // Utils.getPostBytes(AppState().memberInformationList!.employeeQR ?? ""), + // width: 160, + // height: 160, + // ), + // DefaultButton(LocaleKeys.close.tr(), () { + // Navigator.pop(context); + // }) + // ], + // ), + // ), + // ], ), ); } - String showJobName(String position){ - try{ - var p=position.split("."); - return p[0]+" "+p[1]; - }catch(e){ + String showJobName(String position) { + try { + var p = position.split("."); + return p[0] + " " + p[1]; + } catch (e) { return ""; } - } }