You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudsolutions-atoms/lib/modules/signup/models/company_model.dart

52 lines
1.2 KiB
Dart

import 'package:test_sa/models/base.dart';
class Company extends Base {
final int? id;
final String? companyName;
final String? prefix;
final int? loginTypeId;
final String? companyPhoto;
final int? assetGroupId;
Company({
this.id,
this.companyName,
this.prefix,
this.loginTypeId,
this.companyPhoto,
this.assetGroupId,
}) : super(identifier: id?.toString(), name: companyName);
factory Company.fromJson(Map<String, dynamic> json) {
return Company(
id: json['id'],
companyName: json['name'],
prefix: json['prefix'],
loginTypeId: json['loginTypeId'],
companyPhoto: json['companyPhoto'],
assetGroupId: json['assetGroupId'],
);
}
Map<String, dynamic> toJson() {
return {
'id': id,
'name': companyName,
'prefix': prefix,
'loginTypeId': loginTypeId,
'companyPhoto': companyPhoto,
'assetGroupId': assetGroupId,
};
}
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is Company &&
runtimeType == other.runtimeType &&
id == other.id;
@override
int get hashCode => id.hashCode;
}