first commit
This commit is contained in:
34
lib/data/authentication/auth_request.dart
Normal file
34
lib/data/authentication/auth_request.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
class LoginRequest {
|
||||
String? contactno;
|
||||
int? configid;
|
||||
String? customertoken;
|
||||
String? devicetype;
|
||||
String? deviceid;
|
||||
|
||||
LoginRequest(
|
||||
{this.contactno,
|
||||
this.configid,
|
||||
this.customertoken,
|
||||
this.devicetype,
|
||||
this.deviceid}
|
||||
|
||||
);
|
||||
|
||||
LoginRequest.fromJson(Map<String, dynamic> json) {
|
||||
contactno = json['contactno'];
|
||||
configid = json['configid'];
|
||||
customertoken = json['customertoken'];
|
||||
devicetype = json['devicetype'];
|
||||
deviceid = json['deviceid'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['contactno'] = contactno;
|
||||
data['configid'] = configid;
|
||||
data['customertoken'] = customertoken;
|
||||
data['devicetype'] = devicetype;
|
||||
data['deviceid'] = deviceid;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
29
lib/data/authentication/auth_response.dart
Normal file
29
lib/data/authentication/auth_response.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
import '../../modules/authentication/auth.dart';
|
||||
|
||||
class LoginResponse {
|
||||
int? code;
|
||||
Authentication? details;
|
||||
String? message;
|
||||
bool? status;
|
||||
|
||||
LoginResponse({this.code, this.details, this.message, this.status});
|
||||
|
||||
LoginResponse.fromJson(Map<String, dynamic> json) {
|
||||
code = json['code'];
|
||||
details =
|
||||
json['details'] != null ? new Authentication.fromJson(json['details']) : null;
|
||||
message = json['message'];
|
||||
status = json['status'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['code'] = this.code;
|
||||
if (this.details != null) {
|
||||
data['details'] = this.details!.toJson();
|
||||
}
|
||||
data['message'] = this.message;
|
||||
data['status'] = this.status;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
19
lib/data/tenant/get_tenant_res.dart
Normal file
19
lib/data/tenant/get_tenant_res.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
import '../../modules/tenant/get_tenant.dart';
|
||||
|
||||
class CustomerTenantResponse {
|
||||
final Customer customer;
|
||||
final List<Tenant> tenants;
|
||||
|
||||
CustomerTenantResponse({required this.customer, required this.tenants});
|
||||
|
||||
factory CustomerTenantResponse.fromJson(Map<String, dynamic> json) {
|
||||
return CustomerTenantResponse(
|
||||
customer: Customer.fromJson(json['data']['customer']),
|
||||
tenants: (json['data']['tenants'] as List)
|
||||
.map((e) => Tenant.fromJson(e))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user