prepareData static method
Loads the border data separately and returns it in a serialized form.
Call this from inside the compute()
function to process data
in a background thread, and then pass the result to load. Like this:
import 'package:flutter/foundation.dart' show compute;
// ...
CountryCoder.instance.load(await compute(CountryCoder.prepareData, null));
Implementation
static List<dynamic> prepareData(_) {
final data = JsonDecoder().convert(bordersRaw);
return RegionFeatureCollection(data).serialize();
}