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.
30 lines
580 B
Dart
30 lines
580 B
Dart
|
4 weeks ago
|
import 'package:test_sa/models/base.dart';
|
||
|
|
|
||
|
|
class SiteModel extends Base {
|
||
|
|
final int? id;
|
||
|
|
final String? siteName;
|
||
|
|
final int? siteCode;
|
||
|
|
|
||
|
|
SiteModel({
|
||
|
|
this.id,
|
||
|
|
this.siteName,
|
||
|
|
this.siteCode,
|
||
|
|
}) : super(name: siteName, identifier: id?.toString());
|
||
|
|
|
||
|
|
factory SiteModel.fromJson(Map<String, dynamic> json) {
|
||
|
|
return SiteModel(
|
||
|
|
id: json['id'],
|
||
|
|
siteName: json['siteName'],
|
||
|
|
siteCode: json['siteCode'],
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
Map<String, dynamic> toJson() {
|
||
|
|
return {
|
||
|
|
'id': id,
|
||
|
|
'siteName': siteName,
|
||
|
|
'siteCode': siteCode,
|
||
|
|
};
|
||
|
|
}
|
||
|
|
}
|