ObjectBox
This commit is contained in:
1 parent
e548f62bde
commit
f8317be627
60 files changed
+2367
-15049
No files matched your search
@@ -1,18 +1,21 @@
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'tour_position.g.dart';
|
||||
|
||||
@embedded
|
||||
@JsonSerializable()
|
||||
class TourPosition {
|
||||
late double lat;
|
||||
late double long;
|
||||
|
||||
TourPosition();
|
||||
|
||||
factory TourPosition.fromJson(Map<String, dynamic> json) => _$TourPositionFromJson(json);
|
||||
factory TourPosition.fromJson(Map<String, dynamic> json) {
|
||||
final pos = TourPosition();
|
||||
pos.lat = (json['lat'] as num).toDouble();
|
||||
pos.long = (json['long'] as num).toDouble();
|
||||
return pos;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => _$TourPositionToJson(this);
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'lat': lat,
|
||||
'long': long,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user