initializeLocalization method

  1. @override
Future<SunnyLocalization> initializeLocalization()
override

Implementation

@override
Future<SunnyLocalization> initializeLocalization() {
  return rootBundle.load('packages/timezone/data/latest_all.tzf').then((byteData) async {
    final rawData = byteData.buffer.asUint8List();
    initializeDatabase(rawData);
    final userTimeZoneName = await currentTimeZone;
    final userLocation = getLocation(userTimeZoneName);
    final userTimeZone = userLocation.currentTimeZone;
    return SunnyLocalization(userTimeZone: userTimeZone, userLocation: userLocation);
  });
}