25 lines
503 B
Dart
25 lines
503 B
Dart
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),
|
|
};
|
|
}
|