Skip to content

Commit

Permalink
Make sure that the Time Zone database is initialized before potential…
Browse files Browse the repository at this point in the history
… time zone migration happens. Hotfix #423 #139
  • Loading branch information
MrCsabaToth committed Mar 22, 2023
1 parent da422d7 commit d304ade
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import 'utils/logging.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();

final byteData = await rootBundle.load('assets/timezones_10y.tzf');
tz.initializeDatabase(byteData.buffer.asUint8List());

final prefService = await initPreferences();

final companyRegistry = CompanyRegistry();
Expand All @@ -26,9 +29,5 @@ void main() async {
Logging.logVersion(packageInfo);
});

rootBundle
.load('assets/timezones_10y.tzf')
.then((byteData) => {tz.initializeDatabase(byteData.buffer.asUint8List())});

runApp(TrackMyIndoorExerciseApp(prefService: prefService));
}

0 comments on commit d304ade

Please sign in to comment.