getLocations static method

Future<List<Location>> getLocations({
  1. int? limit,
})

Gets stored locations.

Implementation

static Future<List<Location>> getLocations({int? limit}) async {
  final result = await _methodChannel.invokeMethod(
    'getLocations',
    limit == null ? null : {'limit': limit},
  );
  if (result is List) {
    return result
        .map((item) =>
            Location.fromMap(Map<String, dynamic>.from(item as Map)))
        .toList();
  }
  return [];
}