Adds flight,battery models and image file managment
This commit is contained in:
33
lib/models/battery.dart
Normal file
33
lib/models/battery.dart
Normal file
@ -0,0 +1,33 @@
|
||||
class Battery {
|
||||
int? id;
|
||||
String name;
|
||||
String type;
|
||||
double voltage;
|
||||
String? imageUuid;
|
||||
|
||||
Battery({
|
||||
this.id,
|
||||
required this.name,
|
||||
required this.type,
|
||||
required this.voltage,
|
||||
this.imageUuid,
|
||||
});
|
||||
|
||||
factory Battery.fromMap(Map<String, dynamic> map) => Battery(
|
||||
id: map["id"],
|
||||
name: map["name"],
|
||||
type: map["type"],
|
||||
voltage: map["voltage"],
|
||||
imageUuid: map["image_uuid"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"id": id,
|
||||
"name": name,
|
||||
"type": type,
|
||||
"voltage": voltage,
|
||||
"image_uuid": imageUuid,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user