Merge branch 'master' into development_faiz

# Conflicts:
#	lib/ui/login/login_screen.dart
#	lib/ui/marathon/marathon_screen.dart
merge-requests/38/head
FaizHashmiCS22 3 years ago
commit 710ec44293

File diff suppressed because one or more lines are too long

@ -345,6 +345,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES;
@ -363,7 +364,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
@ -382,11 +383,11 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 99Z3UD3LJM; DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Mohemm; INFOPLIST_KEY_CFBundleDisplayName = Mohemm;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -423,6 +424,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES;
@ -447,7 +449,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES; MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
@ -478,6 +480,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES;
@ -496,10 +499,11 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
@ -516,11 +520,11 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 99Z3UD3LJM; DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Mohemm; INFOPLIST_KEY_CFBundleDisplayName = Mohemm;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -545,11 +549,11 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 99Z3UD3LJM; DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Mohemm; INFOPLIST_KEY_CFBundleDisplayName = Mohemm;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",

@ -27,8 +27,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"> shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion> <MacroExpansion>
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
@ -38,8 +36,8 @@
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
</MacroExpansion> </MacroExpansion>
<AdditionalOptions> <Testables>
</AdditionalOptions> </Testables>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Debug" buildConfiguration = "Debug"
@ -61,8 +59,6 @@
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction> </LaunchAction>
<ProfileAction <ProfileAction
buildConfiguration = "Profile" buildConfiguration = "Profile"

@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert';
import 'package:mohem_flutter_app/api/api_client.dart'; import 'package:mohem_flutter_app/api/api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
@ -9,8 +10,12 @@ import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_
import 'package:mohem_flutter_app/models/dashboard/itg_forms_model.dart'; import 'package:mohem_flutter_app/models/dashboard/itg_forms_model.dart';
import 'package:mohem_flutter_app/models/dashboard/list_menu.dart'; import 'package:mohem_flutter_app/models/dashboard/list_menu.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart'; import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/itg/itg_main_response.dart';
import 'package:mohem_flutter_app/models/itg/itg_response_model.dart';
import 'package:uuid/uuid.dart'; import 'package:uuid/uuid.dart';
class DashboardApiClient { class DashboardApiClient {
static final DashboardApiClient _instance = DashboardApiClient._internal(); static final DashboardApiClient _instance = DashboardApiClient._internal();
@ -40,10 +45,7 @@ class DashboardApiClient {
Future<GenericResponseModel?> getCOCNotifications() async { Future<GenericResponseModel?> getCOCNotifications() async {
String url = "${ApiConsts.cocRest}Mohemm_ITG_ReviewerAdmin_Pending_Tasks"; String url = "${ApiConsts.cocRest}Mohemm_ITG_ReviewerAdmin_Pending_Tasks";
Map<String, dynamic> postParams = { Map<String, dynamic> postParams = {"Date": DateUtil.getISODateFormat(DateTime.now()), "EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER};
"Date": DateUtil.getISODateFormat(DateTime.now()),
"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER
};
postParams.addAll(AppState().postParamsJson); postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) { return await ApiClient().postJsonForObject((json) {
@ -62,8 +64,7 @@ class DashboardApiClient {
}, url, postParams); }, url, postParams);
} }
Future<List<GetAccrualBalancesList>> getAccrualBalances( Future<List<GetAccrualBalancesList>> getAccrualBalances(String effectiveDate) async {
String effectiveDate) async {
String url = "${ApiConsts.erpRest}GET_ACCRUAL_BALANCES"; String url = "${ApiConsts.erpRest}GET_ACCRUAL_BALANCES";
Map<String, dynamic> postParams = {"P_EFFECTIVE_DATE": effectiveDate}; Map<String, dynamic> postParams = {"P_EFFECTIVE_DATE": effectiveDate};
postParams.addAll(AppState().postParamsJson); postParams.addAll(AppState().postParamsJson);
@ -97,10 +98,7 @@ class DashboardApiClient {
//GET_MENU_ENTRIES //GET_MENU_ENTRIES
Future<GenericResponseModel?> getGetMenuEntries() async { Future<GenericResponseModel?> getGetMenuEntries() async {
String url = "${ApiConsts.erpRest}GET_MENU_ENTRIES"; String url = "${ApiConsts.erpRest}GET_MENU_ENTRIES";
Map<String, dynamic> postParams = { Map<String, dynamic> postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E"};
"P_SELECTED_RESP_ID": -999,
"P_MENU_TYPE": "E"
};
postParams.addAll(AppState().postParamsJson); postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) { return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json); GenericResponseModel responseData = GenericResponseModel.fromJson(json);
@ -109,13 +107,7 @@ class DashboardApiClient {
} }
//Mark Attendance //Mark Attendance
Future<GenericResponseModel?> markAttendance( Future<GenericResponseModel?> markAttendance({String lat = "0", String? long = "0", required int pointType, String nfcValue = "", bool isGpsRequired = false, String QRValue = ""}) async {
{String lat = "0",
String? long = "0",
required int pointType,
String nfcValue = "",
bool isGpsRequired = false,
String QRValue = ""}) async {
String url = "${ApiConsts.swpRest}AuthenticateAndSwipeUserSupportNFC"; String url = "${ApiConsts.swpRest}AuthenticateAndSwipeUserSupportNFC";
var uuid = Uuid(); var uuid = Uuid();
// Generate a v4 (random) id // Generate a v4 (random) id
@ -136,4 +128,54 @@ class DashboardApiClient {
return responseData; return responseData;
}, url, postParams); }, url, postParams);
} }
//Check ITG Type
Future<MohemmItgResponseItem?> getITGPageNotification() async {
String url = "${ApiConsts.cocRest}Mohemm_ITG_GetPageNotification";
Map<String, dynamic> postParams = {
"EmployeeNumber": AppState().getUserName,
"ItgEnableAt": "After Service Submission", //Mobile Id
"ItgServiceName": "Login"
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
MohemmItgResponseItem res = MohemmItgResponseItem.fromJson(jsonDecode(responseData.mohemmITGResponseItem ?? ""));
// var jsonDecodedData = jsonDecode(jsonDecode(responseData.mohemmITGResponseItem!)['result']['data']);
return res;
}, url, postParams);
}
//Submit ITG
Future<ItgMainRes?> submitItgForm({required String comment, required String masterId, required List<Map<String, dynamic>> itgList, required int serviceId}) async {
String url = "${ApiConsts.cocRest}Mohemm_ITG_Survey_Response";
Map<String, dynamic> postParams = {
"EmployeeNumber": AppState().getUserName,
"ItgComments": comment,
"ItgNotificationMasterId": masterId,
"ItgQuestionResponses": itgList,
"ItgSurveyId": serviceId
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
ItgMainRes responseData = ItgMainRes.fromJson(json);
return responseData;
}, url, postParams);
}
Future<ItgMainRes?> getAdvertisementDetail(String masterID) async {
String url = "${ApiConsts.cocRest}Mohemm_ITG_GetPageNotificationDetails";
Map<String, dynamic> postParams = {
"EmployeeNumber": AppState().getUserName,
"ItgNotificationMasterId": masterID, //Mobile Id
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
ItgMainRes responseData = ItgMainRes.fromJson(json);
return responseData;
}, url, postParams);
}
} }

@ -6,7 +6,7 @@ import 'package:mohem_flutter_app/ui/bottom_sheets/attendence_details_bottom_she
import 'package:mohem_flutter_app/ui/chat/chat_detailed_screen.dart'; import 'package:mohem_flutter_app/ui/chat/chat_detailed_screen.dart';
import 'package:mohem_flutter_app/ui/chat/chat_home.dart'; import 'package:mohem_flutter_app/ui/chat/chat_home.dart';
import 'package:mohem_flutter_app/ui/landing/dashboard_screen.dart'; import 'package:mohem_flutter_app/ui/landing/dashboard_screen.dart';
import 'package:mohem_flutter_app/ui/landing/survey_screen.dart'; import 'package:mohem_flutter_app/ui/landing/itg/survey_screen.dart';
import 'package:mohem_flutter_app/ui/landing/today_attendance_screen.dart'; import 'package:mohem_flutter_app/ui/landing/today_attendance_screen.dart';
import 'package:mohem_flutter_app/ui/leave_balance/add_leave_balance_screen.dart'; import 'package:mohem_flutter_app/ui/leave_balance/add_leave_balance_screen.dart';
import 'package:mohem_flutter_app/ui/leave_balance/leave_balance_screen.dart'; import 'package:mohem_flutter_app/ui/leave_balance/leave_balance_screen.dart';

@ -10,36 +10,19 @@ extension CapExtension on String {
String get allInCaps => this.toUpperCase(); String get allInCaps => this.toUpperCase();
String get capitalizeFirstofEach => this.trim().length > 0 String get capitalizeFirstofEach => this.trim().length > 0 ? this.trim().toLowerCase().split(" ").map((str) => str.inCaps).join(" ") : "";
? this.trim().toLowerCase().split(" ").map((str) => str.inCaps).join(" ")
: "";
} }
extension EmailValidator on String { extension EmailValidator on String {
Widget get toWidget => Text(this); Widget get toWidget => Text(this);
Widget toText10( Widget toText10({Color? color, bool isBold = false, int? maxlines, FontStyle? fontStyle}) => Text(
{Color? color,
bool isBold = false,
int? maxlines,
FontStyle? fontStyle}) =>
Text(
this, this,
//maxLines: maxlines, //maxLines: maxlines,
style: TextStyle( style: TextStyle(fontSize: 10, fontStyle: fontStyle ?? FontStyle.normal, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4),
fontSize: 10,
fontStyle: fontStyle ?? FontStyle.normal,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
color: color ?? MyColors.darkTextColor,
letterSpacing: -0.4),
); );
Widget toText11( Widget toText11({Color? color, FontWeight? weight, bool isUnderLine = false, bool isBold = false}) => Text(
{Color? color,
FontWeight? weight,
bool isUnderLine = false,
bool isBold = false}) =>
Text(
this, this,
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: 11,
@ -50,13 +33,7 @@ extension EmailValidator on String {
), ),
); );
Widget toText12( Widget toText12({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, int maxLine = 0}) => Text(
{Color? color,
bool isUnderLine = false,
bool isBold = false,
bool isCenter = false,
int maxLine = 0}) =>
Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
maxLines: (maxLine > 0) ? maxLine : null, maxLines: (maxLine > 0) ? maxLine : null,
@ -69,13 +46,7 @@ extension EmailValidator on String {
), ),
); );
Widget toText12Auto( Widget toText12Auto({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, int maxLine = 0}) => AutoSizeText(
{Color? color,
bool isUnderLine = false,
bool isBold = false,
bool isCenter = false,
int maxLine = 0}) =>
AutoSizeText(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
maxLines: (maxLine > 0) ? maxLine : null, maxLines: (maxLine > 0) ? maxLine : null,
@ -89,28 +60,47 @@ extension EmailValidator on String {
), ),
); );
Widget toText13({Color? color, bool isUnderLine = false}) => Text( Widget toTextAuto({
Color? color,
bool isUnderLine = false,
bool isBold = false,
bool isCenter = false,
int maxLine = 0,
double fontSize = 12,
double letterSpacing = -0.72,
double height = 1,
}) =>
AutoSizeText(
this, this,
textAlign: isCenter ? TextAlign.center : null,
maxLines: (maxLine > 0) ? maxLine : null,
minFontSize: 8,
style: TextStyle( style: TextStyle(
fontSize: 13, fontSize: fontSize,
fontWeight: FontWeight.w600, fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
color: color ?? MyColors.darkTextColor, color: color ?? MyColors.darkTextColor,
letterSpacing: -0.52, letterSpacing: letterSpacing,
decoration: isUnderLine ? TextDecoration.underline : null), decoration: isUnderLine ? TextDecoration.underline : null,
),
);
Widget toText13({Color? color, bool isUnderLine = false}) => Text(
this,
style: TextStyle(fontSize: 13, fontWeight: FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.52, decoration: isUnderLine ? TextDecoration.underline : null),
); );
Widget toText14({Color? color, bool isUnderLine = false, bool isBold = false, FontWeight? weight, int? maxlines}) => Text( Widget toText14({Color? color, bool isUnderLine = false, bool isBold = false, FontWeight? weight, int? maxlines}) => Text(
this, this,
maxLines: maxlines, maxLines: maxlines,
style: TextStyle(color: color ?? MyColors.darkTextColor, fontSize: 14, letterSpacing: -0.48, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.w600), decoration: isUnderLine ? TextDecoration.underline : null), style: TextStyle(
color: color ?? MyColors.darkTextColor,
fontSize: 14,
letterSpacing: -0.48,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.w600),
decoration: isUnderLine ? TextDecoration.underline : null),
); );
Widget toText16( Widget toText16({Color? color, bool isUnderLine = false, bool isBold = false, int? maxlines}) => Text(
{Color? color,
bool isUnderLine = false,
bool isBold = false,
int? maxlines}) =>
Text(
this, this,
maxLines: maxlines, maxLines: maxlines,
style: TextStyle( style: TextStyle(
@ -124,97 +114,51 @@ extension EmailValidator on String {
Widget toText17({Color? color, bool isBold = false}) => Text( Widget toText17({Color? color, bool isBold = false}) => Text(
this, this,
style: TextStyle( style: TextStyle(color: color ?? MyColors.darkTextColor, fontSize: 17, letterSpacing: -0.68, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
color: color ?? MyColors.darkTextColor,
fontSize: 17,
letterSpacing: -0.68,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
); );
Widget toText18({Color? color, bool isBold = false}) => Text( Widget toText18({Color? color, bool isBold = false}) => Text(
this, this,
style: TextStyle( style: TextStyle(fontSize: 18, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -1.08),
fontSize: 18,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
color: color ?? MyColors.darkTextColor,
letterSpacing: -1.08),
); );
Widget toText19({Color? color, bool isBold = false}) => Text( Widget toText19({Color? color, bool isBold = false}) => Text(
this, this,
style: TextStyle( style: TextStyle(fontSize: 19, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -1.14),
fontSize: 19,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
color: color ?? MyColors.darkTextColor,
letterSpacing: -1.14),
); );
Widget toText20({Color? color, bool isBold = false}) => Text( Widget toText20({Color? color, bool isBold = false}) => Text(
this, this,
style: TextStyle( style: TextStyle(fontSize: 20, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4),
fontSize: 20,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
color: color ?? MyColors.darkTextColor,
letterSpacing: -0.4),
); );
Widget toText21( Widget toText21({Color? color, bool isBold = false, FontWeight? weight, int? maxlines}) => Text(
{Color? color,
bool isBold = false,
FontWeight? weight,
int? maxlines}) =>
Text(
this, this,
maxLines: maxlines, maxLines: maxlines,
style: TextStyle( style: TextStyle(color: color ?? MyColors.grey3AColor, fontSize: 21, letterSpacing: -0.31, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.w600)),
color: color ?? MyColors.grey3AColor,
fontSize: 21,
letterSpacing: -0.31,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.w600)),
); );
Widget toText22({Color? color, bool isBold = false}) => Text( Widget toText22({Color? color, bool isBold = false}) => Text(
this, this,
style: TextStyle( style: TextStyle(height: 1, color: color ?? MyColors.darkTextColor, fontSize: 22, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
height: 1,
color: color ?? MyColors.darkTextColor,
fontSize: 22,
letterSpacing: -1.44,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
); );
Widget toText24({Color? color, bool isBold = false}) => Text( Widget toText24({Color? color, bool isBold = false}) => Text(
this, this,
style: TextStyle( style: TextStyle(height: 23 / 24, color: color ?? MyColors.darkTextColor, fontSize: 24, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
height: 23 / 24,
color: color ?? MyColors.darkTextColor,
fontSize: 24,
letterSpacing: -1.44,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
); );
Widget toText32({Color? color, bool isBold = false}) => Text( Widget toText32({Color? color, bool isBold = false}) => Text(
this, this,
style: TextStyle( style: TextStyle(height: 32 / 32, color: color ?? MyColors.darkTextColor, fontSize: 32, letterSpacing: -1.92, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
height: 32 / 32,
color: color ?? MyColors.darkTextColor,
fontSize: 32,
letterSpacing: -1.92,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
); );
Widget toText44({Color? color, bool isBold = false}) => Text( Widget toText44({Color? color, bool isBold = false}) => Text(
this, this,
style: TextStyle( style: TextStyle(height: 32 / 32, color: color ?? MyColors.darkTextColor, fontSize: 44, letterSpacing: -2.64, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
height: 32 / 32,
color: color ?? MyColors.darkTextColor,
fontSize: 44,
letterSpacing: -2.64,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
); );
Widget toSectionHeading( Widget toSectionHeading({String upperHeading = "", String lowerHeading = ""}) {
{String upperHeading = "", String lowerHeading = ""}) {
String upper = ""; String upper = "";
String lower = ""; String lower = "";
String heading = this; String heading = this;
@ -247,9 +191,7 @@ extension EmailValidator on String {
} }
bool isValidEmail() { bool isValidEmail() {
return RegExp( return RegExp(r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$').hasMatch(this);
r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$')
.hasMatch(this);
} }
String toFormattedDate() { String toFormattedDate() {

@ -932,7 +932,7 @@ static const Map<String,dynamic> en_US = {
"updateMember": "Are You Sure You Want to Update this Member?", "updateMember": "Are You Sure You Want to Update this Member?",
"fieldIsEmpty": "'{data}' Field is empty. Please select", "fieldIsEmpty": "'{data}' Field is empty. Please select",
"pleaseEnterComments": "Please enter comments", "pleaseEnterComments": "Please enter comments",
"skip": "skip", "skip": "Skip",
"typeCurrentPasswordBelow": "Type Your Current password below", "typeCurrentPasswordBelow": "Type Your Current password below",
"currentPassword": "Current password", "currentPassword": "Current password",
"profile": { "profile": {

@ -0,0 +1,99 @@
class Advertisement {
Advertisement({
this.advertisementId,
this.advertisementTitle,
this.durationInSeconds,
this.showDelete,
this.acknowledgment,
this.viewAttachFileColl,
this.isActive,
this.pageSize,
this.pageNo,
this.languageId,
});
final int? advertisementId;
final String? advertisementTitle;
final int? durationInSeconds;
final bool? showDelete;
final dynamic acknowledgment;
final List<ViewAttachFileColl>? viewAttachFileColl;
final bool? isActive;
final dynamic pageSize;
final dynamic pageNo;
final dynamic languageId;
factory Advertisement.fromJson(Map<String, dynamic> json) => Advertisement(
advertisementId: json["advertisementId"] == null ? null : json["advertisementId"],
advertisementTitle: json["advertisementTitle"] == null ? null : json["advertisementTitle"],
durationInSeconds: json["durationInSeconds"] == null ? null : json["durationInSeconds"],
showDelete: json["showDelete"] == null ? null : json["showDelete"],
acknowledgment: json["acknowledgment"],
viewAttachFileColl: json["viewAttachFileColl"] == null ? null : List<ViewAttachFileColl>.from(json["viewAttachFileColl"].map((x) => ViewAttachFileColl.fromJson(x))),
isActive: json["isActive"] == null ? null : json["isActive"],
pageSize: json["pageSize"],
pageNo: json["pageNo"],
languageId: json["languageId"],
);
Map<String, dynamic> toJson() => {
"advertisementId": advertisementId == null ? null : advertisementId,
"advertisementTitle": advertisementTitle == null ? null : advertisementTitle,
"durationInSeconds": durationInSeconds == null ? null : durationInSeconds,
"showDelete": showDelete == null ? null : showDelete,
"acknowledgment": acknowledgment,
"viewAttachFileColl": viewAttachFileColl == null ? null : List<dynamic>.from(viewAttachFileColl!.map((x) => x.toJson())),
"isActive": isActive == null ? null : isActive,
"pageSize": pageSize,
"pageNo": pageNo,
"languageId": languageId,
};
}
class ViewAttachFileColl {
ViewAttachFileColl({
this.attachmentId,
this.fileName,
this.contentType,
this.attachFileStream,
this.base64String,
this.isActive,
this.referenceItemId,
this.content,
this.filePath,
});
final dynamic attachmentId;
final String? fileName;
final String? contentType;
final dynamic attachFileStream;
final String? base64String;
final dynamic isActive;
final dynamic referenceItemId;
final dynamic content;
final dynamic filePath;
factory ViewAttachFileColl.fromJson(Map<String, dynamic> json) => ViewAttachFileColl(
attachmentId: json["attachmentId"],
fileName: json["fileName"] == null ? null : json["fileName"],
contentType: json["contentType"] == null ? null : json["contentType"],
attachFileStream: json["attachFileStream"],
base64String: json["base64String"] == null ? null : json["base64String"],
isActive: json["isActive"],
referenceItemId: json["referenceItemId"],
content: json["content"],
filePath: json["filePath"],
);
Map<String, dynamic> toJson() => {
"attachmentId": attachmentId,
"fileName": fileName == null ? null : fileName,
"contentType": contentType == null ? null : contentType,
"attachFileStream": attachFileStream,
"base64String": base64String == null ? null : base64String,
"isActive": isActive,
"referenceItemId": referenceItemId,
"content": content,
"filePath": filePath,
};
}

@ -0,0 +1,195 @@
// To parse this JSON data, do
//
// final itgRes = itgResFromJson(jsonString);
import 'dart:convert';
import 'package:mohem_flutter_app/models/itg/itg_response_model.dart';
ItgMainRes itgResFromJson(String str) => ItgMainRes.fromJson(json.decode(str));
String itgResToJson(ItgMainRes data) => json.encode(data.toJson());
class ItgMainRes {
ItgMainRes({
this.date,
this.languageId,
this.serviceName,
this.time,
this.androidLink,
this.authenticationTokenId,
this.data,
this.dataw,
this.dietType,
this.dietTypeId,
this.errorCode,
this.errorEndUserMessage,
this.errorEndUserMessageN,
this.errorMessage,
this.errorType,
this.foodCategory,
this.iosLink,
this.isAuthenticated,
this.mealOrderStatus,
this.mealType,
this.messageStatus,
this.numberOfResultRecords,
this.patientBlodType,
this.successMsg,
this.successMsgN,
this.vidaUpdatedResponse,
this.itgRequest,
this.itgFormAttachmentsList,
this.message,
this.mohemmItgDepartmentSectionsList,
this.mohemmItgPendingTaskResponseItem,
this.mohemmItgProjectDepartmentsList,
this.mohemmItgResponseItem,
this.mohemmItgSectionTopicsList,
this.mohemmItgTicketDetailsList,
this.mohemmItgTicketTransactionsList,
this.mohemmItgTicketsByEmployeeList,
this.mohemmItgProjectsList,
this.mohemmItgTicketTypesList,
this.referenceNumber,
this.requestType,
this.totalCount,
this.statuseCode,
});
final dynamic date;
final int? languageId;
final int? serviceName;
final dynamic time;
final dynamic androidLink;
final dynamic authenticationTokenId;
final dynamic data;
final bool? dataw;
final int? dietType;
final int? dietTypeId;
final dynamic errorCode;
final dynamic errorEndUserMessage;
final dynamic errorEndUserMessageN;
final dynamic errorMessage;
final int? errorType;
final int? foodCategory;
final dynamic iosLink;
final bool? isAuthenticated;
final int? mealOrderStatus;
final int? mealType;
final int? messageStatus;
final int? numberOfResultRecords;
final dynamic patientBlodType;
final dynamic successMsg;
final dynamic successMsgN;
final dynamic vidaUpdatedResponse;
final dynamic itgRequest;
final dynamic itgFormAttachmentsList;
final dynamic message;
final dynamic mohemmItgDepartmentSectionsList;
final dynamic mohemmItgPendingTaskResponseItem;
final dynamic mohemmItgProjectDepartmentsList;
final MohemmItgResponseItem? mohemmItgResponseItem;
final dynamic mohemmItgSectionTopicsList;
final dynamic mohemmItgTicketDetailsList;
final dynamic mohemmItgTicketTransactionsList;
final dynamic mohemmItgTicketsByEmployeeList;
final dynamic mohemmItgProjectsList;
final dynamic mohemmItgTicketTypesList;
final dynamic referenceNumber;
final dynamic requestType;
final int? totalCount;
final int? statuseCode;
factory ItgMainRes.fromJson(Map<String, dynamic> json) => ItgMainRes(
date: json["Date"],
languageId: json["LanguageID"] == null ? null : json["LanguageID"],
serviceName: json["ServiceName"] == null ? null : json["ServiceName"],
time: json["Time"],
androidLink: json["AndroidLink"],
authenticationTokenId: json["AuthenticationTokenID"],
data: json["Data"],
dataw: json["Dataw"] == null ? null : json["Dataw"],
dietType: json["DietType"] == null ? null : json["DietType"],
dietTypeId: json["DietTypeID"] == null ? null : json["DietTypeID"],
errorCode: json["ErrorCode"],
errorEndUserMessage: json["ErrorEndUserMessage"],
errorEndUserMessageN: json["ErrorEndUserMessageN"],
errorMessage: json["ErrorMessage"],
errorType: json["ErrorType"] == null ? null : json["ErrorType"],
foodCategory: json["FoodCategory"] == null ? null : json["FoodCategory"],
iosLink: json["IOSLink"],
isAuthenticated: json["IsAuthenticated"] == null ? null : json["IsAuthenticated"],
mealOrderStatus: json["MealOrderStatus"] == null ? null : json["MealOrderStatus"],
mealType: json["MealType"] == null ? null : json["MealType"],
messageStatus: json["MessageStatus"] == null ? null : json["MessageStatus"],
numberOfResultRecords: json["NumberOfResultRecords"] == null ? null : json["NumberOfResultRecords"],
patientBlodType: json["PatientBlodType"],
successMsg: json["SuccessMsg"],
successMsgN: json["SuccessMsgN"],
vidaUpdatedResponse: json["VidaUpdatedResponse"],
itgRequest: json["ITGRequest"],
itgFormAttachmentsList: json["Itg_FormAttachmentsList"],
message: json["Message"],
mohemmItgDepartmentSectionsList: json["Mohemm_ITG_DepartmentSectionsList"],
mohemmItgPendingTaskResponseItem: json["Mohemm_ITG_Pending_Task_ResponseItem"],
mohemmItgProjectDepartmentsList: json["Mohemm_ITG_ProjectDepartmentsList"],
mohemmItgResponseItem: json["Mohemm_ITG_ResponseItem"] ==null ? null : MohemmItgResponseItem.fromJson(jsonDecode(json["Mohemm_ITG_ResponseItem"])),
mohemmItgSectionTopicsList: json["Mohemm_ITG_SectionTopicsList"],
mohemmItgTicketDetailsList: json["Mohemm_ITG_TicketDetailsList"],
mohemmItgTicketTransactionsList: json["Mohemm_ITG_TicketTransactionsList"],
mohemmItgTicketsByEmployeeList: json["Mohemm_ITG_TicketsByEmployeeList"],
mohemmItgProjectsList: json["Mohemm_Itg_ProjectsList"],
mohemmItgTicketTypesList: json["Mohemm_Itg_TicketTypesList"],
referenceNumber: json["ReferenceNumber"],
requestType: json["RequestType"],
totalCount: json["TotalCount"] == null ? null : json["TotalCount"],
statuseCode: json["statuseCode"] == null ? null : json["statuseCode"],
);
Map<String, dynamic> toJson() => {
"Date": date,
"LanguageID": languageId == null ? null : languageId,
"ServiceName": serviceName == null ? null : serviceName,
"Time": time,
"AndroidLink": androidLink,
"AuthenticationTokenID": authenticationTokenId,
"Data": data,
"Dataw": dataw == null ? null : dataw,
"DietType": dietType == null ? null : dietType,
"DietTypeID": dietTypeId == null ? null : dietTypeId,
"ErrorCode": errorCode,
"ErrorEndUserMessage": errorEndUserMessage,
"ErrorEndUserMessageN": errorEndUserMessageN,
"ErrorMessage": errorMessage,
"ErrorType": errorType == null ? null : errorType,
"FoodCategory": foodCategory == null ? null : foodCategory,
"IOSLink": iosLink,
"IsAuthenticated": isAuthenticated == null ? null : isAuthenticated,
"MealOrderStatus": mealOrderStatus == null ? null : mealOrderStatus,
"MealType": mealType == null ? null : mealType,
"MessageStatus": messageStatus == null ? null : messageStatus,
"NumberOfResultRecords": numberOfResultRecords == null ? null : numberOfResultRecords,
"PatientBlodType": patientBlodType,
"SuccessMsg": successMsg,
"SuccessMsgN": successMsgN,
"VidaUpdatedResponse": vidaUpdatedResponse,
"ITGRequest": itgRequest,
"Itg_FormAttachmentsList": itgFormAttachmentsList,
"Message": message,
"Mohemm_ITG_DepartmentSectionsList": mohemmItgDepartmentSectionsList,
"Mohemm_ITG_Pending_Task_ResponseItem": mohemmItgPendingTaskResponseItem,
"Mohemm_ITG_ProjectDepartmentsList": mohemmItgProjectDepartmentsList,
"Mohemm_ITG_ResponseItem": mohemmItgResponseItem == null ? null : mohemmItgResponseItem,
"Mohemm_ITG_SectionTopicsList": mohemmItgSectionTopicsList,
"Mohemm_ITG_TicketDetailsList": mohemmItgTicketDetailsList,
"Mohemm_ITG_TicketTransactionsList": mohemmItgTicketTransactionsList,
"Mohemm_ITG_TicketsByEmployeeList": mohemmItgTicketsByEmployeeList,
"Mohemm_Itg_ProjectsList": mohemmItgProjectsList,
"Mohemm_Itg_TicketTypesList": mohemmItgTicketTypesList,
"ReferenceNumber": referenceNumber,
"RequestType": requestType,
"TotalCount": totalCount == null ? null : totalCount,
"statuseCode": statuseCode == null ? null : statuseCode,
};
}

@ -0,0 +1,159 @@
// To parse this JSON data, do
//
// final mohemmItgResponseItem = mohemmItgResponseItemFromJson(jsonString);
import 'dart:convert';
import 'package:mohem_flutter_app/models/itg/advertisement.dart';
MohemmItgResponseItem mohemmItgResponseItemFromJson(String str) => MohemmItgResponseItem.fromJson(json.decode(str));
String mohemmItgResponseItemToJson(MohemmItgResponseItem data) => json.encode(data.toJson());
class MohemmItgResponseItem {
MohemmItgResponseItem({
this.statusCode,
this.message,
this.originalErrMsg,
this.result,
});
final int? statusCode;
final dynamic? message;
final dynamic? originalErrMsg;
final ItgResponseResult? result;
factory MohemmItgResponseItem.fromJson(Map<String, dynamic> json) => MohemmItgResponseItem(
statusCode: json["statusCode"] == null ? null : json["statusCode"],
message: json["message"],
originalErrMsg: json["originalErrMsg"],
result: json["result"] == null ? null : ItgResponseResult.fromJson(json["result"]),
);
Map<String, dynamic> toJson() => {
"statusCode": statusCode == null ? null : statusCode,
"message": message,
"originalErrMsg": originalErrMsg,
"result": result == null ? null : result!.toJson(),
};
}
class ItgResponseResult {
ItgResponseResult({
this.totalItemsCount,
this.data,
this.errormsg,
});
final dynamic totalItemsCount;
final ItgResponseData? data;
final dynamic errormsg;
factory ItgResponseResult.fromJson(Map<String, dynamic> json) => ItgResponseResult(
totalItemsCount: json["totalItemsCount"],
data: json["data"] == null ? null : ItgResponseData.fromJson(json["data"]),
errormsg: json["errormsg"],
);
Map<String, dynamic> toJson() => {
"totalItemsCount": totalItemsCount,
"data": data == null ? null : data!.toJson(),
"errormsg": errormsg,
};
}
class ItgResponseData {
ItgResponseData({
this.notificationMasterId,
this.notificationType,
this.referenceItemId,
this.notificationTitle,
this.enableAt,
this.applicationItemId,
this.startDate,
this.endDate,
this.isRepeat,
this.channelId,
this.serviceId,
this.channelName,
this.serviceName,
this.isDeleted,
this.showDelete,
this.advertisement,
this.survey,
this.isActive,
this.pageSize,
this.pageNo,
this.languageId,
});
final String? notificationMasterId;
final String? notificationType;
final int? referenceItemId;
final String? notificationTitle;
final String? enableAt;
final dynamic applicationItemId;
final dynamic startDate;
final dynamic endDate;
final bool? isRepeat;
final int? channelId;
final int? serviceId;
final String? channelName;
final String? serviceName;
final bool? isDeleted;
final bool? showDelete;
final Advertisement? advertisement;
final dynamic survey;
final dynamic isActive;
final dynamic pageSize;
final dynamic pageNo;
final dynamic languageId;
factory ItgResponseData.fromJson(Map<String, dynamic> json) => ItgResponseData(
notificationMasterId: json["notificationMasterId"] == null ? null : json["notificationMasterId"],
notificationType: json["notificationType"] == null ? null : json["notificationType"],
referenceItemId: json["referenceItemId"] == null ? null : json["referenceItemId"],
notificationTitle: json["notificationTitle"] == null ? null : json["notificationTitle"],
enableAt: json["enableAt"] == null ? null : json["enableAt"],
applicationItemId: json["applicationItemId"],
startDate: json["startDate"],
endDate: json["endDate"],
isRepeat: json["isRepeat"] == null ? null : json["isRepeat"],
channelId: json["channelId"] == null ? null : json["channelId"],
serviceId: json["serviceId"] == null ? null : json["serviceId"],
channelName: json["channelName"] == null ? null : json["channelName"],
serviceName: json["serviceName"] == null ? null : json["serviceName"],
isDeleted: json["isDeleted"] == null ? null : json["isDeleted"],
showDelete: json["showDelete"] == null ? null : json["showDelete"],
advertisement: json["advertisement"] == null ? null : Advertisement.fromJson(json["advertisement"]),
survey: json["survey"],
isActive: json["isActive"],
pageSize: json["pageSize"],
pageNo: json["pageNo"],
languageId: json["languageId"],
);
Map<String, dynamic> toJson() => {
"notificationMasterId": notificationMasterId == null ? null : notificationMasterId,
"notificationType": notificationType == null ? null : notificationType,
"referenceItemId": referenceItemId == null ? null : referenceItemId,
"notificationTitle": notificationTitle == null ? null : notificationTitle,
"enableAt": enableAt == null ? null : enableAt,
"applicationItemId": applicationItemId,
"startDate": startDate,
"endDate": endDate,
"isRepeat": isRepeat == null ? null : isRepeat,
"channelId": channelId == null ? null : channelId,
"serviceId": serviceId == null ? null : serviceId,
"channelName": channelName == null ? null : channelName,
"serviceName": serviceName == null ? null : serviceName,
"isDeleted": isDeleted == null ? null : isDeleted,
"showDelete": showDelete == null ? null : showDelete,
"advertisement": advertisement,
"survey": survey,
"isActive": isActive,
"pageSize": pageSize,
"pageNo": pageNo,
"languageId": languageId,
};
}

@ -17,6 +17,7 @@ import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart';
import 'package:mohem_flutter_app/models/dashboard/menus.dart'; import 'package:mohem_flutter_app/models/dashboard/menus.dart';
import 'package:mohem_flutter_app/models/dashboard/mohemm_itg_pending_task_responseitem.dart'; import 'package:mohem_flutter_app/models/dashboard/mohemm_itg_pending_task_responseitem.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart'; import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/itg/itg_response_model.dart';
import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart'; import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart';
/// Mix-in [DiagnosticableTreeMixin] to have access to [debugFillProperties] for the devtool /// Mix-in [DiagnosticableTreeMixin] to have access to [debugFillProperties] for the devtool
@ -248,6 +249,13 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
return menus; return menus;
} }
Future<MohemmItgResponseItem?> getITGNotification() async {
MohemmItgResponseItem? res = await DashboardApiClient().getITGPageNotification();
return res;
}
void notify() { void notify() {
notifyListeners(); notifyListeners();
} }

@ -0,0 +1,33 @@
import 'package:flutter/material.dart';
import 'package:lottie/lottie.dart';
class SuccessDialog extends StatelessWidget {
bool isFromDashboard;
SuccessDialog(this.isFromDashboard);
@override
Widget build(BuildContext context) {
double size = MediaQuery.of(context).size.width / 1.8;
return Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: size,
height: size,
child: Card(
child: Lottie.asset('assets/lottie/lt_success.json', repeat: false, reverse: false, onLoaded: (v) {
print("calling_lottie " + v.seconds.toString());
Future.delayed(Duration(seconds: 2)).then((value) {
Navigator.pop(context);
if (isFromDashboard) Navigator.pop(context);
});
}),
),
),
],
);
}
}

@ -4,6 +4,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/api/dashboard_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/classes/utils.dart';
@ -12,13 +13,17 @@ import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_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/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/itg/itg_response_model.dart';
import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart'; import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/ui/dialogs/success_dialog.dart';
import 'package:mohem_flutter_app/ui/landing/itg/video_page.dart';
import 'package:mohem_flutter_app/ui/landing/widget/app_drawer.dart'; import 'package:mohem_flutter_app/ui/landing/widget/app_drawer.dart';
import 'package:mohem_flutter_app/ui/landing/widget/menus_widget.dart'; import 'package:mohem_flutter_app/ui/landing/widget/menus_widget.dart';
import 'package:mohem_flutter_app/ui/landing/widget/services_widget.dart'; import 'package:mohem_flutter_app/ui/landing/widget/services_widget.dart';
import 'package:mohem_flutter_app/ui/marathon/widgets/marathon_banner.dart'; import 'package:mohem_flutter_app/ui/marathon/widgets/marathon_banner.dart';
import 'package:mohem_flutter_app/widgets/bottom_sheet.dart'; import 'package:mohem_flutter_app/widgets/bottom_sheet.dart';
import 'package:mohem_flutter_app/widgets/dialogs/dialogs.dart';
import 'package:mohem_flutter_app/widgets/mark_attendance_widget.dart'; import 'package:mohem_flutter_app/widgets/mark_attendance_widget.dart';
import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart'; import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart';
import 'package:mohem_flutter_app/widgets/shimmer/offers_shimmer_widget.dart'; import 'package:mohem_flutter_app/widgets/shimmer/offers_shimmer_widget.dart';
@ -38,8 +43,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
late DashboardProviderModel data; late DashboardProviderModel data;
final GlobalKey<ScaffoldState> _scaffoldState = GlobalKey(); final GlobalKey<ScaffoldState> _scaffoldState = GlobalKey();
final RefreshController _refreshController = final RefreshController _refreshController = RefreshController(initialRefresh: false);
RefreshController(initialRefresh: false);
int currentIndex = 0; int currentIndex = 0;
@ -59,6 +63,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
void _onRefresh() async { void _onRefresh() async {
data.initProvider(); data.initProvider();
// data.getITGNotification().then((value) {
// print("--------------------detail_1-----------------");
// print(value!.result!.data!.notificationMasterId);
// print(value.result!.data!.notificationTitle);
// });
data.fetchListMenu(); data.fetchListMenu();
data.fetchAttendanceTracking(context); data.fetchAttendanceTracking(context);
data.fetchWorkListCounter(context); data.fetchWorkListCounter(context);
@ -73,6 +82,44 @@ class _DashboardScreenState extends State<DashboardScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
key: _scaffoldState, key: _scaffoldState,
// appBar: AppBar(
// actions: [
// IconButton(
// onPressed: () {
// data.getITGNotification().then((value) {
// print("--------------------detail_1-----------------");
// if (value!.result!.data != null) {
// print(value.result!.data!.notificationMasterId);
// print(value.result!.data!.notificationType);
// if (value.result!.data!.notificationType == "Survey") {
// Navigator.pushNamed(context, AppRoutes.survey, arguments: value.result!.data);
// } else {
// DashboardApiClient().getAdvertisementDetail(value.result!.data!.notificationMasterId ?? "").then(
// (value) {
// if (value!.mohemmItgResponseItem!.statusCode == 200) {
// if (value.mohemmItgResponseItem!.result!.data != null) {
// String? image64 = value.mohemmItgResponseItem!.result!.data!.advertisement!.viewAttachFileColl!.first.base64String;
// print(image64);
// var sp = image64!.split("base64,");
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => MovieTheaterBody(
// encodedBytes: sp[1],
// ),
// ),
// );
// }
// }
// },
// );
// }
// }
// });
// },
// icon: Icon(Icons.add))
// ],
// ),
body: Column( body: Column(
children: [ children: [
Row( Row(
@ -85,8 +132,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
Utils.dataFromBase64String( Utils.dataFromBase64String(
AppState().memberInformationList!.eMPLOYEEIMAGE ?? "", AppState().memberInformationList!.eMPLOYEEIMAGE ?? "",
), ),
errorBuilder: (BuildContext context, Object error, errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) {
StackTrace? stackTrace) {
return SvgPicture.asset( return SvgPicture.asset(
"assets/images/user.svg", "assets/images/user.svg",
height: 34, height: 34,
@ -109,11 +155,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
_scaffoldState.currentState!.openDrawer(); _scaffoldState.currentState!.openDrawer();
}); });
}), }),
Image.asset("assets/images/logos/main_mohemm_logo.png", Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 28).expanded,
width: 134, height: 28)
.expanded,
SvgPicture.asset( SvgPicture.asset(
"assets/images/announcements.svg", "assets/images/announcements.svg",
matchTextDirection: true,
).onPress(() async { ).onPress(() async {
await Navigator.pushNamed(context, AppRoutes.announcements); await Navigator.pushNamed(context, AppRoutes.announcements);
}) })
@ -134,11 +179,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.goodMorning LocaleKeys.goodMorning.tr().toText14(color: MyColors.grey77Color),
.tr() (AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true),
.toText14(color: MyColors.grey77Color),
(AppState().memberInformationList!.eMPLOYEENAME ?? "")
.toText24(isBold: true),
16.height, 16.height,
Row( Row(
children: [ children: [
@ -146,223 +188,92 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: AspectRatio( child: AspectRatio(
aspectRatio: 159 / 159, aspectRatio: 159 / 159,
child: Consumer<DashboardProviderModel>( child: Consumer<DashboardProviderModel>(
builder: (BuildContext context, builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
DashboardProviderModel model,
Widget? child) {
return (model.isAttendanceTrackingLoading return (model.isAttendanceTrackingLoading
? GetAttendanceTrackingShimmer() ? GetAttendanceTrackingShimmer()
: Container( : Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.circular(15),
BorderRadius.circular(15), gradient: const LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [
gradient: MyColors.gradiantEndColor,
const LinearGradient( MyColors.gradiantStartColor,
transform: ]),
GradientRotation(
.46),
begin: Alignment
.topRight,
end: Alignment
.bottomLeft,
colors: [
MyColors
.gradiantEndColor,
MyColors
.gradiantStartColor,
]),
), ),
child: Stack( child: Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
if (model if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
.isTimeRemainingInSeconds ==
0)
SvgPicture.asset(
"assets/images/thumb.svg"),
Column( Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment
.start,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
mainAxisSize: mainAxisSize: MainAxisSize.min,
MainAxisSize crossAxisAlignment: CrossAxisAlignment.start,
.min,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [ children: [
LocaleKeys LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true),
.markAttendance if (model.isTimeRemainingInSeconds == 0) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white),
.tr() if (model.isTimeRemainingInSeconds != 0)
.toText14(
color: Colors
.white,
isBold:
true),
if (model
.isTimeRemainingInSeconds ==
0)
DateTime.now()
.toString()
.split(
" ")[0]
.toText12(
color: Colors
.white),
if (model
.isTimeRemainingInSeconds !=
0)
Column( Column(
mainAxisSize: mainAxisSize: MainAxisSize.min,
MainAxisSize crossAxisAlignment: CrossAxisAlignment.start,
.min,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [ children: [
9.height, 9.height,
CountdownTimer( CountdownTimer(
endTime: model endTime: model.endTime,
.endTime, onEnd: null,
onEnd: endWidget: "00:00:00".toText14(color: Colors.white, isBold: true),
null, textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
endWidget: "00:00:00".toText14(
color: Colors
.white,
isBold:
true),
textStyle: const TextStyle(
color: Colors
.white,
fontSize:
14,
letterSpacing:
-0.48,
fontWeight:
FontWeight.bold),
), ),
LocaleKeys LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
.timeLeftToday
.tr()
.toText12(
color:
Colors.white),
9.height, 9.height,
ClipRRect( ClipRRect(
borderRadius: const BorderRadius borderRadius: const BorderRadius.all(Radius.circular(20)),
.all( child: LinearProgressIndicator(
Radius.circular( value: model.progress,
20)), minHeight: 8,
child: valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
LinearProgressIndicator( backgroundColor: const Color(0xff196D73),
value: model
.progress,
minHeight:
8,
valueColor:
const AlwaysStoppedAnimation<Color>(Colors.white),
backgroundColor:
const Color(0xff196D73),
), ),
), ),
], ],
), ),
], ],
).paddingOnly( ).paddingOnly(top: 12, right: 15, left: 12),
top: 12,
right: 15,
left: 12),
), ),
Row( Row(
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
mainAxisSize: mainAxisSize: MainAxisSize.min,
MainAxisSize crossAxisAlignment: CrossAxisAlignment.start,
.min,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [ children: [
LocaleKeys LocaleKeys.checkIn.tr().toText12(color: Colors.white),
.checkIn (model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn)
.tr()
.toText12(
color:
Colors.white),
(model.attendanceTracking!.pSwipeIn ==
null
? "--:--"
: model
.attendanceTracking!
.pSwipeIn)
.toString() .toString()
.toText14( .toText14(color: Colors.white, isBold: true),
color: Colors
.white,
isBold:
true),
4.height, 4.height,
], ],
).paddingOnly( ).paddingOnly(left: 12, right: 12),
left: 12,
right: 12),
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0),
top: AppState()
.isArabic(
context)
? 6
: 0),
width: 45, width: 45,
height: 45, height: 45,
padding: padding: const EdgeInsets.only(left: 14, right: 14),
const EdgeInsets decoration: BoxDecoration(
.only( color: Color(0xff259EA4),
left: 14, borderRadius: BorderRadius.only(
right: bottomRight: AppState().isArabic(context) ? Radius.circular(0) : Radius.circular(15),
14), bottomLeft: AppState().isArabic(context) ? Radius.circular(15) : Radius.circular(0),
decoration:
BoxDecoration(
color: Color(
0xff259EA4),
borderRadius:
BorderRadius
.only(
bottomRight: AppState()
.isArabic(
context)
? Radius
.circular(
0)
: Radius
.circular(
15),
bottomLeft: AppState()
.isArabic(
context)
? Radius
.circular(
15)
: Radius
.circular(
0),
), ),
), ),
child: SvgPicture.asset( child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/play.svg" : "assets/images/stop.svg"),
model.isTimeRemainingInSeconds ==
0
? "assets/images/play.svg"
: "assets/images/stop.svg"),
).onPress(() { ).onPress(() {
showMyBottomSheet( showMyBottomSheet(
context, context,
child: child: MarkAttendanceWidget(model, isFromDashboard: true),
MarkAttendanceWidget( );
model));
}), }),
], ],
), ),
@ -372,10 +283,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
).onPress( ).onPress(
() { () {
Navigator.pushNamed( Navigator.pushNamed(context, AppRoutes.todayAttendance);
context,
AppRoutes
.todayAttendance);
}, },
)) ))
.animatedSwither(); .animatedSwither();
@ -399,11 +307,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
padding: const EdgeInsets.only(top: 31), padding: const EdgeInsets.only(top: 31),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: const BorderRadius.only( borderRadius: const BorderRadius.only(topRight: Radius.circular(50), topLeft: Radius.circular(50)),
topRight: Radius.circular(50), border: Border.all(color: MyColors.lightGreyEDColor, width: 1),
topLeft: Radius.circular(50)),
border: Border.all(
color: MyColors.lightGreyEDColor, width: 1),
), ),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -420,32 +325,22 @@ class _DashboardScreenState extends State<DashboardScreen> {
LocaleKeys.offers.tr().toText12(), LocaleKeys.offers.tr().toText12(),
Row( Row(
children: [ children: [
LocaleKeys.discounts LocaleKeys.discounts.tr().toText24(isBold: true),
.tr()
.toText24(isBold: true),
6.width, 6.width,
Container( Container(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(left: 8, right: 8),
left: 8, right: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
color: MyColors.yellowColor, color: MyColors.yellowColor,
borderRadius: borderRadius: BorderRadius.circular(10),
BorderRadius.circular(10),
), ),
child: LocaleKeys.newString child: LocaleKeys.newString.tr().toText10(isBold: true)),
.tr()
.toText10(isBold: true)),
], ],
), ),
], ],
), ),
), ),
LocaleKeys.viewAllOffers LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() {
.tr() Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
.toText12(isUnderLine: true)
.onPress(() {
Navigator.pushNamed(
context, AppRoutes.offersAndDiscounts);
}) })
], ],
).paddingOnly(left: 21, right: 21), ).paddingOnly(left: 21, right: 21),
@ -456,56 +351,38 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: ListView.separated( child: ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.only( padding: const EdgeInsets.only(left: 21, right: 21, top: 13),
left: 21, right: 21, top: 13),
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext cxt, int index) { itemBuilder: (BuildContext cxt, int index) {
return model.isOffersLoading return model.isOffersLoading
? const OffersShimmerWidget() ? const OffersShimmerWidget()
: InkWell( : InkWell(
onTap: () { onTap: () {
navigateToDetails( navigateToDetails(data.getOffersList[index]);
data.getOffersList[index]);
}, },
child: SizedBox( child: SizedBox(
width: 73, width: 73,
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center,
children: [ children: [
Container( Container(
width: 73, width: 73,
height: 73, height: 73,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: const BorderRadius.all(
const BorderRadius
.all(
Radius.circular(100), Radius.circular(100),
), ),
border: Border.all( border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
color: MyColors
.lightGreyE3Color,
width: 1),
), ),
child: ClipRRect( child: ClipRRect(
borderRadius: borderRadius: const BorderRadius.all(
const BorderRadius
.all(
Radius.circular(50), Radius.circular(50),
), ),
child: Hero( child: Hero(
tag: "ItemImage" + tag: "ItemImage" + data.getOffersList[index].rowID!,
data transitionOnUserGestures: true,
.getOffersList[
index]
.rowID!,
transitionOnUserGestures:
true,
child: Image.network( child: Image.network(
data data.getOffersList[index].bannerImage!,
.getOffersList[
index]
.bannerImage!,
fit: BoxFit.contain, fit: BoxFit.contain,
), ),
), ),
@ -513,33 +390,16 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
4.height, 4.height,
Expanded( Expanded(
child: AppState() child: AppState().isArabic(context)
.isArabic(context) ? data.getOffersList[index].titleAR!.toText12(isCenter: true, maxLine: 1)
? data : data.getOffersList[index].title!.toText12(isCenter: true, maxLine: 1),
.getOffersList[
index]
.titleAR!
.toText12(
isCenter:
true,
maxLine: 1)
: data
.getOffersList[
index]
.title!
.toText12(
isCenter:
true,
maxLine: 1),
), ),
], ],
), ),
), ),
); );
}, },
separatorBuilder: separatorBuilder: (BuildContext cxt, int index) => 8.width,
(BuildContext cxt, int index) =>
8.width,
itemCount: 6), itemCount: 6),
); );
}, },
@ -564,18 +424,14 @@ class _DashboardScreenState extends State<DashboardScreen> {
BottomNavigationBarItem( BottomNavigationBarItem(
icon: SvgPicture.asset( icon: SvgPicture.asset(
"assets/icons/home.svg", "assets/icons/home.svg",
color: currentIndex == 0 color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color,
? MyColors.grey3AColor
: MyColors.grey98Color,
).paddingAll(4), ).paddingAll(4),
label: LocaleKeys.home.tr(), label: LocaleKeys.home.tr(),
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: SvgPicture.asset( icon: SvgPicture.asset(
"assets/icons/create_req.svg", "assets/icons/create_req.svg",
color: currentIndex == 1 color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color,
? MyColors.grey3AColor
: MyColors.grey98Color,
).paddingAll(4), ).paddingAll(4),
label: LocaleKeys.createRequest.tr(), label: LocaleKeys.createRequest.tr(),
), ),
@ -585,13 +441,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
children: [ children: [
SvgPicture.asset( SvgPicture.asset(
"assets/icons/work_list.svg", "assets/icons/work_list.svg",
color: currentIndex == 2 color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color,
? MyColors.grey3AColor
: MyColors.grey98Color,
).paddingAll(4), ).paddingAll(4),
Consumer<DashboardProviderModel>( Consumer<DashboardProviderModel>(
builder: (BuildContext cxt, DashboardProviderModel data, builder: (BuildContext cxt, DashboardProviderModel data, Widget? child) {
Widget? child) {
if (data.workListCounter == 0) { if (data.workListCounter == 0) {
return const SizedBox(); return const SizedBox();
} }
@ -601,12 +454,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Container( child: Container(
padding: const EdgeInsets.only(left: 4, right: 4), padding: const EdgeInsets.only(left: 4, right: 4),
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)),
color: MyColors.redColor, child: data.workListCounter.toString().toText10(color: Colors.white),
borderRadius: BorderRadius.circular(17)),
child: data.workListCounter
.toString()
.toText10(color: Colors.white),
), ),
); );
}, },
@ -618,38 +467,26 @@ class _DashboardScreenState extends State<DashboardScreen> {
BottomNavigationBarItem( BottomNavigationBarItem(
icon: SvgPicture.asset( icon: SvgPicture.asset(
"assets/icons/item_for_sale.svg", "assets/icons/item_for_sale.svg",
color: currentIndex == 3 color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color,
? MyColors.grey3AColor
: MyColors.grey98Color,
).paddingAll(4), ).paddingAll(4),
label: LocaleKeys.itemsForSale.tr(), label: LocaleKeys.itemsForSale.tr(),
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: SvgPicture.asset( icon: SvgPicture.asset(
"assets/icons/chat/chat.svg", "assets/icons/chat/chat.svg",
color: currentIndex == 4 color: currentIndex == 4 ? MyColors.grey3AColor : MyColors.grey98Color,
? MyColors.grey3AColor
: MyColors.grey98Color,
).paddingAll(4), ).paddingAll(4),
label: LocaleKeys.chat.tr(), label: LocaleKeys.chat.tr(),
), ),
], ],
currentIndex: currentIndex, currentIndex: currentIndex,
selectedLabelStyle: const TextStyle( selectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey3AColor, fontWeight: FontWeight.w600),
fontSize: 10, unselectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey98Color, fontWeight: FontWeight.w600),
color: MyColors.grey3AColor,
fontWeight: FontWeight.w600),
unselectedLabelStyle: const TextStyle(
fontSize: 10,
color: MyColors.grey98Color,
fontWeight: FontWeight.w600),
type: BottomNavigationBarType.fixed, type: BottomNavigationBarType.fixed,
selectedItemColor: MyColors.grey3AColor, selectedItemColor: MyColors.grey3AColor,
backgroundColor: MyColors.backgroundColor, backgroundColor: MyColors.backgroundColor,
selectedIconTheme: selectedIconTheme: const IconThemeData(color: MyColors.grey3AColor, size: 28),
const IconThemeData(color: MyColors.grey3AColor, size: 28), unselectedIconTheme: const IconThemeData(color: MyColors.grey98Color, size: 28),
unselectedIconTheme:
const IconThemeData(color: MyColors.grey98Color, size: 28),
onTap: (int index) { onTap: (int index) {
if (index == 1) { if (index == 1) {
Navigator.pushNamed(context, AppRoutes.mowadhafhi); Navigator.pushNamed(context, AppRoutes.mowadhafhi);
@ -682,7 +519,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
} }
}); });
Navigator.pushNamed(context, AppRoutes.offersAndDiscountsDetails, Navigator.pushNamed(context, AppRoutes.offersAndDiscountsDetails, arguments: getOffersDetailList);
arguments: getOffersDetailList);
} }
} }

