-
-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
64 changed files
with
1,052 additions
and
991 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import 'package:aves/utils/geo_utils.dart'; | ||
import 'package:tuple/tuple.dart'; | ||
|
||
enum CoordinateFormat { dms, decimal } | ||
|
||
extension ExtraCoordinateFormat on CoordinateFormat { | ||
String get name { | ||
switch (this) { | ||
case CoordinateFormat.dms: | ||
return 'DMS'; | ||
case CoordinateFormat.decimal: | ||
return 'Decimal degrees'; | ||
default: | ||
return toString(); | ||
} | ||
} | ||
|
||
String format(Tuple2<double, double> latLng) { | ||
switch (this) { | ||
case CoordinateFormat.dms: | ||
return toDMS(latLng).join(', '); | ||
case CoordinateFormat.decimal: | ||
return [latLng.item1, latLng.item2].map((n) => n.toStringAsFixed(6)).join(', '); | ||
default: | ||
return toString(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import 'package:aves/widgets/album/collection_page.dart'; | ||
import 'package:aves/widgets/filter_grids/albums_page.dart'; | ||
|
||
enum HomePageSetting { collection, albums } | ||
|
||
extension ExtraHomePageSetting on HomePageSetting { | ||
String get name { | ||
switch (this) { | ||
case HomePageSetting.collection: | ||
return 'Collection'; | ||
case HomePageSetting.albums: | ||
return 'Albums'; | ||
default: | ||
return toString(); | ||
} | ||
} | ||
|
||
String get routeName { | ||
switch (this) { | ||
case HomePageSetting.collection: | ||
return CollectionPage.routeName; | ||
case HomePageSetting.albums: | ||
return AlbumListPage.routeName; | ||
default: | ||
return toString(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import 'package:flutter/widgets.dart'; | ||
|
||
extension ExtraContext on BuildContext { | ||
String get currentRouteName => ModalRoute.of(this)?.settings?.name; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.