first ui elements using the new structs
Some checks failed
Build and push docker image / Build (pull_request) Failing after 41s
Build and release APK / Build APK (pull_request) Successful in 5m25s
Build web / Build Web (pull_request) Successful in 1m17s

This commit is contained in:
2024-05-31 21:33:04 +02:00
parent 7e4538a1bf
commit 8bc7da0b3e
14 changed files with 336 additions and 226 deletions

View File

@@ -0,0 +1,56 @@
class Landmark {
final String name;
final List location;
final LandmarkType type;
// final String description;
// final Duration duration;
// final bool visited;
const Landmark({
required this.name,
required this.location,
required this.type,
// required this.description,
// required this.duration,
// required this.visited,
});
factory Landmark.fromJson(Map<String, dynamic> json) {
return switch (json) {
{
'loc': List location,
'name': String name,
'type': String type,
// 'description': String description,
// 'duration': int duration,
// 'visited': bool visited
} =>
Landmark(
name: name,
location: location,
type: LandmarkType(name: type)
// description: description,
// duration: Duration(minutes: duration),
// visited: visited
),
_ => throw const FormatException('Failed to load destination.'),
};
}
}
class LandmarkType {
final String name;
// final String description;
// final Icon icon;
const LandmarkType({
required this.name,
// required this.description,
// required this.icon,
});
}