wokrlist api's added & improvements
parent
7027299a48
commit
4b5ab2cd7f
@ -0,0 +1,41 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:mohem_flutter_app/api/api_client.dart';
|
||||
import 'package:mohem_flutter_app/app_state/app_state.dart';
|
||||
import 'package:mohem_flutter_app/classes/consts.dart';
|
||||
import 'package:mohem_flutter_app/models/dashboard/itg_forms_model.dart';
|
||||
import 'package:mohem_flutter_app/models/generic_response_model.dart';
|
||||
import 'package:mohem_flutter_app/models/worklist_response_model.dart';
|
||||
|
||||
class WorkListApiClient {
|
||||
static final WorkListApiClient _instance = WorkListApiClient._internal();
|
||||
|
||||
WorkListApiClient._internal();
|
||||
|
||||
factory WorkListApiClient() => _instance;
|
||||
|
||||
Future<List<WorkListResponseModel>?> getWorkList(int pPageNum, String pItemType) async {
|
||||
String url = "${ApiConsts.erpRest}GET_WORKLIST";
|
||||
Map<String, dynamic> postParams = {
|
||||
"P_NOTIFICATION_TYPE": "1",
|
||||
"P_PAGE_NUM": pPageNum,
|
||||
"P_PAGE_LIMIT": 50,
|
||||
"P_ITEM_TYPE": pItemType,
|
||||
};
|
||||
postParams.addAll(AppState().postParamsJson);
|
||||
return await ApiClient().postJsonForObject((json) {
|
||||
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
||||
return responseData.getWorkList;
|
||||
}, url, postParams);
|
||||
}
|
||||
|
||||
Future<ItgFormsModel?> GetITGTaskCountRequestType() async {
|
||||
String url = "${ApiConsts.cocRest}ITGGetTaskCountRequestType";
|
||||
Map<String, dynamic> postParams = {};
|
||||
postParams.addAll(AppState().postParamsJson);
|
||||
return await ApiClient().postJsonForObject((json) {
|
||||
ItgFormsModel responseData = ItgFormsModel.fromJson(json);
|
||||
return responseData;
|
||||
}, url, postParams);
|
||||
}
|
||||
}
|
@ -0,0 +1,444 @@
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class DateUtil {
|
||||
/// convert String To Date function
|
||||
/// [date] String we want to convert
|
||||
static DateTime convertStringToDate(String date) {
|
||||
// /Date(1585774800000+0300)/
|
||||
if (date != null) {
|
||||
const start = "/Date(";
|
||||
const end = "+0300)";
|
||||
final startIndex = date.indexOf(start);
|
||||
final endIndex = date.indexOf(end, startIndex + start.length);
|
||||
return DateTime.fromMillisecondsSinceEpoch(
|
||||
int.parse(
|
||||
date.substring(startIndex + start.length, endIndex),
|
||||
),
|
||||
);
|
||||
} else
|
||||
return DateTime.now();
|
||||
}
|
||||
|
||||
static DateTime convertSimpleStringDateToDate(String date) {
|
||||
return DateFormat("MM/dd/yyyy hh:mm:ss").parse(date);
|
||||
}
|
||||
|
||||
static DateTime convertStringToDateNoTimeZone(String date) {
|
||||
// /Date(1585774800000+0300)/
|
||||
if (date != null) {
|
||||
const start = "/Date(";
|
||||
const end = ")";
|
||||
final startIndex = date.indexOf(start);
|
||||
final endIndex = date.indexOf(end, startIndex + start.length);
|
||||
return DateTime.fromMillisecondsSinceEpoch(
|
||||
int.parse(
|
||||
date.substring(startIndex + start.length, endIndex),
|
||||
),
|
||||
);
|
||||
} else
|
||||
return DateTime.now();
|
||||
}
|
||||
|
||||
static DateTime convertStringToDateTime(String date) {
|
||||
if (date != null) {
|
||||
try {
|
||||
var dateT = date.split('/');
|
||||
var year = dateT[2].substring(0, 4);
|
||||
var dateP = DateTime(int.parse(year), int.parse(dateT[1]), int.parse(dateT[0]));
|
||||
return dateP;
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
|
||||
return DateTime.now();
|
||||
} else
|
||||
return DateTime.now();
|
||||
}
|
||||
|
||||
static String convertDateToString(DateTime date) {
|
||||
const start = "/Date(";
|
||||
const end = "+0300)";
|
||||
int milliseconds = date.millisecondsSinceEpoch;
|
||||
|
||||
return start + "$milliseconds" + end;
|
||||
}
|
||||
|
||||
static String convertDateToStringLocation(DateTime date) {
|
||||
const start = "/Date(";
|
||||
const end = ")/";
|
||||
int milliseconds = date.millisecondsSinceEpoch;
|
||||
|
||||
return start + "$milliseconds" + end;
|
||||
}
|
||||
|
||||
static String formatDateToDate(DateTime date, bool isArabic) {
|
||||
return DateFormat('dd MMM yyy', isArabic ? "ar_SA" : "en_US").format(date);
|
||||
}
|
||||
|
||||
static String formatDateToTime(DateTime date) {
|
||||
return DateFormat('hh:mm a').format(date);
|
||||
}
|
||||
|
||||
static String yearMonthDay(DateTime dateTime) {
|
||||
String dateFormat = '${dateTime.year}-${dateTime.month}-${dateTime.day}';
|
||||
return dateFormat;
|
||||
}
|
||||
|
||||
static String time(DateTime dateTime) {
|
||||
String dateFormat = '${dateTime.hour}:${dateTime.minute}:00';
|
||||
return dateFormat;
|
||||
}
|
||||
|
||||
static String convertDateMSToJsonDate(utc) {
|
||||
var dt = new DateTime.fromMicrosecondsSinceEpoch(utc);
|
||||
|
||||
return "/Date(" + (dt.millisecondsSinceEpoch * 1000).toString() + '+0300' + ")/";
|
||||
}
|
||||
|
||||
/// check Date
|
||||
/// [dateString] String we want to convert
|
||||
static String checkDate(DateTime checkedTime) {
|
||||
DateTime currentTime = DateTime.now();
|
||||
if ((currentTime.year == checkedTime.year) && (currentTime.month == checkedTime.month) && (currentTime.day == checkedTime.day)) {
|
||||
return "Today";
|
||||
} else if ((currentTime.year == checkedTime.year) && (currentTime.month == checkedTime.month)) {
|
||||
if ((currentTime.day - checkedTime.day) == 1) {
|
||||
return "YESTERDAY";
|
||||
} else if ((currentTime.day - checkedTime.day) == -1) {
|
||||
return "Tomorrow";
|
||||
}
|
||||
|
||||
if ((currentTime.day - checkedTime.day) <= -2) {
|
||||
return "Next Week";
|
||||
} else {
|
||||
return "Old Date";
|
||||
}
|
||||
}
|
||||
return "Old Date";
|
||||
}
|
||||
|
||||
static String getDateFormatted(String date) {
|
||||
DateTime dateObj = DateUtil.convertStringToDate(date);
|
||||
return DateUtil.getWeekDay(dateObj.weekday) + ", " + dateObj.day.toString() + " " + DateUtil.getMonth(dateObj.month) + " " + dateObj.year.toString();
|
||||
}
|
||||
|
||||
static String getISODateFormat(DateTime dateTime) {
|
||||
// 2020-04-30T00:00:00.000
|
||||
return dateTime.toIso8601String();
|
||||
}
|
||||
|
||||
/// get month by
|
||||
/// [month] convert month number in to month name
|
||||
static getMonth(int month) {
|
||||
switch (month) {
|
||||
case 1:
|
||||
return "January";
|
||||
case 2:
|
||||
return "February";
|
||||
case 3:
|
||||
return "March";
|
||||
case 4:
|
||||
return "April";
|
||||
case 5:
|
||||
return "May";
|
||||
case 6:
|
||||
return "June";
|
||||
case 7:
|
||||
return "July";
|
||||
case 8:
|
||||
return "August";
|
||||
case 9:
|
||||
return "September";
|
||||
case 10:
|
||||
return "October";
|
||||
case 11:
|
||||
return "November";
|
||||
case 12:
|
||||
return "December";
|
||||
}
|
||||
}
|
||||
|
||||
/// get month by
|
||||
/// [month] convert month number in to month name in Arabic
|
||||
static getMonthArabic(int month) {
|
||||
switch (month) {
|
||||
case 1:
|
||||
return "يناير";
|
||||
case 2:
|
||||
return " فبراير";
|
||||
case 3:
|
||||
return "مارس";
|
||||
case 4:
|
||||
return "أبريل";
|
||||
case 5:
|
||||
return "مايو";
|
||||
case 6:
|
||||
return "يونيو";
|
||||
case 7:
|
||||
return "يوليو";
|
||||
case 8:
|
||||
return "أغسطس";
|
||||
case 9:
|
||||
return "سبتمبر";
|
||||
case 10:
|
||||
return " اكتوبر";
|
||||
case 11:
|
||||
return " نوفمبر";
|
||||
case 12:
|
||||
return "ديسمبر";
|
||||
}
|
||||
}
|
||||
|
||||
static getMonthByName(String month) {
|
||||
switch (month.toLowerCase()) {
|
||||
case 'january':
|
||||
return 1;
|
||||
case 'february':
|
||||
return 2;
|
||||
case 'march':
|
||||
return 3;
|
||||
case 'april':
|
||||
return 4;
|
||||
case 'may':
|
||||
return 5;
|
||||
case 'june':
|
||||
return 6;
|
||||
case 'july':
|
||||
return 7;
|
||||
case 'august':
|
||||
return 8;
|
||||
case 'september':
|
||||
return 9;
|
||||
case 'october':
|
||||
return 10;
|
||||
case 'november':
|
||||
return 11;
|
||||
case 'december':
|
||||
return 12;
|
||||
}
|
||||
}
|
||||
|
||||
static DateTime getMonthDateTime(String month, yearName) {
|
||||
DateTime? date;
|
||||
try {
|
||||
date = DateTime(int.parse(yearName), getMonthByName(month));
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
return date ?? DateTime.now();
|
||||
}
|
||||
|
||||
/// get month by
|
||||
/// [weekDay] convert week day in int to week day name
|
||||
static getWeekDay(int weekDay) {
|
||||
switch (weekDay) {
|
||||
case 1:
|
||||
return "Monday";
|
||||
case 2:
|
||||
return "Tuesday";
|
||||
case 3:
|
||||
return "Wednesday";
|
||||
case 4:
|
||||
return "Thursday";
|
||||
case 5:
|
||||
return "Friday";
|
||||
case 6:
|
||||
return "Saturday ";
|
||||
case 7:
|
||||
return "Sunday";
|
||||
}
|
||||
}
|
||||
|
||||
/// get month by
|
||||
/// [weekDay] convert week day in int to week day name arabic
|
||||
static getWeekDayArabic(int weekDay) {
|
||||
switch (weekDay) {
|
||||
case 1:
|
||||
return "الاثنين";
|
||||
case 2:
|
||||
return "الثلاثاء";
|
||||
case 3:
|
||||
return "الاربعاء";
|
||||
case 4:
|
||||
return "الخميس";
|
||||
case 5:
|
||||
return "الجمعه";
|
||||
case 6:
|
||||
return "السبت ";
|
||||
case 7:
|
||||
return "الاحد";
|
||||
}
|
||||
}
|
||||
|
||||
static getWeekDayEnglish(int weekDay) {
|
||||
switch (weekDay) {
|
||||
case 1:
|
||||
return "Monday";
|
||||
case 2:
|
||||
return "Tuesday";
|
||||
case 3:
|
||||
return "Wednesday";
|
||||
case 4:
|
||||
return "Thursday";
|
||||
case 5:
|
||||
return "Friday";
|
||||
case 6:
|
||||
return "Saturday ";
|
||||
case 7:
|
||||
return "Sunday";
|
||||
}
|
||||
}
|
||||
|
||||
/// get data formatted like Apr 26,2020
|
||||
/// [dateTime] convert DateTime to data formatted
|
||||
static String getMonthDayYearDateFormatted(DateTime dateTime) {
|
||||
if (dateTime != null)
|
||||
return getMonth(dateTime.month) + " " + dateTime.day.toString() + ", " + dateTime.year.toString();
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
/// get data formatted like Apr 26,2020
|
||||
/// [dateTime] convert DateTime to data formatted Arabic
|
||||
static String getMonthDayYearDateFormattedAr(DateTime dateTime) {
|
||||
if (dateTime != null)
|
||||
return getMonthArabic(dateTime.month) + " " + dateTime.day.toString() + ", " + dateTime.year.toString();
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
/// get data formatted like Thursday, Apr 26,2020
|
||||
/// [dateTime] convert DateTime to date formatted
|
||||
static String getWeekDayMonthDayYearDateFormatted(DateTime dateTime, String lang) {
|
||||
// print(dateTime);
|
||||
// print(dateTime.weekday);
|
||||
// print(dateTime.weekday.getDayOfWeekEnumValue.value);
|
||||
if (dateTime != null)
|
||||
return lang == 'en'
|
||||
? getWeekDayEnglish(dateTime.weekday) + ", " + getMonth(dateTime.month) + " " + dateTime.day.toString() + " " + dateTime.year.toString()
|
||||
: getWeekDayArabic(dateTime.weekday) + ", " + dateTime.day.toString() + " " + getMonthArabic(dateTime.month) + " " + dateTime.year.toString();
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
static String getMonthDayYearLangDateFormatted(DateTime dateTime, String lang) {
|
||||
if (dateTime != null)
|
||||
return lang == 'en'
|
||||
? getMonth(dateTime.month) + " " + dateTime.day.toString() + " " + dateTime.year.toString()
|
||||
: dateTime.day.toString() + " " + getMonthArabic(dateTime.month) + " " + dateTime.year.toString();
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
/// get data formatted like 26/4/2020
|
||||
static String getDayMonthYearLangDateFormatted(DateTime dateTime, String lang) {
|
||||
if (dateTime != null)
|
||||
return lang == 'en'
|
||||
? dateTime.day.toString() + " " + getMonth(dateTime.month) + " " + dateTime.year.toString()
|
||||
: dateTime.day.toString() + " " + getMonthArabic(dateTime.month) + " " + dateTime.year.toString();
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
static String getMonthYearLangDateFormatted(DateTime dateTime, String lang) {
|
||||
if (dateTime != null)
|
||||
return lang == 'en' ? getMonth(dateTime.month) + " " + dateTime.year.toString() : getMonthArabic(dateTime.month) + " " + dateTime.year.toString();
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
/// get data formatted like 26/4/2020
|
||||
/// [dateTime] convert DateTime to data formatted
|
||||
static String getDayMonthYearDateFormatted(DateTime dateTime) {
|
||||
if (dateTime != null)
|
||||
return dateTime.day.toString() + "/" + dateTime.month.toString() + "/" + dateTime.year.toString();
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
/// get data formatted like 26/4/2020
|
||||
/// [dateTime] convert DateTime to data formatted
|
||||
static String getDayMonthDateFormatted(DateTime dateTime) {
|
||||
if (dateTime != null)
|
||||
return DateFormat('dd/MM').format(dateTime);
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
/// get data formatted like 26/4/2020
|
||||
/// [dateTime] convert DateTime to data formatted according to language
|
||||
static String getDayMonthYearDateFormattedLang(DateTime dateTime, bool isArabic) {
|
||||
if (dateTime != null)
|
||||
return DateFormat('dd/MM/yyyy', isArabic ? "ar_SA" : "en_US").format(dateTime);
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
/// get data formatted like 10:30 according to lang
|
||||
static String formatDateToTimeLang(DateTime date, bool isArabic) {
|
||||
return DateFormat('HH:mm', isArabic ? "ar_SA" : "en_US").format(date);
|
||||
}
|
||||
|
||||
/// get data formatted like 26/4/2020 10:30
|
||||
/// [dateTime] convert DateTime to data formatted
|
||||
static String getDayMonthYearHourMinuteDateFormatted(DateTime dateTime) {
|
||||
if (dateTime != null)
|
||||
return dateTime.day.toString() + "/" + dateTime.month.toString() + "/" + dateTime.year.toString() + " " + DateFormat('HH:mm').format(dateTime);
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
/// get data formatted like 2020-8-13 09:43:00
|
||||
/// [dateTime] convert DateTime to data formatted
|
||||
static String getYearMonthDayHourMinSecDateFormatted(DateTime dateTime) {
|
||||
if (dateTime != null)
|
||||
return dateTime.year.toString() +
|
||||
"-" +
|
||||
dateTime.month.toString() +
|
||||
"-" +
|
||||
dateTime.day.toString() +
|
||||
" " +
|
||||
dateTime.hour.toString() +
|
||||
":" +
|
||||
dateTime.minute.toString() +
|
||||
":" +
|
||||
dateTime.second.toString();
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
static String getFormattedDate(DateTime dateTime, String formattedString) {
|
||||
return DateFormat(formattedString).format(dateTime);
|
||||
}
|
||||
|
||||
static convertISODateToJsonDate(String isoDate) {
|
||||
return "/Date(" + DateFormat('mm-dd-yyy').parse(isoDate).millisecondsSinceEpoch.toString() + ")/";
|
||||
}
|
||||
|
||||
// static String getDay(DayOfWeek dayOfWeek) {
|
||||
// switch (dayOfWeek) {
|
||||
// case DayOfWeek.Monday:
|
||||
// return "Monday";
|
||||
// break;
|
||||
// case DayOfWeek.Tuesday:
|
||||
// return "Tuesday";
|
||||
// break;
|
||||
// case DayOfWeek.Wednesday:
|
||||
// return "Wednesday";
|
||||
// break;
|
||||
// case DayOfWeek.Thursday:
|
||||
// return "Thursday";
|
||||
// break;
|
||||
// case DayOfWeek.Friday:
|
||||
// return "Friday";
|
||||
// break;
|
||||
// case DayOfWeek.Saturday:
|
||||
// return "Saturday";
|
||||
// break;
|
||||
// case DayOfWeek.Sunday:
|
||||
// return "Sunday";
|
||||
// break;
|
||||
// }
|
||||
// return "";
|
||||
// }
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
import 'dart:ui';
|
||||
|
||||
class WorkListItemTypeModelData {
|
||||
late int value;
|
||||
late String name;
|
||||
late String fullName;
|
||||
late bool active;
|
||||
late List<Color> color;
|
||||
late String icon;
|
||||
late String key;
|
||||
late bool disable;
|
||||
|
||||
WorkListItemTypeModelData({required this.value, required this.name, required this.fullName, required this.active, required this.color, required this.icon, required this.key, required this.disable});
|
||||
|
||||
WorkListItemTypeModelData.fromJson(Map<String, dynamic> json) {
|
||||
value = json['value'];
|
||||
name = json['name'];
|
||||
fullName = json['fullName'];
|
||||
active = json['active'];
|
||||
color = json['color'];
|
||||
icon = json['icon'];
|
||||
key = json['key'];
|
||||
disable = json['disable'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['value'] = value;
|
||||
data['name'] = name;
|
||||
data['fullName'] = fullName;
|
||||
data['active'] = active;
|
||||
data['color'] = color;
|
||||
data['icon'] = icon;
|
||||
data['key'] = key;
|
||||
data['disable'] = disable;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,137 @@
|
||||
|
||||
class WorkListResponseModel {
|
||||
String? bEGINDATE;
|
||||
String? dUEDATE;
|
||||
String? eNDDATE;
|
||||
String? fROMROLE;
|
||||
int? fROMROWNUM;
|
||||
String? fROMUSER;
|
||||
String? fUNCTIONNAME;
|
||||
String? iTEMKEY;
|
||||
String? iTEMTYPE;
|
||||
String? iTEMTYPEDISPLAYNAME;
|
||||
String? lANGUAGE;
|
||||
String? mAILSTATUS;
|
||||
String? mOREINFOROLE;
|
||||
int? nOTIFICATIONID;
|
||||
String? nOTIFICATIONNAME;
|
||||
int? nOOFROWS;
|
||||
String? oRIGINALRECIPIENT;
|
||||
String? pONUMBER;
|
||||
int? pRIORITY;
|
||||
String? pRIORITYF;
|
||||
String? pRNUMBER;
|
||||
String? rECIPIENTROLE;
|
||||
String? rEQUESTNUMBER;
|
||||
String? rEQUESTTYPE;
|
||||
String? rESPONDER;
|
||||
int? rOWNUM;
|
||||
String? sELECTEDEMPLOYEENUMBER;
|
||||
String? sTATUS;
|
||||
String? sUBJECT;
|
||||
int? tOROWNUM;
|
||||
String? tOUSER;
|
||||
|
||||
WorkListResponseModel(
|
||||
{this.bEGINDATE,
|
||||
this.dUEDATE,
|
||||
this.eNDDATE,
|
||||
this.fROMROLE,
|
||||
this.fROMROWNUM,
|
||||
this.fROMUSER,
|
||||
this.fUNCTIONNAME,
|
||||
this.iTEMKEY,
|
||||
this.iTEMTYPE,
|
||||
this.iTEMTYPEDISPLAYNAME,
|
||||
this.lANGUAGE,
|
||||
this.mAILSTATUS,
|
||||
this.mOREINFOROLE,
|
||||
this.nOTIFICATIONID,
|
||||
this.nOTIFICATIONNAME,
|
||||
this.nOOFROWS,
|
||||
this.oRIGINALRECIPIENT,
|
||||
this.pONUMBER,
|
||||
this.pRIORITY,
|
||||
this.pRIORITYF,
|
||||
this.pRNUMBER,
|
||||
this.rECIPIENTROLE,
|
||||
this.rEQUESTNUMBER,
|
||||
this.rEQUESTTYPE,
|
||||
this.rESPONDER,
|
||||
this.rOWNUM,
|
||||
this.sELECTEDEMPLOYEENUMBER,
|
||||
this.sTATUS,
|
||||
this.sUBJECT,
|
||||
this.tOROWNUM,
|
||||
this.tOUSER});
|
||||
|
||||
WorkListResponseModel.fromJson(Map<String, dynamic> json) {
|
||||
bEGINDATE = json['BEGIN_DATE'];
|
||||
dUEDATE = json['DUE_DATE'];
|
||||
eNDDATE = json['END_DATE'];
|
||||
fROMROLE = json['FROM_ROLE'];
|
||||
fROMROWNUM = json['FROM_ROW_NUM'];
|
||||
fROMUSER = json['FROM_USER'];
|
||||
fUNCTIONNAME = json['FUNCTION_NAME'];
|
||||
iTEMKEY = json['ITEM_KEY'];
|
||||
iTEMTYPE = json['ITEM_TYPE'];
|
||||
iTEMTYPEDISPLAYNAME = json['ITEM_TYPE_DISPLAY_NAME'];
|
||||
lANGUAGE = json['LANGUAGE'];
|
||||
mAILSTATUS = json['MAIL_STATUS'];
|
||||
mOREINFOROLE = json['MORE_INFO_ROLE'];
|
||||
nOTIFICATIONID = json['NOTIFICATION_ID'];
|
||||
nOTIFICATIONNAME = json['NOTIFICATION_NAME'];
|
||||
nOOFROWS = json['NO_OF_ROWS'];
|
||||
oRIGINALRECIPIENT = json['ORIGINAL_RECIPIENT'];
|
||||
pONUMBER = json['PO_NUMBER'];
|
||||
pRIORITY = json['PRIORITY'];
|
||||
pRIORITYF = json['PRIORITY_F'];
|
||||
pRNUMBER = json['PR_NUMBER'];
|
||||
rECIPIENTROLE = json['RECIPIENT_ROLE'];
|
||||
rEQUESTNUMBER = json['REQUEST_NUMBER'];
|
||||
rEQUESTTYPE = json['REQUEST_TYPE'];
|
||||
rESPONDER = json['RESPONDER'];
|
||||
rOWNUM = json['ROW_NUM'];
|
||||
sELECTEDEMPLOYEENUMBER = json['SELECTED_EMPLOYEE_NUMBER'];
|
||||
sTATUS = json['STATUS'];
|
||||
sUBJECT = json['SUBJECT'];
|
||||
tOROWNUM = json['TO_ROW_NUM'];
|
||||
tOUSER = json['TO_USER'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['BEGIN_DATE'] = this.bEGINDATE;
|
||||
data['DUE_DATE'] = this.dUEDATE;
|
||||
data['END_DATE'] = this.eNDDATE;
|
||||
data['FROM_ROLE'] = this.fROMROLE;
|
||||
data['FROM_ROW_NUM'] = this.fROMROWNUM;
|
||||
data['FROM_USER'] = this.fROMUSER;
|
||||
data['FUNCTION_NAME'] = this.fUNCTIONNAME;
|
||||
data['ITEM_KEY'] = this.iTEMKEY;
|
||||
data['ITEM_TYPE'] = this.iTEMTYPE;
|
||||
data['ITEM_TYPE_DISPLAY_NAME'] = this.iTEMTYPEDISPLAYNAME;
|
||||
data['LANGUAGE'] = this.lANGUAGE;
|
||||
data['MAIL_STATUS'] = this.mAILSTATUS;
|
||||
data['MORE_INFO_ROLE'] = this.mOREINFOROLE;
|
||||
data['NOTIFICATION_ID'] = this.nOTIFICATIONID;
|
||||
data['NOTIFICATION_NAME'] = this.nOTIFICATIONNAME;
|
||||
data['NO_OF_ROWS'] = this.nOOFROWS;
|
||||
data['ORIGINAL_RECIPIENT'] = this.oRIGINALRECIPIENT;
|
||||
data['PO_NUMBER'] = this.pONUMBER;
|
||||
data['PRIORITY'] = this.pRIORITY;
|
||||
data['PRIORITY_F'] = this.pRIORITYF;
|
||||
data['PR_NUMBER'] = this.pRNUMBER;
|
||||
data['RECIPIENT_ROLE'] = this.rECIPIENTROLE;
|
||||
data['REQUEST_NUMBER'] = this.rEQUESTNUMBER;
|
||||
data['REQUEST_TYPE'] = this.rEQUESTTYPE;
|
||||
data['RESPONDER'] = this.rESPONDER;
|
||||
data['ROW_NUM'] = this.rOWNUM;
|
||||
data['SELECTED_EMPLOYEE_NUMBER'] = this.sELECTEDEMPLOYEENUMBER;
|
||||
data['STATUS'] = this.sTATUS;
|
||||
data['SUBJECT'] = this.sUBJECT;
|
||||
data['TO_ROW_NUM'] = this.tOROWNUM;
|
||||
data['TO_USER'] = this.tOUSER;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
import 'package:easy_localization/src/public_ext.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mohem_flutter_app/classes/colors.dart';
|
||||
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
|
||||
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
|
||||
|
||||
AppBar appBar(BuildContext context, {required String title}) {
|
||||
return AppBar(
|
||||
title: title.toText24(color: MyColors.darkTextColor),
|
||||
centerTitle: false,
|
||||
automaticallyImplyLeading: false,
|
||||
backgroundColor: Colors.white,
|
||||
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
color: MyColors.darkIconColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mohem_flutter_app/classes/colors.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';
|
||||
|
||||
AppBar AppBarWidget(BuildContext context, {required String title, bool showHomeButton = false}) {
|
||||
return AppBar(
|
||||
leadingWidth: 0,
|
||||
// leading: GestureDetector(
|
||||
// behavior: HitTestBehavior.opaque,
|
||||
// onTap: Feedback.wrapForTap(() => Navigator.maybePop(context), context),
|
||||
// child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
|
||||
// ),
|
||||
//titleSpacing: -1.44,
|
||||
title: Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: Feedback.wrapForTap(() => Navigator.maybePop(context), context),
|
||||
child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
|
||||
),
|
||||
4.width,
|
||||
title.toText24(color: MyColors.darkTextColor, isBold: true, considerHeight: false).expanded,
|
||||
],
|
||||
),
|
||||
centerTitle: false,
|
||||
elevation: 0,
|
||||
backgroundColor: Colors.white,
|
||||
actions: [
|
||||
if (showHomeButton)
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
// Navigator.pushAndRemoveUntil(
|
||||
// context,
|
||||
// MaterialPageRoute(builder: (context) => LandingPage()),
|
||||
// (Route<dynamic> route) => false,
|
||||
// );
|
||||
},
|
||||
icon: const Icon(Icons.home, color: MyColors.darkIconColor),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
Loading…
Reference in New Issue