mirror of
https://gitlab.com/TheOneWithTheBraid/dart_pkpass.git
synced 2025-07-06 05:18:47 +00:00
chore: add high level classes
Signed-off-by: The one with the braid <the-one@with-the-braid.cf>
This commit is contained in:
parent
165226bee1
commit
78f88305ec
13 changed files with 678 additions and 316 deletions
30
lib/src/models/location.dart
Normal file
30
lib/src/models/location.dart
Normal file
|
@ -0,0 +1,30 @@
|
|||
/// Information about a location.
|
||||
class Location {
|
||||
/// Latitude, in degrees, of the location.
|
||||
final double latitude;
|
||||
|
||||
/// Longitude, in degrees, of the location.
|
||||
final double longitude;
|
||||
|
||||
/// Altitude, in meters, of the location.
|
||||
final double? altitude;
|
||||
|
||||
/// Text displayed on the lock screen when the pass is currently relevant.
|
||||
/// For example, a description of the nearby location such as
|
||||
/// “Store nearby on 1st and Main.”
|
||||
final String? relevantText;
|
||||
|
||||
const Location({
|
||||
required this.latitude,
|
||||
required this.longitude,
|
||||
this.altitude,
|
||||
this.relevantText,
|
||||
});
|
||||
|
||||
factory Location.fromJson(Map<String, Object?> json) => Location(
|
||||
latitude: json['latitude'] as double,
|
||||
longitude: json['longitude'] as double,
|
||||
altitude: json['altitude'] as double?,
|
||||
relevantText: json['relevantText'] as String?,
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue