Mark Attandence success animation and font settings

merge-requests/34/head
devmirza121 3 years ago
parent 203e5ac73c
commit 937c4c18b5

File diff suppressed because one or more lines are too long

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:convert';
import 'package:mohem_flutter_app/api/api_client.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/list_menu.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';
class DashboardApiClient {
static final DashboardApiClient _instance = DashboardApiClient._internal();
@ -40,10 +45,7 @@ class DashboardApiClient {
Future<GenericResponseModel?> getCOCNotifications() async {
String url = "${ApiConsts.cocRest}Mohemm_ITG_ReviewerAdmin_Pending_Tasks";
Map<String, dynamic> postParams = {
"Date": DateUtil.getISODateFormat(DateTime.now()),
"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER
};
Map<String, dynamic> postParams = {"Date": DateUtil.getISODateFormat(DateTime.now()), "EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
@ -62,8 +64,7 @@ class DashboardApiClient {
}, url, postParams);
}
Future<List<GetAccrualBalancesList>> getAccrualBalances(
String effectiveDate) async {
Future<List<GetAccrualBalancesList>> getAccrualBalances(String effectiveDate) async {
String url = "${ApiConsts.erpRest}GET_ACCRUAL_BALANCES";
Map<String, dynamic> postParams = {"P_EFFECTIVE_DATE": effectiveDate};
postParams.addAll(AppState().postParamsJson);
@ -97,10 +98,7 @@ class DashboardApiClient {
//GET_MENU_ENTRIES
Future<GenericResponseModel?> getGetMenuEntries() async {
String url = "${ApiConsts.erpRest}GET_MENU_ENTRIES";
Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": -999,
"P_MENU_TYPE": "E"
};
Map<String, dynamic> postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E"};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
@ -109,13 +107,7 @@ class DashboardApiClient {
}
//Mark Attendance
Future<GenericResponseModel?> markAttendance(
{String lat = "0",
String? long = "0",
required int pointType,
String nfcValue = "",
bool isGpsRequired = false,
String QRValue = ""}) async {
Future<GenericResponseModel?> markAttendance({String lat = "0", String? long = "0", required int pointType, String nfcValue = "", bool isGpsRequired = false, String QRValue = ""}) async {
String url = "${ApiConsts.swpRest}AuthenticateAndSwipeUserSupportNFC";
var uuid = Uuid();
// Generate a v4 (random) id
@ -136,4 +128,54 @@ class DashboardApiClient {
return responseData;
}, 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_home.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/leave_balance/add_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 capitalizeFirstofEach => this.trim().length > 0
? this.trim().toLowerCase().split(" ").map((str) => str.inCaps).join(" ")
: "";
String get capitalizeFirstofEach => this.trim().length > 0 ? this.trim().toLowerCase().split(" ").map((str) => str.inCaps).join(" ") : "";
}
extension EmailValidator on String {
Widget get toWidget => Text(this);
Widget toText10(
{Color? color,
bool isBold = false,
int? maxlines,
FontStyle? fontStyle}) =>
Text(
Widget toText10({Color? color, bool isBold = false, int? maxlines, FontStyle? fontStyle}) => Text(
this,
//maxLines: maxlines,
style: TextStyle(
fontSize: 10,
fontStyle: fontStyle ?? FontStyle.normal,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
color: color ?? MyColors.darkTextColor,
letterSpacing: -0.4),
style: TextStyle(fontSize: 10, fontStyle: fontStyle ?? FontStyle.normal, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4),
);
Widget toText11(
{Color? color,
FontWeight? weight,
bool isUnderLine = false,
bool isBold = false}) =>
Text(
Widget toText11({Color? color, FontWeight? weight, bool isUnderLine = false, bool isBold = false}) => Text(
this,
style: TextStyle(
fontSize: 11,
@ -50,13 +33,7 @@ extension EmailValidator on String {
),
);
Widget toText12(
{Color? color,
bool isUnderLine = false,
bool isBold = false,
bool isCenter = false,
int maxLine = 0}) =>
Text(
Widget toText12({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, int maxLine = 0}) => Text(
this,
textAlign: isCenter ? TextAlign.center : null,
maxLines: (maxLine > 0) ? maxLine : null,
@ -69,13 +46,7 @@ extension EmailValidator on String {
),
);
Widget toText12Auto(
{Color? color,
bool isUnderLine = false,
bool isBold = false,
bool isCenter = false,
int maxLine = 0}) =>
AutoSizeText(
Widget toText12Auto({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, int maxLine = 0}) => AutoSizeText(
this,
textAlign: isCenter ? TextAlign.center : 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,
textAlign: isCenter ? TextAlign.center : null,
maxLines: (maxLine > 0) ? maxLine : null,
minFontSize: 8,
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.w600,
color: color ?? MyColors.darkTextColor,
letterSpacing: -0.52,
decoration: isUnderLine ? TextDecoration.underline : null),
fontSize: fontSize,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
color: color ?? MyColors.darkTextColor,
letterSpacing: letterSpacing,
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(
this,
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(
{Color? color,
bool isUnderLine = false,
bool isBold = false,
int? maxlines}) =>
Text(
Widget toText16({Color? color, bool isUnderLine = false, bool isBold = false, int? maxlines}) => Text(
this,
maxLines: maxlines,
style: TextStyle(
@ -124,97 +114,51 @@ extension EmailValidator on String {
Widget toText17({Color? color, bool isBold = false}) => Text(
this,
style: TextStyle(
color: color ?? MyColors.darkTextColor,
fontSize: 17,
letterSpacing: -0.68,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
style: TextStyle(color: color ?? MyColors.darkTextColor, fontSize: 17, letterSpacing: -0.68, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
);
Widget toText18({Color? color, bool isBold = false}) => Text(
this,
style: TextStyle(
fontSize: 18,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
color: color ?? MyColors.darkTextColor,
letterSpacing: -1.08),
style: TextStyle(fontSize: 18, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -1.08),
);
Widget toText19({Color? color, bool isBold = false}) => Text(
this,
style: TextStyle(
fontSize: 19,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
color: color ?? MyColors.darkTextColor,
letterSpacing: -1.14),
style: TextStyle(fontSize: 19, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -1.14),
);
Widget toText20({Color? color, bool isBold = false}) => Text(
this,
style: TextStyle(
fontSize: 20,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
color: color ?? MyColors.darkTextColor,
letterSpacing: -0.4),
style: TextStyle(fontSize: 20, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4),
);
Widget toText21(
{Color? color,
bool isBold = false,
FontWeight? weight,
int? maxlines}) =>
Text(
Widget toText21({Color? color, bool isBold = false, FontWeight? weight, int? maxlines}) => Text(
this,
maxLines: maxlines,
style: TextStyle(
color: color ?? MyColors.grey3AColor,
fontSize: 21,
letterSpacing: -0.31,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.w600)),
style: TextStyle(color: color ?? MyColors.grey3AColor, fontSize: 21, letterSpacing: -0.31, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.w600)),
);
Widget toText22({Color? color, bool isBold = false}) => Text(
this,
style: TextStyle(
height: 1,
color: color ?? MyColors.darkTextColor,
fontSize: 22,
letterSpacing: -1.44,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
style: TextStyle(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(
this,
style: TextStyle(
height: 23 / 24,
color: color ?? MyColors.darkTextColor,
fontSize: 24,
letterSpacing: -1.44,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
style: TextStyle(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(
this,
style: TextStyle(
height: 32 / 32,
color: color ?? MyColors.darkTextColor,
fontSize: 32,
letterSpacing: -1.92,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
style: TextStyle(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(
this,
style: TextStyle(
height: 32 / 32,
color: color ?? MyColors.darkTextColor,
fontSize: 44,
letterSpacing: -2.64,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
style: TextStyle(height: 32 / 32, color: color ?? MyColors.darkTextColor, fontSize: 44, letterSpacing: -2.64, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
);
Widget toSectionHeading(
{String upperHeading = "", String lowerHeading = ""}) {
Widget toSectionHeading({String upperHeading = "", String lowerHeading = ""}) {
String upper = "";
String lower = "";
String heading = this;
@ -247,9 +191,7 @@ extension EmailValidator on String {
}
bool isValidEmail() {
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);
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);
}
String toFormattedDate() {

@ -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/mohemm_itg_pending_task_responseitem.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';
/// Mix-in [DiagnosticableTreeMixin] to have access to [debugFillProperties] for the devtool
@ -248,6 +249,13 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
return menus;
}
Future<MohemmItgResponseItem?> getITGNotification() async {
MohemmItgResponseItem? res = await DashboardApiClient().getITGPageNotification();
return res;
}
void notify() {
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_countdown_timer/flutter_countdown_timer.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/classes/colors.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/widget_extensions.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/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/menus_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/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/shimmer/dashboard_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;
final GlobalKey<ScaffoldState> _scaffoldState = GlobalKey();
final RefreshController _refreshController =
RefreshController(initialRefresh: false);
final RefreshController _refreshController = RefreshController(initialRefresh: false);
int currentIndex = 0;
@ -59,6 +63,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
void _onRefresh() async {
data.initProvider();
// data.getITGNotification().then((value) {
// print("--------------------detail_1-----------------");
// print(value!.result!.data!.notificationMasterId);
// print(value.result!.data!.notificationTitle);
// });
data.fetchListMenu();
data.fetchAttendanceTracking(context);
data.fetchWorkListCounter(context);
@ -73,6 +82,44 @@ class _DashboardScreenState extends State<DashboardScreen> {
Widget build(BuildContext context) {
return Scaffold(
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(
children: [
Row(
@ -85,8 +132,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
Utils.dataFromBase64String(
AppState().memberInformationList!.eMPLOYEEIMAGE ?? "",
),
errorBuilder: (BuildContext context, Object error,
StackTrace? stackTrace) {
errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) {
return SvgPicture.asset(
"assets/images/user.svg",
height: 34,
@ -109,9 +155,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
_scaffoldState.currentState!.openDrawer();
});
}),
Image.asset("assets/images/logos/main_mohemm_logo.png",
width: 134, height: 28)
.expanded,
Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 28).expanded,
SvgPicture.asset(
"assets/images/announcements.svg",
).onPress(() async {
@ -134,11 +178,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.goodMorning
.tr()
.toText14(color: MyColors.grey77Color),
(AppState().memberInformationList!.eMPLOYEENAME ?? "")
.toText24(isBold: true),
LocaleKeys.goodMorning.tr().toText14(color: MyColors.grey77Color),
(AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true),
16.height,
Row(
children: [
@ -146,223 +187,92 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: AspectRatio(
aspectRatio: 159 / 159,
child: Consumer<DashboardProviderModel>(
builder: (BuildContext context,
DashboardProviderModel model,
Widget? child) {
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
return (model.isAttendanceTrackingLoading
? GetAttendanceTrackingShimmer()
: Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(15),
gradient:
const LinearGradient(
transform:
GradientRotation(
.46),
begin: Alignment
.topRight,
end: Alignment
.bottomLeft,
colors: [
MyColors
.gradiantEndColor,
MyColors
.gradiantStartColor,
]),
borderRadius: BorderRadius.circular(15),
gradient: const LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [
MyColors.gradiantEndColor,
MyColors.gradiantStartColor,
]),
),
child: Stack(
alignment: Alignment.center,
children: [
if (model
.isTimeRemainingInSeconds ==
0)
SvgPicture.asset(
"assets/images/thumb.svg"),
if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
mainAxisSize:
MainAxisSize
.min,
crossAxisAlignment:
CrossAxisAlignment
.start,
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys
.markAttendance
.tr()
.toText14(
color: Colors
.white,
isBold:
true),
if (model
.isTimeRemainingInSeconds ==
0)
DateTime.now()
.toString()
.split(
" ")[0]
.toText12(
color: Colors
.white),
if (model
.isTimeRemainingInSeconds !=
0)
LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true),
if (model.isTimeRemainingInSeconds == 0) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white),
if (model.isTimeRemainingInSeconds != 0)
Column(
mainAxisSize:
MainAxisSize
.min,
crossAxisAlignment:
CrossAxisAlignment
.start,
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
9.height,
CountdownTimer(
endTime: model
.endTime,
onEnd:
null,
endWidget: "00:00:00".toText14(
color: Colors
.white,
isBold:
true),
textStyle: const TextStyle(
color: Colors
.white,
fontSize:
14,
letterSpacing:
-0.48,
fontWeight:
FontWeight.bold),
endTime: model.endTime,
onEnd: null,
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
.timeLeftToday
.tr()
.toText12(
color:
Colors.white),
LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
9.height,
ClipRRect(
borderRadius: const BorderRadius
.all(
Radius.circular(
20)),
child:
LinearProgressIndicator(
value: model
.progress,
minHeight:
8,
valueColor:
const AlwaysStoppedAnimation<Color>(Colors.white),
backgroundColor:
const Color(0xff196D73),
borderRadius: const BorderRadius.all(Radius.circular(20)),
child: LinearProgressIndicator(
value: model.progress,
minHeight: 8,
valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
backgroundColor: const Color(0xff196D73),
),
),
],
),
],
).paddingOnly(
top: 12,
right: 15,
left: 12),
).paddingOnly(top: 12, right: 15, left: 12),
),
Row(
children: [
Expanded(
child: Column(
mainAxisSize:
MainAxisSize
.min,
crossAxisAlignment:
CrossAxisAlignment
.start,
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys
.checkIn
.tr()
.toText12(
color:
Colors.white),
(model.attendanceTracking!.pSwipeIn ==
null
? "--:--"
: model
.attendanceTracking!
.pSwipeIn)
LocaleKeys.checkIn.tr().toText12(color: Colors.white),
(model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn)
.toString()
.toText14(
color: Colors
.white,
isBold:
true),
.toText14(color: Colors.white, isBold: true),
4.height,
],
).paddingOnly(
left: 12,
right: 12),
).paddingOnly(left: 12, right: 12),
),
Container(
margin: EdgeInsets.only(
top: AppState()
.isArabic(
context)
? 6
: 0),
margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0),
width: 45,
height: 45,
padding:
const EdgeInsets
.only(
left: 14,
right:
14),
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),
padding: const EdgeInsets.only(left: 14, right: 14),
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(
model.isTimeRemainingInSeconds ==
0
? "assets/images/play.svg"
: "assets/images/stop.svg"),
child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/play.svg" : "assets/images/stop.svg"),
).onPress(() {
showMyBottomSheet(
context,
child:
MarkAttendanceWidget(
model));
context,
child: MarkAttendanceWidget(model, isFromDashboard: true),
);
}),
],
),
@ -372,10 +282,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
).onPress(
() {
Navigator.pushNamed(
context,
AppRoutes
.todayAttendance);
Navigator.pushNamed(context, AppRoutes.todayAttendance);
},
))
.animatedSwither();
@ -399,11 +306,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
padding: const EdgeInsets.only(top: 31),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.only(
topRight: Radius.circular(50),
topLeft: Radius.circular(50)),
border: Border.all(
color: MyColors.lightGreyEDColor, width: 1),
borderRadius: const BorderRadius.only(topRight: Radius.circular(50), topLeft: Radius.circular(50)),
border: Border.all(color: MyColors.lightGreyEDColor, width: 1),
),
child: Column(
mainAxisSize: MainAxisSize.min,
@ -420,32 +324,22 @@ class _DashboardScreenState extends State<DashboardScreen> {
LocaleKeys.offers.tr().toText12(),
Row(
children: [
LocaleKeys.discounts
.tr()
.toText24(isBold: true),
LocaleKeys.discounts.tr().toText24(isBold: true),
6.width,
Container(
padding: const EdgeInsets.only(
left: 8, right: 8),
padding: const EdgeInsets.only(left: 8, right: 8),
decoration: BoxDecoration(
color: MyColors.yellowColor,
borderRadius:
BorderRadius.circular(10),
borderRadius: BorderRadius.circular(10),
),
child: LocaleKeys.newString
.tr()
.toText10(isBold: true)),
child: LocaleKeys.newString.tr().toText10(isBold: true)),
],
),
],
),
),
LocaleKeys.viewAllOffers
.tr()
.toText12(isUnderLine: true)
.onPress(() {
Navigator.pushNamed(
context, AppRoutes.offersAndDiscounts);
LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() {
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
})
],
).paddingOnly(left: 21, right: 21),
@ -456,56 +350,38 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: ListView.separated(
shrinkWrap: true,
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.only(
left: 21, right: 21, top: 13),
padding: const EdgeInsets.only(left: 21, right: 21, top: 13),
scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext cxt, int index) {
return model.isOffersLoading
? const OffersShimmerWidget()
: InkWell(
onTap: () {
navigateToDetails(
data.getOffersList[index]);
navigateToDetails(data.getOffersList[index]);
},
child: SizedBox(
width: 73,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 73,
height: 73,
decoration: BoxDecoration(
borderRadius:
const BorderRadius
.all(
borderRadius: const BorderRadius.all(
Radius.circular(100),
),
border: Border.all(
color: MyColors
.lightGreyE3Color,
width: 1),
border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
),
child: ClipRRect(
borderRadius:
const BorderRadius
.all(
borderRadius: const BorderRadius.all(
Radius.circular(50),
),
child: Hero(
tag: "ItemImage" +
data
.getOffersList[
index]
.rowID!,
transitionOnUserGestures:
true,
tag: "ItemImage" + data.getOffersList[index].rowID!,
transitionOnUserGestures: true,
child: Image.network(
data
.getOffersList[
index]
.bannerImage!,
data.getOffersList[index].bannerImage!,
fit: BoxFit.contain,
),
),
@ -513,33 +389,16 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
4.height,
Expanded(
child: AppState()
.isArabic(context)
? data
.getOffersList[
index]
.titleAR!
.toText12(
isCenter:
true,
maxLine: 1)
: data
.getOffersList[
index]
.title!
.toText12(
isCenter:
true,
maxLine: 1),
child: AppState().isArabic(context)
? data.getOffersList[index].titleAR!.toText12(isCenter: true, maxLine: 1)
: data.getOffersList[index].title!.toText12(isCenter: true, maxLine: 1),
),
],
),
),
);
},
separatorBuilder:
(BuildContext cxt, int index) =>
8.width,
separatorBuilder: (BuildContext cxt, int index) => 8.width,
itemCount: 6),
);
},
@ -564,18 +423,14 @@ class _DashboardScreenState extends State<DashboardScreen> {
BottomNavigationBarItem(
icon: SvgPicture.asset(
"assets/icons/home.svg",
color: currentIndex == 0
? MyColors.grey3AColor
: MyColors.grey98Color,
color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color,
).paddingAll(4),
label: LocaleKeys.home.tr(),
),
BottomNavigationBarItem(
icon: SvgPicture.asset(
"assets/icons/create_req.svg",
color: currentIndex == 1
? MyColors.grey3AColor
: MyColors.grey98Color,
color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color,
).paddingAll(4),
label: LocaleKeys.createRequest.tr(),
),
@ -585,13 +440,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
children: [
SvgPicture.asset(
"assets/icons/work_list.svg",
color: currentIndex == 2
? MyColors.grey3AColor
: MyColors.grey98Color,
color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color,
).paddingAll(4),
Consumer<DashboardProviderModel>(
builder: (BuildContext cxt, DashboardProviderModel data,
Widget? child) {
builder: (BuildContext cxt, DashboardProviderModel data, Widget? child) {
if (data.workListCounter == 0) {
return const SizedBox();
}
@ -601,12 +453,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Container(
padding: const EdgeInsets.only(left: 4, right: 4),
alignment: Alignment.center,
decoration: BoxDecoration(
color: MyColors.redColor,
borderRadius: BorderRadius.circular(17)),
child: data.workListCounter
.toString()
.toText10(color: Colors.white),
decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)),
child: data.workListCounter.toString().toText10(color: Colors.white),
),
);
},
@ -618,38 +466,26 @@ class _DashboardScreenState extends State<DashboardScreen> {
BottomNavigationBarItem(
icon: SvgPicture.asset(
"assets/icons/item_for_sale.svg",
color: currentIndex == 3
? MyColors.grey3AColor
: MyColors.grey98Color,
color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color,
).paddingAll(4),
label: LocaleKeys.itemsForSale.tr(),
),
BottomNavigationBarItem(
icon: SvgPicture.asset(
"assets/icons/chat/chat.svg",
color: currentIndex == 4
? MyColors.grey3AColor
: MyColors.grey98Color,
color: currentIndex == 4 ? MyColors.grey3AColor : MyColors.grey98Color,
).paddingAll(4),
label: LocaleKeys.chat.tr(),
),
],
currentIndex: currentIndex,
selectedLabelStyle: const TextStyle(
fontSize: 10,
color: MyColors.grey3AColor,
fontWeight: FontWeight.w600),
unselectedLabelStyle: const TextStyle(
fontSize: 10,
color: MyColors.grey98Color,
fontWeight: FontWeight.w600),
selectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey3AColor, fontWeight: FontWeight.w600),
unselectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey98Color, fontWeight: FontWeight.w600),
type: BottomNavigationBarType.fixed,
selectedItemColor: MyColors.grey3AColor,
backgroundColor: MyColors.backgroundColor,
selectedIconTheme:
const IconThemeData(color: MyColors.grey3AColor, size: 28),
unselectedIconTheme:
const IconThemeData(color: MyColors.grey98Color, size: 28),
selectedIconTheme: const IconThemeData(color: MyColors.grey3AColor, size: 28),
unselectedIconTheme: const IconThemeData(color: MyColors.grey98Color, size: 28),
onTap: (int index) {
if (index == 1) {
Navigator.pushNamed(context, AppRoutes.mowadhafhi);
@ -682,7 +518,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
}
});
Navigator.pushNamed(context, AppRoutes.offersAndDiscountsDetails,
arguments: getOffersDetailList);
Navigator.pushNamed(context, AppRoutes.offersAndDiscountsDetails, arguments: getOffersDetailList);
}
}

@ -1,13 +1,19 @@
import 'dart:convert';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.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/utils.dart';
import 'package:mohem_flutter_app/config/routes.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/widget_extensions.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/dynamic_forms/dynamic_textfield_widget.dart';
@ -20,10 +26,14 @@ class SurveyScreen extends StatefulWidget {
class _SurveyScreenState extends State<SurveyScreen> {
String reviewText = "";
int _selectedIndex = -1;
double starRating = 1;
int _selectedIndex = 5;
ItgResponseData? itgResponseData;
@override
Widget build(BuildContext context) {
if (itgResponseData == null) itgResponseData = ModalRoute.of(context)!.settings.arguments as ItgResponseData;
return Scaffold(
backgroundColor: MyColors.backgroundColor,
body: Column(
@ -41,19 +51,23 @@ class _SurveyScreenState extends State<SurveyScreen> {
LocaleKeys.rateUI.tr().toText16(),
22.height,
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
RatingBar.builder(
initialRating: 3,
minRating: 1,
minRating: starRating,
direction: Axis.horizontal,
allowHalfRating: true,
allowHalfRating: false,
itemCount: 5,
itemPadding: EdgeInsets.symmetric(horizontal: 12),
itemPadding: EdgeInsets.symmetric(horizontal: 8),
itemBuilder: (context, _) => Icon(
Icons.star,
color: Colors.amber,
),
onRatingUpdate: (rating) {},
onRatingUpdate: (rating) {
starRating = rating;
},
)
],
).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),
shrinkWrap: true,
children: [
optionUI("poor.svg", 0),
optionUI("bad.svg", 1),
optionUI("normal.svg", 2),
optionUI("good.svg", 3),
optionUI("xcellent.svg", 4),
optionUI("poor.svg", 1),
optionUI("bad.svg", 2),
optionUI("normal.svg", 3),
optionUI("good.svg", 4),
optionUI("xcellent.svg", 5),
],
),
27.height,
@ -78,13 +92,21 @@ class _SurveyScreenState extends State<SurveyScreen> {
LocaleKeys.description.tr(),
LocaleKeys.typeHere.tr(),
lines: 3,
onChange: (v) {
reviewText = v;
},
),
150.height
],
).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(() {});
});
}
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:flutter/material.dart';
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
@ -107,29 +108,37 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> {
child: AspectRatio(
aspectRatio: 265 / 265,
child: CircularStepProgressBar(
totalSteps: 16 * 4,
currentStep: (model.progress * 100).toInt(),
//width: 216,
// height: 216,
selectedColor: MyColors.gradiantEndColor,
unselectedColor: MyColors.grey70Color,
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
CountdownTimer(
endTime: model.endTime,
onEnd: null,
endWidget: "00:00:00".toText32(color: Colors.white, isBold: true),
textStyle: TextStyle(color: Colors.white, fontSize: 32, letterSpacing: -1.92, fontWeight: FontWeight.bold, height: 1),
),
19.height,
LocaleKeys.shiftTime.tr().tr().toText12(color: MyColors.greyACColor),
(model.attendanceTracking!.pShtName ?? "00:00:00").toString().toText22(color: Colors.white, isBold: true),
],
),
),
),
totalSteps: 16 * 4,
currentStep: (model.progress * 100).toInt(),
//width: 216,
// height: 216,
selectedColor: MyColors.gradiantEndColor,
unselectedColor: MyColors.grey70Color,
child: Padding(
padding: const EdgeInsets.all(21.0),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
CountdownTimer(
endTime: model.endTime,
widgetBuilder: (context, v) {
return AutoSizeText(
v!.hours.toString() + " : " + v.min.toString() + " : " + v.sec.toString(),
style: TextStyle(color: Colors.white, fontSize: 42, letterSpacing: -1.92, fontWeight: FontWeight.bold, height: 1),
);
},
onEnd: null,
endWidget: "00:00:00".toTextAuto(color: Colors.white, isBold: true, fontSize: 30, letterSpacing: -1.92),
textStyle: TextStyle(color: Colors.white, fontSize: 30, letterSpacing: -1.92, fontWeight: FontWeight.bold, height: 1),
),
19.height,
LocaleKeys.shiftTime.tr().tr().toTextAuto(color: MyColors.greyACColor, fontSize: 18),
(model.attendanceTracking!.pShtName ?? "00:00:00").toString().toTextAuto(color: Colors.white, isBold: true, fontSize: 26),
],
),
)),
).paddingAll(21),
).expanded,
],

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

@ -1,11 +1,12 @@
import 'package:flutter/material.dart';
void showMDialog(context, {Widget? child}) async {
void showMDialog(context, {Widget? child,Color? backgroundColor,bool isDismissable=true}) async {
return showDialog(
context: context,
barrierDismissible: true,
barrierDismissible: isDismissable,
builder: (context) {
return Dialog(
backgroundColor: backgroundColor,
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/models/generic_response_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/nfc/nfc_reader_sheet.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 {
DashboardProviderModel model;
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
_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);
bool status = await model.fetchAttendanceTracking(context);
Utils.hideLoading(context);
showMDialog(
context,
backgroundColor: Colors.transparent,
isDismissable: false,
child: SuccessDialog(widget.isFromDashboard),
);
} catch (ex) {
print(ex);
Utils.hideLoading(context);
@ -175,6 +184,12 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
if (Platform.isAndroid) {
await closeWifiRequest();
}
showMDialog(
context,
backgroundColor: Colors.transparent,
isDismissable: false,
child: SuccessDialog(widget.isFromDashboard),
);
} catch (ex) {
print("performWifiAttendance: " + ex.toString());
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);
bool status = await model.fetchAttendanceTracking(context);
Utils.hideLoading(context);
showMDialog(
context,
backgroundColor: Colors.transparent,
isDismissable: false,
child: SuccessDialog(widget.isFromDashboard),
);
} catch (ex) {
print(ex);
Utils.hideLoading(context);

@ -91,6 +91,8 @@ dependencies:
video_player: ^2.4.7
dev_dependencies:
flutter_test:
sdk: flutter

Loading…
Cancel
Save