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.
40 lines
800 B
Dart
40 lines
800 B
Dart
import 'package:test_sa/models/base.dart';
|
|
|
|
class AssetGroup extends Base {
|
|
final int? id;
|
|
final String? code;
|
|
final String? displayName;
|
|
|
|
AssetGroup({
|
|
this.id,
|
|
this.code,
|
|
this.displayName,
|
|
}) : super(identifier: id?.toString(), name: displayName);
|
|
|
|
factory AssetGroup.fromJson(Map<String, dynamic> json) {
|
|
return AssetGroup(
|
|
id: json['id'],
|
|
code: json['code'],
|
|
displayName: json['name'],
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'id': id,
|
|
'code': code,
|
|
'name': displayName,
|
|
};
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is AssetGroup &&
|
|
runtimeType == other.runtimeType &&
|
|
id == other.id;
|
|
|
|
@override
|
|
int get hashCode => id.hashCode;
|
|
}
|