Use custom marker icons for Favorite places and Visited places. (#31)

pull/32/head
Kenzie Schmoll 6 years ago committed by GitHub
parent c823766300
commit e59c865884
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -22,20 +22,17 @@ class PlaceMap extends StatefulWidget {
class PlaceMapState extends State<PlaceMap> {
static BitmapDescriptor _getPlaceMarkerIcon(PlaceCategory category) {
// TODO(kenzieschmoll): use custom marker assets.
double markerHue;
switch (category) {
case PlaceCategory.favorite:
markerHue = BitmapDescriptor.hueRed;
return BitmapDescriptor.fromAsset('assets/heart.png');
break;
case PlaceCategory.visited:
markerHue = BitmapDescriptor.hueViolet;
return BitmapDescriptor.fromAsset('assets/visited.png');
break;
case PlaceCategory.wantToGo:
default:
markerHue = BitmapDescriptor.hueAzure;
return BitmapDescriptor.defaultMarker;
}
return BitmapDescriptor.defaultMarkerWithHue(markerHue);
}
static List<Place> _getPlacesForCategory(PlaceCategory category, Map<Marker, Place> places) {

@ -22,5 +22,7 @@ dev_dependencies:
sdk: flutter
flutter:
assets:
- assets/
uses-material-design: true
Loading…
Cancel
Save