Adds drone model, db helper.
This commit is contained in:
24
lib/models/drone.dart
Normal file
24
lib/models/drone.dart
Normal file
@ -0,0 +1,24 @@
|
||||
import 'package:image/image.dart' as img;
|
||||
|
||||
class Drone
|
||||
{
|
||||
final int? id;
|
||||
final String name;
|
||||
//final img.Image image;
|
||||
|
||||
Drone ({this.id, required this.name}); //required this.image});
|
||||
|
||||
factory Drone.fromMap(Map<String, dynamic> map) => Drone
|
||||
(
|
||||
id: map["id"],
|
||||
name: map["name"],
|
||||
//image: img.decodeJpg(map["image"])!,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toMap() =>
|
||||
{
|
||||
"id": id,
|
||||
"name": name,
|
||||
//"image": img.encodeJpg(image),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user