Skip to content

Commit

Permalink
Added a tree icon, because christmas lol
Browse files Browse the repository at this point in the history
  • Loading branch information
Zverik committed Dec 3, 2024
1 parent 1b289a3 commit 87d2fb0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
2 changes: 2 additions & 0 deletions lib/models/amenity.dart
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,8 @@ class OsmChange extends ChangeNotifier implements Comparable {
return '$num, $street';
}

bool get isChristmasTree => this['xmas:feature'] == 'tree';

// Helper methods

/// Returns a map with complete object tags. All changes are applied,
Expand Down
24 changes: 15 additions & 9 deletions lib/widgets/map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -350,16 +350,17 @@ class _AmenityMapState extends ConsumerState<AmenityMap> {
child: Stack(
alignment: Alignment.center,
children: [
Container(
decoration: BoxDecoration(
color: getIconColor(amenities[i], legendCon)
.withOpacity(widget.drawNumbers ? 0.7 : 1.0),
borderRadius: BorderRadius.circular(iconSize / 2),
if (!amenities[i].isChristmasTree)
Container(
decoration: BoxDecoration(
color: getIconColor(amenities[i], legendCon)
.withOpacity(widget.drawNumbers ? 0.7 : 1.0),
borderRadius: BorderRadius.circular(iconSize / 2),
),
width: iconSize,
height: iconSize,
),
width: iconSize,
height: iconSize,
),
if (!widget.drawNumbers && amenities[i].isIncomplete)
if (!widget.drawNumbers && amenities[i].isIncomplete && !amenities[i].isChristmasTree)
Container(
decoration: BoxDecoration(
color: Colors.white,
Expand All @@ -368,6 +369,11 @@ class _AmenityMapState extends ConsumerState<AmenityMap> {
width: iconSize / 3,
height: iconSize / 3,
),
if (amenities[i].isChristmasTree)
Image.asset(
'assets/christmas-tree.png',
width: iconSize * 2,
),
if (widget.drawNumbers && i < 9)
Container(
padding: EdgeInsets.only(left: 1.0),
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ flutter:
assets:
- assets/presets.db
- assets/lets-encrypt-r3.pem
- assets/christmas-tree.png
- assets/roofs/

flutter_launcher_icons:
Expand Down

0 comments on commit 87d2fb0

Please sign in to comment.