@ -1,13 +1,19 @@
import 'dart:convert';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/api/dashboard_api_client.dart';
import 'package:mohem_flutter_app/classes/colors.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/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.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/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_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/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/itg/itg_main_response.dart';
import 'package:mohem_flutter_app/models/itg/itg_response_model.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.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:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart';
@ -20,10 +26,14 @@ class SurveyScreen extends StatefulWidget {
class _SurveyScreenState extends State<SurveyScreen> { class _SurveyScreenState extends State<SurveyScreen> {
String reviewText = ""; String reviewText = "";
int _selectedIndex = -1; double starRating = 1;
int _selectedIndex = 5;
ItgResponseData? itgResponseData;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (itgResponseData == null) itgResponseData = ModalRoute.of(context)!.settings.arguments as ItgResponseData;
return Scaffold( return Scaffold(
backgroundColor: MyColors.backgroundColor, backgroundColor: MyColors.backgroundColor,
body: Column( body: Column(
@ -41,19 +51,23 @@ class _SurveyScreenState extends State<SurveyScreen> {
LocaleKeys.rateUI.tr().toText16(), LocaleKeys.rateUI.tr().toText16(),
22.height, 22.height,
Row( Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
RatingBar.builder( RatingBar.builder(
initialRating: 3, initialRating: 3,
minRating: 1, minRating: starRating,
direction: Axis.horizontal, direction: Axis.horizontal,
allowHalfRating: true, allowHalfRating: false,
itemCount: 5, itemCount: 5,
itemPadding: EdgeInsets.symmetric(horizontal: 12), itemPadding: EdgeInsets.symmetric(horizontal: 8),
itemBuilder: (context, _) => Icon( itemBuilder: (context, _) => Icon(
Icons.star, Icons.star,
color: Colors.amber, color: Colors.amber,
), ),
onRatingUpdate: (rating) {}, onRatingUpdate: (rating) {
starRating = rating;
},
) )
], ],
).paddingOnly(left: 22, right: 22, top: 12, bottom: 12).objectContainerView(disablePadding: true), ).paddingOnly(left: 22, right: 22, top: 12, bottom: 12).objectContainerView(disablePadding: true),
@ -66,11 +80,11 @@ class _SurveyScreenState extends State<SurveyScreen> {
padding: const EdgeInsets.only(top: 0), padding: const EdgeInsets.only(top: 0),
shrinkWrap: true, shrinkWrap: true,
children: [ children: [
optionUI("poor.svg", 0), optionUI("poor.svg", 1),
optionUI("bad.svg", 1), optionUI("bad.svg", 2),
optionUI("normal.svg", 2), optionUI("normal.svg", 3),
optionUI("good.svg", 3), optionUI("good.svg", 4),
optionUI("xcellent.svg", 4), optionUI("xcellent.svg", 5),
], ],
), ),
27.height, 27.height,
@ -78,13 +92,21 @@ class _SurveyScreenState extends State<SurveyScreen> {
LocaleKeys.description.tr(), LocaleKeys.description.tr(),
LocaleKeys.typeHere.tr(), LocaleKeys.typeHere.tr(),
lines: 3, lines: 3,
onChange: (v) {
reviewText = v;
},
), ),
150.height 150.height
], ],
).paddingOnly(left: 21, right: 21), ).paddingOnly(left: 21, right: 21),
], ],
)), )),
DefaultButton(LocaleKeys.submitSurvey.tr(), () async {}).insideContainer, DefaultButton(
LocaleKeys.submitSurvey.tr(),
() {
performAPI();
},
).insideContainer,
], ],
)); ));
} }
@ -108,4 +130,34 @@ class _SurveyScreenState extends State<SurveyScreen> {
setState(() {}); setState(() {});
}); });
} }
void performAPI() async {
Utils.showLoading(context);
try {
ItgMainRes? res= await DashboardApiClient().submitItgForm(
comment: reviewText,
masterId: itgResponseData!.notificationMasterId ?? "",
itgList: [
{"questionId": "1", "optionId": null, "starRating": starRating},
{"questionId": "2", "optionId": "4", "starRating": _selectedIndex}
],
serviceId: itgResponseData!.serviceId ?? 0);
Utils.hideLoading(context);
if(res!.mohemmItgResponseItem!.statusCode==200){
Utils.showToast("Survey has been submitted successfully");
Navigator.pop(context);
}else{
Utils.showToast(res.mohemmItgResponseItem!.message.toString());
}
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, (msg) {
Utils.confirmDialog(context, msg);
});
}
}
} }

@ -0,0 +1,96 @@
import 'dart:convert';
import 'dart:io' as Io;
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
class MovieTheaterBody extends StatefulWidget {
final String encodedBytes;
const MovieTheaterBody({required this.encodedBytes});
@override
_MovieTheaterBodyState createState() => _MovieTheaterBodyState();
}
class _MovieTheaterBodyState extends State<MovieTheaterBody> {
late Future<VideoPlayerController> _futureController;
late VideoPlayerController _controller;
Future<VideoPlayerController> createVideoPlayer() async {
try {
var decodedBytes = base64Decode(widget.encodedBytes);
var file = Io.File("decodedBezkoder.mp4");
file.writeAsBytesSync(decodedBytes);
VideoPlayerController controller = VideoPlayerController.file(file);
await controller.initialize();
await controller.setLooping(true);
return controller;
} catch (e) {
print("object0000000");
print(e);
return new VideoPlayerController.asset("dataSource");
}
}
@override
void initState() {
_futureController = createVideoPlayer();
super.initState();
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Expanded(
child: FutureBuilder(
future: _futureController,
builder: (context, snapshot) {
//UST: 05/2021 - MovieTheaterBody - id:11 - 2pts - Criação
if (snapshot.connectionState == ConnectionState.done && snapshot.data != null) {
_controller = snapshot.data as VideoPlayerController;
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AspectRatio(
aspectRatio: _controller.value.aspectRatio,
child: VideoPlayer(_controller),
),
const SizedBox(
height: 50,
),
FloatingActionButton(
onPressed: () {
setState(() {
if (_controller.value.isPlaying) {
_controller.pause();
} else {
// If the video is paused, play it.
_controller.play();
}
});
},
backgroundColor: Colors.green[700],
child: Icon(
_controller.value.isPlaying ? Icons.pause : Icons.play_arrow,
),
)
],
);
} else {
return const Center(child: CircularProgressIndicator());
}
},
),
),
);
}
}

@ -1,3 +1,4 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:easy_localization/src/public_ext.dart'; import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
@ -95,6 +96,7 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> {
: Column( : Column(
children: [ children: [
Container( Container(
width: double.infinity,
color: MyColors.backgroundBlackColor, color: MyColors.backgroundBlackColor,
padding: EdgeInsets.only(top: 4, left: 21, right: 21, bottom: 21), padding: EdgeInsets.only(top: 4, left: 21, right: 21, bottom: 21),
child: Column( child: Column(
@ -132,6 +134,7 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> {
), ),
).paddingAll(21), ).paddingAll(21),
).expanded, ).expanded,
], ],
), ),
).expanded, ).expanded,
@ -316,6 +319,16 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> {
// } // }
// } // }
String getValue(int? v) {
if (v == null) {
return "00";
} else if (v.toString().length == 1) {
return "0" + v.toString();
} else {
return v.toString();
}
}
Future<bool> closeWifiRequest() async { Future<bool> closeWifiRequest() async {
await WiFiForIoTPlugin.forceWifiUsage(false); await WiFiForIoTPlugin.forceWifiUsage(false);
bool v = await WiFiForIoTPlugin.disconnect(); bool v = await WiFiForIoTPlugin.disconnect();

@ -92,7 +92,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
} }
void validateAbsenceTransaction() async { void validateAbsenceTransaction() async {
try { // try {
Utils.showLoading(context); Utils.showLoading(context);
Map<String, String?> dffDataMap = {}; Map<String, String?> dffDataMap = {};
for (int i = 1; i <= 20; i++) { for (int i = 1; i <= 20; i++) {
@ -100,7 +100,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
for (int dffIndex = 0; dffIndex < getabsenceDffStructureList.length; dffIndex++) { for (int dffIndex = 0; dffIndex < getabsenceDffStructureList.length; dffIndex++) {
if ("ATTRIBUTE$i" == getabsenceDffStructureList[dffIndex].aPPLICATIONCOLUMNNAME) { if ("ATTRIBUTE$i" == getabsenceDffStructureList[dffIndex].aPPLICATIONCOLUMNNAME) {
if (getabsenceDffStructureList[dffIndex].fORMATTYPE == "X") { if (getabsenceDffStructureList[dffIndex].fORMATTYPE == "X") {
dffDataMap["P_ATTRIBUTE$i"] = Utils.formatDate(getabsenceDffStructureList[dffIndex].eSERVICESDV!.pIDCOLUMNNAME!); dffDataMap["P_ATTRIBUTE$i"] = getabsenceDffStructureList[dffIndex].eSERVICESDV!.pIDCOLUMNNAME != null ? Utils.formatDate(getabsenceDffStructureList[dffIndex].eSERVICESDV!.pIDCOLUMNNAME!) : "";
} else { } else {
dffDataMap["P_ATTRIBUTE$i"] = getabsenceDffStructureList[dffIndex].eSERVICESDV?.pIDCOLUMNNAME; dffDataMap["P_ATTRIBUTE$i"] = getabsenceDffStructureList[dffIndex].eSERVICESDV?.pIDCOLUMNNAME;
} }
@ -129,10 +129,10 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
// Utils.showLoading(context); // Utils.showLoading(context);
await LeaveBalanceApiClient().cancelHrTransaction(submit.pTRANSACTIONID!); await LeaveBalanceApiClient().cancelHrTransaction(submit.pTRANSACTIONID!);
// Utils.hideLoading(context); // Utils.hideLoading(context);
} catch (ex) { // } catch (ex) {
Utils.hideLoading(context); // Utils.hideLoading(context);
Utils.handleException(ex, context, null); // Utils.handleException(ex, context, null);
} // }
} }
@override @override

@ -140,10 +140,13 @@ class _LoginScreenState extends State<LoginScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (isAppOpenBySystem == null) { if (isAppOpenBySystem == null) {
isAppOpenBySystem = (ModalRoute.of(context)!.settings.arguments ?? true) as bool; isAppOpenBySystem = (ModalRoute.of(context)!.settings.arguments ?? true) as bool;
if (kDebugMode) { if (!kReleaseMode) {
// username.text = "15444"; // Maha User // username.text = "15444"; // Maha User
username.text = "15153"; // Tamer User // username.text = "15153"; // Tamer User
password.text = "Abcd@12345"; // password.text = "Abcd@12345";
username.text = "210038"; // Hashim User
password.text = "123";
} }
if (isAppOpenBySystem!) checkFirebaseToken(); if (isAppOpenBySystem!) checkFirebaseToken();
} }

@ -99,7 +99,7 @@ class _MarathonProgressContainerState extends State<MarathonProgressContainer> {
return Container( return Container(
width: double.infinity, width: double.infinity,
decoration: MyDecorations.shadowDecoration, decoration: MyDecorations.shadowDecoration,
padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 20), padding: const EdgeInsets.all(21),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
@ -120,7 +120,7 @@ class _MarathonProgressContainerState extends State<MarathonProgressContainer> {
), ),
15.height, 15.height,
StepsIndicator( StepsIndicator(
lineLength: 23, lineLength: 21,
nbSteps: 10, nbSteps: 10,
selectedStep: widget.provider.currentQuestionNumber, selectedStep: widget.provider.currentQuestionNumber,
doneLineColor: MyColors.greenColor, doneLineColor: MyColors.greenColor,

@ -210,6 +210,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
AppState().itgWorkListIndex = AppState().itgWorkListIndex! + 1; AppState().itgWorkListIndex = AppState().itgWorkListIndex! + 1;
requestDetails = null; requestDetails = null;
itgRequest = null; itgRequest = null;
tabIndex = 0;
showFabOptions = false; showFabOptions = false;
getDataFromState(); getDataFromState();
} else if (AppState().requestAllList!.length - 1 == AppState().itgWorkListIndex!) { } else if (AppState().requestAllList!.length - 1 == AppState().itgWorkListIndex!) {

@ -54,6 +54,12 @@ class _DelegateSheetState extends State<DelegateSheet> {
var ids = widget.wFHistory!.map((e) => e.employeeID).toSet(); var ids = widget.wFHistory!.map((e) => e.employeeID).toSet();
widget.wFHistory!.retainWhere((x) => ids.remove(x.employeeID)); widget.wFHistory!.retainWhere((x) => ids.remove(x.employeeID));
} }
if (widget.actionHistoryList != null) {
widget.actionHistoryList = widget.actionHistoryList!.reversed.toList();
var ids = widget.actionHistoryList!.map((e) => e.uSERNAME).toSet();
widget.actionHistoryList!.retainWhere((x) => ids.remove(x.uSERNAME));
}
} }
@override @override

@ -131,16 +131,27 @@ class _WorkListScreenState extends State<WorkListScreen> {
} else if (workListElement.key == "COC") { } else if (workListElement.key == "COC") {
workListElement.value = providerData.cocFinalCount; workListElement.value = providerData.cocFinalCount;
} else { } else {
var tempList = providerData.getOpenNotificationsList?.where((notificationElement) { providerData.getOpenNotificationsList?.forEach((element) {
return (notificationElement.itemType == workListItemTypes[workListItemIndex].key) && notificationElement.itemType == workListElement.key; if ((element.itemType == workListItemTypes[workListItemIndex].key) && element.itemType == workListElement.key) {
}).toList(); if ((AppState().workList?.length ?? 0) != (element.openNtfNumber ?? 0)) {
if (tempList!.isNotEmpty) { workListElement.value = AppState().workList?.length ?? 0;
if ((AppState().workList?.length ?? 0) != (tempList.first.openNtfNumber ?? 0)) { providerData.workListCounter = providerData.workListCounter - ((element.openNtfNumber ?? 0) - (AppState().workList?.length ?? 0));
workListElement.value = AppState().workList?.length ?? 0; element.openNtfNumber = workListElement.value;
providerData.workListCounter = providerData.workListCounter - ((tempList.first.openNtfNumber ?? 0) - (AppState().workList?.length ?? 0)); providerData.notify();
providerData.notify(); }
} }
} });
// var tempList = providerData.getOpenNotificationsList?.where((notificationElement) {
// return (notificationElement.itemType == workListItemTypes[workListItemIndex].key) && notificationElement.itemType == workListElement.key;
// }).toList();
// if (tempList!.isNotEmpty) {
// if ((AppState().workList?.length ?? 0) != (tempList.first.openNtfNumber ?? 0)) {
// workListElement.value = AppState().workList?.length ?? 0;
// providerData.workListCounter = providerData.workListCounter - ((tempList.first.openNtfNumber ?? 0) - (AppState().workList?.length ?? 0));
// providerData.notify();
// }
// }
} }
}); });
} }
@ -421,7 +432,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
child: WorkListAdvanceSearch((selectedViewID, selectedItemTypeID, searchByInput, searchByDate) async { child: WorkListAdvanceSearch((selectedViewID, selectedItemTypeID, searchByInput, searchByDate) async {
itgRequestTypeIndex = null; itgRequestTypeIndex = null;
pNotificationType = selectedViewID; pNotificationType = selectedViewID;
int index = -1; int index = 0;
for (int i = 0; i < workListItemTypes.length; i++) { for (int i = 0; i < workListItemTypes.length; i++) {
if (workListItemTypes[i].key == selectedItemTypeID) { if (workListItemTypes[i].key == selectedItemTypeID) {
index = i; index = i;

@ -136,6 +136,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
getPRNotification(); getPRNotification();
} }
controller.jumpToPage(0);
// List dataToFetch = await Future.wait([ // List dataToFetch = await Future.wait([
// //
// WorkListApiClient().getActionHistory(workListData!.nOTIFICATIONID!), // WorkListApiClient().getActionHistory(workListData!.nOTIFICATIONID!),
@ -312,6 +314,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
AppState().setWorkListIndex = AppState().workListIndex! + 1; AppState().setWorkListIndex = AppState().workListIndex! + 1;
workListData = null; workListData = null;
showFabOptions = false; showFabOptions = false;
tabIndex = 0;
getDataFromState(); getDataFromState();
} else if (AppState().workList!.length - 1 == AppState().workListIndex!) { } else if (AppState().workList!.length - 1 == AppState().workListIndex!) {
Navigator.pop(context); Navigator.pop(context);
@ -354,26 +357,35 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (notificationButtonsList[i].bUTTONACTION! == "REJECTED" || notificationButtonsList[i].bUTTONACTION! == "APPROVED" || notificationButtonsList[i].bUTTONACTION! == "CLOSE") { if (notificationButtonsList[i].bUTTONACTION! == "REJECTED" || notificationButtonsList[i].bUTTONACTION! == "APPROVED" || notificationButtonsList[i].bUTTONACTION! == "CLOSE") {
continue; continue;
} }
fabs.add(myFab(notificationButtonsList[i].bUTTONLABEL!, notificationButtonsList[i].bUTTONACTION == "DELEGATE" ? "assets/images/delegate.svg" : notificationButtonsList[i].bUTTONICON ?? "", fabs.add(myFab(
isIconAsset: notificationButtonsList[i].bUTTONACTION == "DELEGATE" ? true : false,) notificationButtonsList[i].bUTTONLABEL!,
.paddingOnly(bottom: 12) notificationButtonsList[i].bUTTONACTION == "DELEGATE" ? "assets/images/delegate.svg" : notificationButtonsList[i].bUTTONICON ?? "",
.onPress(() => handleFabAction(notificationButtonsList[i]))); isIconAsset: notificationButtonsList[i].bUTTONACTION == "DELEGATE" ? true : false,
).paddingOnly(bottom: 12).onPress(() => handleFabAction(notificationButtonsList[i])));
} }
return fabs; return fabs;
} }
void handleFabAction(GetNotificationButtonsList notificationButton) { void handleFabAction(GetNotificationButtonsList notificationButton) {
print("notificationButton:${notificationButton.bUTTONACTION}");
switch (notificationButton.bUTTONACTION) { switch (notificationButton.bUTTONACTION) {
case "DELEGATE": case "DELEGATE":
showMyBottomSheet(context, showMyBottomSheet(context,
child: DelegateSheet(title: LocaleKeys.delegate.tr(), apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList)); child: DelegateSheet(title: LocaleKeys.delegate.tr(), apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break; break;
case "REQUEST_INFO": case "REQUEST_INFO":
// do something else // do something else
showMyBottomSheet(context, showMyBottomSheet(context,
child: DelegateSheet(title: LocaleKeys.request_info.tr(), apiMode: "REQUEST_INFO", notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList)); child: DelegateSheet(title: LocaleKeys.request_info.tr(), apiMode: "REQUEST_INFO", notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break; break;
case "TRANSFER_INFO":
// do something else
showMyBottomSheet(context,
child: DelegateSheet(title: notificationButton.bUTTONLABEL!, apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break;
case "ANSWER_INFO":
performAction(notificationButton.bUTTONACTION!,title: notificationButton.bUTTONLABEL);
break;
case "RFC": case "RFC":
// do something else // do something else
break; break;
@ -384,10 +396,10 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
// do something else // do something else
case "APPROVE_AND_FORWARD": case "APPROVE_AND_FORWARD":
showMyBottomSheet(context, showMyBottomSheet(context,
child: DelegateSheet(title: "Approve and Forward", apiMode: "APPROVE_AND_FORWARD", notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList)); child: DelegateSheet(title: "Approve and Forward", apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break; break;
case "FORWARD": case "FORWARD":
showMyBottomSheet(context, child: DelegateSheet(title: "Forward", apiMode: "FORWARD", notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList)); showMyBottomSheet(context, child: DelegateSheet(title: "Forward", apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList));
break; break;
case "REJECT": case "REJECT":
performNetworkCall(context, email: "", userId: ""); performNetworkCall(context, email: "", userId: "");
@ -480,12 +492,13 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
); );
} }
void performAction(String actionMode) { void performAction(String actionMode,{String? title}) {
TextEditingController textEditingController = TextEditingController(); TextEditingController textEditingController = TextEditingController();
showDialog( showDialog(
context: context, context: context,
builder: (cxt) => AcceptRejectInputDialog( builder: (cxt) => AcceptRejectInputDialog(
message: LocaleKeys.requestedItems.tr(), message: title !=null ? null:LocaleKeys.requestedItems.tr(),
title: title,
notificationGetRespond: notificationNoteInput, notificationGetRespond: notificationNoteInput,
onTap: (note) { onTap: (note) {
Map<String, dynamic> payload = { Map<String, dynamic> payload = {

@ -124,6 +124,7 @@ class ActionsFragment extends StatelessWidget {
} }
Color getStatusColor(String code) { Color getStatusColor(String code) {
print("code:$code");
if (code == "SUBMIT") { if (code == "SUBMIT") {
return const Color(0xff2E303A); return const Color(0xff2E303A);
} else if (code == "REJECTED") { } else if (code == "REJECTED") {
@ -134,10 +135,10 @@ class ActionsFragment extends StatelessWidget {
return MyColors.orange; return MyColors.orange;
} else if (code == "APPROVED" || code == "APPROVE") { } else if (code == "APPROVED" || code == "APPROVE") {
return const Color(0xff1FA269); return const Color(0xff1FA269);
} else if (code != "SUBMIT" && code != "REJECT" && code != "PENDING") {
return MyColors.orange;
} else if (code == "REQUEST_INFO") { } else if (code == "REQUEST_INFO") {
return const Color(0xff2E303A); return const Color(0xff2E303A);
} else if (code != "SUBMIT" && code != "REJECT" && code != "PENDING") {
return MyColors.orange;
} else { } else {
return const Color(0xff2E303A); return const Color(0xff2E303A);
} }

@ -1,11 +1,12 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
void showMDialog(context, {Widget? child}) async { void showMDialog(context, {Widget? child,Color? backgroundColor,bool isDismissable=true}) async {
return showDialog( return showDialog(
context: context, context: context,
barrierDismissible: true, barrierDismissible: isDismissable,
builder: (context) { builder: (context) {
return Dialog( return Dialog(
backgroundColor: backgroundColor,
child: child, child: child,
); );
}, },

@ -13,6 +13,8 @@ import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.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/generic_response_model.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/ui/dialogs/success_dialog.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/location/Location.dart';
import 'package:mohem_flutter_app/widgets/nfc/nfc_reader_sheet.dart'; import 'package:mohem_flutter_app/widgets/nfc/nfc_reader_sheet.dart';
import 'package:mohem_flutter_app/widgets/qr_scanner_dialog.dart'; import 'package:mohem_flutter_app/widgets/qr_scanner_dialog.dart';
@ -22,8 +24,9 @@ import 'package:wifi_iot/wifi_iot.dart';
class MarkAttendanceWidget extends StatefulWidget { class MarkAttendanceWidget extends StatefulWidget {
DashboardProviderModel model; DashboardProviderModel model;
double topPadding; double topPadding;
bool isFromDashboard;
MarkAttendanceWidget(this.model, {Key? key, this.topPadding = 0}) : super(key: key); MarkAttendanceWidget(this.model, {Key? key, this.topPadding = 0, this.isFromDashboard = false}) : super(key: key);
@override @override
_MarkAttendanceWidgetState createState() { _MarkAttendanceWidgetState createState() {
@ -141,6 +144,12 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 2, nfcValue: nfcId ?? "", isGpsRequired: isNfcLocationEnabled, lat: lat, long: lng); GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 2, nfcValue: nfcId ?? "", isGpsRequired: isNfcLocationEnabled, lat: lat, long: lng);
bool status = await model.fetchAttendanceTracking(context); bool status = await model.fetchAttendanceTracking(context);
Utils.hideLoading(context); Utils.hideLoading(context);
showMDialog(
context,
backgroundColor: Colors.transparent,
isDismissable: false,
child: SuccessDialog(widget.isFromDashboard),
);
} catch (ex) { } catch (ex) {
print(ex); print(ex);
Utils.hideLoading(context); Utils.hideLoading(context);
@ -175,6 +184,12 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
if (Platform.isAndroid) { if (Platform.isAndroid) {
await closeWifiRequest(); await closeWifiRequest();
} }
showMDialog(
context,
backgroundColor: Colors.transparent,
isDismissable: false,
child: SuccessDialog(widget.isFromDashboard),
);
} catch (ex) { } catch (ex) {
print("performWifiAttendance: " + ex.toString()); print("performWifiAttendance: " + ex.toString());
await closeWifiRequest(); await closeWifiRequest();
@ -208,6 +223,12 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 1, isGpsRequired: isQrLocationEnabled, lat: lat, long: lng, QRValue: qrCodeValue); GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 1, isGpsRequired: isQrLocationEnabled, lat: lat, long: lng, QRValue: qrCodeValue);
bool status = await model.fetchAttendanceTracking(context); bool status = await model.fetchAttendanceTracking(context);
Utils.hideLoading(context); Utils.hideLoading(context);
showMDialog(
context,
backgroundColor: Colors.transparent,
isDismissable: false,
child: SuccessDialog(widget.isFromDashboard),
);
} catch (ex) { } catch (ex) {
print(ex); print(ex);
Utils.hideLoading(context); Utils.hideLoading(context);

@ -7,7 +7,7 @@ description: A new Flutter application.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application. # The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43 # A version number is three numbers separated by dots, like 1.2.43v
# followed by an optional build number separated by a +. # followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter # Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively. # build by specifying --build-name and --build-number, respectively.
@ -53,7 +53,7 @@ dependencies:
shimmer: ^2.0.0 shimmer: ^2.0.0
logger: ^1.1.0 logger: ^1.1.0
flutter_countdown_timer: ^4.1.0 flutter_countdown_timer: ^4.1.0
nfc_manager: ^3.1.1 nfc_manager: ^3.2.0
uuid: ^3.0.6 uuid: ^3.0.6
image_picker: ^0.8.5+3 image_picker: ^0.8.5+3
file_picker: ^4.6.1 file_picker: ^4.6.1
@ -78,7 +78,7 @@ dependencies:
auto_size_text: ^3.0.0 auto_size_text: ^3.0.0
pull_to_refresh: ^2.0.0 pull_to_refresh: ^2.0.0
# lottie json animations # lottie json animations
lottie: ^1.4.3 lottie: any
# Steps Progress # Steps Progress
steps_indicator: ^1.3.0 steps_indicator: ^1.3.0
# Marathon Card Swipe # Marathon Card Swipe
@ -91,6 +91,8 @@ dependencies:
video_player: ^2.4.7
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter

Loading…
Cancel
Save