Skip to content

Instantly share code, notes, and snippets.

@brasizza
Created July 10, 2021 02:09
Show Gist options
  • Save brasizza/b1f6bc0a4622578a90cb81ecd4452005 to your computer and use it in GitHub Desktop.
Save brasizza/b1f6bc0a4622578a90cb81ecd4452005 to your computer and use it in GitHub Desktop.
import 'package:json_annotation/json_annotation.dart';
import 'package:hive/hive.dart';
part 'map_location.g.dart';
@HiveType(typeId: 0)
class MapLocation extends HiveObject {
@HiveField(0)
late String id;
@JsonKey(name: 'location_name')
@HiveField(1)
late String locatioName;
@JsonKey(name: 'location_description')
@HiveField(2)
late String locationDescription;
@JsonKey(name: 'location_image')
@HiveField(3)
late String locationImage;
@JsonKey()
@HiveField(4)
late double latitude;
@JsonKey()
@HiveField(5)
late double longitude;
// Hive fields go here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment