baseproject
This commit is contained in:
210
base_project/lib/model/system_params_model.dart
Normal file
210
base_project/lib/model/system_params_model.dart
Normal file
@@ -0,0 +1,210 @@
|
||||
class SystemParamsModel {
|
||||
final int? id;
|
||||
final int? schedulerTime;
|
||||
final String? leaseTaxCode;
|
||||
final int? vesselConfProcessLimit;
|
||||
final int? rowToDisplay;
|
||||
final int? linkToDisplay;
|
||||
final int? rowToAdd;
|
||||
final int? lovRowToDisplay;
|
||||
final int? lovLinkToDisplay;
|
||||
final String? oidserverName;
|
||||
final String? oidBase;
|
||||
final String? oidAdminUser;
|
||||
final int? oidServerPort;
|
||||
final int? userDefaultGroup;
|
||||
final String? defaultDepartment;
|
||||
final String? defaultPosition;
|
||||
final String? singleCharge;
|
||||
final String? firstDayOftheWeek;
|
||||
final int? hourPerShift;
|
||||
final int? cnBillingFrequency;
|
||||
final String? billingDepartmentCode;
|
||||
final String? basePriceList;
|
||||
final String? nonContainerServiceOrder;
|
||||
final int? ediMaeSchedulerONOFF;
|
||||
final String? ediSchedulerONOFF;
|
||||
final String? uploadLogo;
|
||||
final String? uploadLogoName;
|
||||
final String? uploadLogoPath;
|
||||
final String? companyDisplayName;
|
||||
final bool? isRegitrationAllowed;
|
||||
final List<dynamic>? sysParamUploads;
|
||||
|
||||
SystemParamsModel({
|
||||
this.id,
|
||||
this.schedulerTime,
|
||||
this.leaseTaxCode,
|
||||
this.vesselConfProcessLimit,
|
||||
this.rowToDisplay,
|
||||
this.linkToDisplay,
|
||||
this.rowToAdd,
|
||||
this.lovRowToDisplay,
|
||||
this.lovLinkToDisplay,
|
||||
this.oidserverName,
|
||||
this.oidBase,
|
||||
this.oidAdminUser,
|
||||
this.oidServerPort,
|
||||
this.userDefaultGroup,
|
||||
this.defaultDepartment,
|
||||
this.defaultPosition,
|
||||
this.singleCharge,
|
||||
this.firstDayOftheWeek,
|
||||
this.hourPerShift,
|
||||
this.cnBillingFrequency,
|
||||
this.billingDepartmentCode,
|
||||
this.basePriceList,
|
||||
this.nonContainerServiceOrder,
|
||||
this.ediMaeSchedulerONOFF,
|
||||
this.ediSchedulerONOFF,
|
||||
this.uploadLogo,
|
||||
this.uploadLogoName,
|
||||
this.uploadLogoPath,
|
||||
this.companyDisplayName,
|
||||
this.isRegitrationAllowed,
|
||||
this.sysParamUploads,
|
||||
});
|
||||
|
||||
factory SystemParamsModel.fromJson(Map<String, dynamic> json) {
|
||||
return SystemParamsModel(
|
||||
id: json['id'],
|
||||
schedulerTime: json['schedulerTime'],
|
||||
leaseTaxCode: json['leaseTaxCode'],
|
||||
vesselConfProcessLimit: json['vesselConfProcessLimit'],
|
||||
rowToDisplay: json['rowToDisplay'],
|
||||
linkToDisplay: json['linkToDisplay'],
|
||||
rowToAdd: json['rowToAdd'],
|
||||
lovRowToDisplay: json['lovRowToDisplay'],
|
||||
lovLinkToDisplay: json['lovLinkToDisplay'],
|
||||
oidserverName: json['oidserverName'],
|
||||
oidBase: json['oidBase'],
|
||||
oidAdminUser: json['oidAdminUser'],
|
||||
oidServerPort: json['oidServerPort'],
|
||||
userDefaultGroup: json['userDefaultGroup'],
|
||||
defaultDepartment: json['defaultDepartment'],
|
||||
defaultPosition: json['defaultPosition'],
|
||||
singleCharge: json['singleCharge'],
|
||||
firstDayOftheWeek: json['firstDayOftheWeek'],
|
||||
hourPerShift: json['hourPerShift'],
|
||||
cnBillingFrequency: json['cnBillingFrequency'],
|
||||
billingDepartmentCode: json['billingDepartmentCode'],
|
||||
basePriceList: json['basePriceList'],
|
||||
nonContainerServiceOrder: json['nonContainerServiceOrder'],
|
||||
ediMaeSchedulerONOFF: json['ediMaeSchedulerONOFF'],
|
||||
ediSchedulerONOFF: json['ediSchedulerONOFF'],
|
||||
uploadLogo: json['upload_Logo'],
|
||||
uploadLogoName: json['upload_Logo_name'],
|
||||
uploadLogoPath: json['upload_Logo_path'],
|
||||
companyDisplayName: json['Company_Display_Name'],
|
||||
isRegitrationAllowed: json['isRegitrationAllowed'],
|
||||
sysParamUploads: json['sysParamUploads'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': id,
|
||||
'schedulerTime': schedulerTime,
|
||||
'leaseTaxCode': leaseTaxCode,
|
||||
'vesselConfProcessLimit': vesselConfProcessLimit,
|
||||
'rowToDisplay': rowToDisplay,
|
||||
'linkToDisplay': linkToDisplay,
|
||||
'rowToAdd': rowToAdd,
|
||||
'lovRowToDisplay': lovRowToDisplay,
|
||||
'lovLinkToDisplay': lovLinkToDisplay,
|
||||
'oidserverName': oidserverName,
|
||||
'oidBase': oidBase,
|
||||
'oidAdminUser': oidAdminUser,
|
||||
'oidServerPort': oidServerPort,
|
||||
'userDefaultGroup': userDefaultGroup,
|
||||
'defaultDepartment': defaultDepartment,
|
||||
'defaultPosition': defaultPosition,
|
||||
'singleCharge': singleCharge,
|
||||
'firstDayOftheWeek': firstDayOftheWeek,
|
||||
'hourPerShift': hourPerShift,
|
||||
'cnBillingFrequency': cnBillingFrequency,
|
||||
'billingDepartmentCode': billingDepartmentCode,
|
||||
'basePriceList': basePriceList,
|
||||
'nonContainerServiceOrder': nonContainerServiceOrder,
|
||||
'ediMaeSchedulerONOFF': ediMaeSchedulerONOFF,
|
||||
'ediSchedulerONOFF': ediSchedulerONOFF,
|
||||
'upload_Logo': uploadLogo,
|
||||
'upload_Logo_name': uploadLogoName,
|
||||
'upload_Logo_path': uploadLogoPath,
|
||||
'Company_Display_Name': companyDisplayName,
|
||||
'isRegitrationAllowed': isRegitrationAllowed,
|
||||
'sysParamUploads': sysParamUploads,
|
||||
};
|
||||
}
|
||||
|
||||
SystemParamsModel copyWith({
|
||||
int? id,
|
||||
int? schedulerTime,
|
||||
String? leaseTaxCode,
|
||||
int? vesselConfProcessLimit,
|
||||
int? rowToDisplay,
|
||||
int? linkToDisplay,
|
||||
int? rowToAdd,
|
||||
int? lovRowToDisplay,
|
||||
int? lovLinkToDisplay,
|
||||
String? oidserverName,
|
||||
String? oidBase,
|
||||
String? oidAdminUser,
|
||||
int? oidServerPort,
|
||||
int? userDefaultGroup,
|
||||
String? defaultDepartment,
|
||||
String? defaultPosition,
|
||||
String? singleCharge,
|
||||
String? firstDayOftheWeek,
|
||||
int? hourPerShift,
|
||||
int? cnBillingFrequency,
|
||||
String? billingDepartmentCode,
|
||||
String? basePriceList,
|
||||
String? nonContainerServiceOrder,
|
||||
int? ediMaeSchedulerONOFF,
|
||||
String? ediSchedulerONOFF,
|
||||
String? uploadLogo,
|
||||
String? uploadLogoName,
|
||||
String? uploadLogoPath,
|
||||
String? companyDisplayName,
|
||||
bool? isRegitrationAllowed,
|
||||
List<dynamic>? sysParamUploads,
|
||||
}) {
|
||||
return SystemParamsModel(
|
||||
id: id ?? this.id,
|
||||
schedulerTime: schedulerTime ?? this.schedulerTime,
|
||||
leaseTaxCode: leaseTaxCode ?? this.leaseTaxCode,
|
||||
vesselConfProcessLimit:
|
||||
vesselConfProcessLimit ?? this.vesselConfProcessLimit,
|
||||
rowToDisplay: rowToDisplay ?? this.rowToDisplay,
|
||||
linkToDisplay: linkToDisplay ?? this.linkToDisplay,
|
||||
rowToAdd: rowToAdd ?? this.rowToAdd,
|
||||
lovRowToDisplay: lovRowToDisplay ?? this.lovRowToDisplay,
|
||||
lovLinkToDisplay: lovLinkToDisplay ?? this.lovLinkToDisplay,
|
||||
oidserverName: oidserverName ?? this.oidserverName,
|
||||
oidBase: oidBase ?? this.oidBase,
|
||||
oidAdminUser: oidAdminUser ?? this.oidAdminUser,
|
||||
oidServerPort: oidServerPort ?? this.oidServerPort,
|
||||
userDefaultGroup: userDefaultGroup ?? this.userDefaultGroup,
|
||||
defaultDepartment: defaultDepartment ?? this.defaultDepartment,
|
||||
defaultPosition: defaultPosition ?? this.defaultPosition,
|
||||
singleCharge: singleCharge ?? this.singleCharge,
|
||||
firstDayOftheWeek: firstDayOftheWeek ?? this.firstDayOftheWeek,
|
||||
hourPerShift: hourPerShift ?? this.hourPerShift,
|
||||
cnBillingFrequency: cnBillingFrequency ?? this.cnBillingFrequency,
|
||||
billingDepartmentCode:
|
||||
billingDepartmentCode ?? this.billingDepartmentCode,
|
||||
basePriceList: basePriceList ?? this.basePriceList,
|
||||
nonContainerServiceOrder:
|
||||
nonContainerServiceOrder ?? this.nonContainerServiceOrder,
|
||||
ediMaeSchedulerONOFF: ediMaeSchedulerONOFF ?? this.ediMaeSchedulerONOFF,
|
||||
ediSchedulerONOFF: ediSchedulerONOFF ?? this.ediSchedulerONOFF,
|
||||
uploadLogo: uploadLogo ?? this.uploadLogo,
|
||||
uploadLogoName: uploadLogoName ?? this.uploadLogoName,
|
||||
uploadLogoPath: uploadLogoPath ?? this.uploadLogoPath,
|
||||
companyDisplayName: companyDisplayName ?? this.companyDisplayName,
|
||||
isRegitrationAllowed: isRegitrationAllowed ?? this.isRegitrationAllowed,
|
||||
sysParamUploads: sysParamUploads ?? this.sysParamUploads,
|
||||
);
|
||||
}
|
||||
}
|
||||
57
base_project/lib/model/user/logged_in_user.dart
Normal file
57
base_project/lib/model/user/logged_in_user.dart
Normal file
@@ -0,0 +1,57 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class LoggedUserModel {
|
||||
final String token;
|
||||
final String userId;
|
||||
final String fullname;
|
||||
final String? username;
|
||||
final String email;
|
||||
final String firstName;
|
||||
final List<String> roles;
|
||||
|
||||
LoggedUserModel({
|
||||
required this.token,
|
||||
required this.userId,
|
||||
required this.fullname,
|
||||
this.username,
|
||||
required this.email,
|
||||
required this.firstName,
|
||||
required this.roles,
|
||||
});
|
||||
|
||||
// Factory constructor to create a UserModel from a JSON map
|
||||
factory LoggedUserModel.fromJson(Map<String, dynamic> json) {
|
||||
return LoggedUserModel(
|
||||
token: json['token'] as String,
|
||||
userId: json['userId'] as String,
|
||||
fullname: json['fullname'] as String,
|
||||
username: json['username'] as String?,
|
||||
email: json['email'] as String,
|
||||
firstName: json['firstName'] as String,
|
||||
roles: List<String>.from(json['roles'] as List<dynamic>),
|
||||
);
|
||||
}
|
||||
|
||||
// Method to convert UserModel to JSON map
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'token': token,
|
||||
'userId': userId,
|
||||
'fullname': fullname,
|
||||
'username': username,
|
||||
'email': email,
|
||||
'firstName': firstName,
|
||||
'roles': roles,
|
||||
};
|
||||
}
|
||||
|
||||
// Method to convert UserModel to a JSON string
|
||||
String toJsonString() {
|
||||
return json.encode(toJson());
|
||||
}
|
||||
|
||||
// Factory constructor to create a UserModel from a JSON string
|
||||
factory LoggedUserModel.fromJsonString(String jsonString) {
|
||||
return LoggedUserModel.fromJson(json.decode(jsonString));
|
||||
}
|
||||
}
|
||||
49
base_project/lib/model/user/user_model_admin.dart
Normal file
49
base_project/lib/model/user/user_model_admin.dart
Normal file
@@ -0,0 +1,49 @@
|
||||
class UserModelAdmin {
|
||||
final String id;
|
||||
final String userId;
|
||||
final String userName;
|
||||
final String fullName;
|
||||
final String email;
|
||||
final bool isPunchIn;
|
||||
final bool isPunchOut;
|
||||
final bool onBreak;
|
||||
|
||||
UserModelAdmin({
|
||||
required this.id,
|
||||
required this.userId,
|
||||
required this.userName,
|
||||
required this.fullName,
|
||||
required this.email,
|
||||
required this.isPunchIn,
|
||||
required this.isPunchOut,
|
||||
required this.onBreak,
|
||||
});
|
||||
|
||||
// Factory method to create a User from JSON
|
||||
factory UserModelAdmin.fromJson(Map<String, dynamic> json) {
|
||||
return UserModelAdmin(
|
||||
id: json['id'].toString(),
|
||||
userId: json['userId'].toString(),
|
||||
userName: json['userName'] ?? '',
|
||||
fullName: json['fullName'] ?? '',
|
||||
email: json['email'] ?? '',
|
||||
isPunchIn: json['isPunchIn'] ?? false,
|
||||
isPunchOut: json['isPunchOut'] ?? false,
|
||||
onBreak: json['onBreak'] ?? false,
|
||||
);
|
||||
}
|
||||
|
||||
// Convert User to JSON
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': id,
|
||||
'userId': userId,
|
||||
'userName': userName,
|
||||
'fullName': fullName,
|
||||
'email': email,
|
||||
'isPunchIn': isPunchIn,
|
||||
'isPunchOut': isPunchOut,
|
||||
'onBreak': onBreak,
|
||||
};
|
||||
}
|
||||
}
|
||||
26
base_project/lib/model/user/user_profile.dart
Normal file
26
base_project/lib/model/user/user_profile.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
class UserProfile {
|
||||
final dynamic userId;
|
||||
final String username;
|
||||
final String email;
|
||||
final dynamic mobNo;
|
||||
final String fullName;
|
||||
|
||||
UserProfile({
|
||||
required this.userId,
|
||||
required this.username,
|
||||
required this.email,
|
||||
required this.mobNo,
|
||||
required this.fullName,
|
||||
});
|
||||
|
||||
factory UserProfile.fromJson(Map<String, dynamic> json) {
|
||||
return UserProfile(
|
||||
userId: json['userId'],
|
||||
username: json['username'],
|
||||
email: json['email'],
|
||||
mobNo: json['mob_no'],
|
||||
fullName: json['fullName'],
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user