explicitely typed silent variable
This commit is contained in:
@@ -18,7 +18,7 @@ class FloodStationProvider extends ChangeNotifier {
|
|||||||
|
|
||||||
/// loads all stations in batches of 500 and notifies listeners with every loop except if [silent] = true
|
/// loads all stations in batches of 500 and notifies listeners with every loop except if [silent] = true
|
||||||
/// this has lower performance than loading them all at once an shouldn't be used
|
/// this has lower performance than loading them all at once an shouldn't be used
|
||||||
Future loadAllStationsInBatches({silent = false}) {
|
Future loadAllStationsInBatches({bool silent = false}) {
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
return Future.doWhile(() async {
|
return Future.doWhile(() async {
|
||||||
final stations = await Api.fetchStationsByRange(500, offset);
|
final stations = await Api.fetchStationsByRange(500, offset);
|
||||||
@@ -36,7 +36,7 @@ class FloodStationProvider extends ChangeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// loads all flood stations and notifies listeners when done
|
/// loads all flood stations and notifies listeners when done
|
||||||
Future loadAllStations({silent = false}) {
|
Future loadAllStations({bool silent = false}) {
|
||||||
return Api.fetchAllStations().then(
|
return Api.fetchAllStations().then(
|
||||||
(value) {
|
(value) {
|
||||||
_allStations = value;
|
_allStations = value;
|
||||||
@@ -48,7 +48,7 @@ class FloodStationProvider extends ChangeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// loads all stations whose label contains [filter]
|
/// loads all stations whose label contains [filter]
|
||||||
Future loadFilteredStations(String filter, {silent = false}) {
|
Future loadFilteredStations(String filter, {bool silent = false}) {
|
||||||
if (_filteredStationsFuture != null) {
|
if (_filteredStationsFuture != null) {
|
||||||
_filteredStationsFuture!.cancel();
|
_filteredStationsFuture!.cancel();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user