load method

CountryCoder load([
  1. List? prepared
])

Synchronously loads the border data and builds trees out of it. This can take up to a second, so in applications try calling prepareData in an non-UI thread first.

Implementation

CountryCoder load([List<dynamic>? prepared]) {
  if (!ready) {
    if (prepared != null) {
      _borders = RegionFeatureCollection.fromSerialized(prepared);
    } else {
      final data = JsonDecoder().convert(bordersRaw);
      _borders = RegionFeatureCollection(data);
    }
  }
  return this;
}