Skip to content

Commit

Permalink
update locator & main
Browse files Browse the repository at this point in the history
  • Loading branch information
LiquidatorCoder committed Nov 23, 2021
1 parent 080a53f commit 2e604f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'dart:io';
import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:odin/pages/home_page.dart';
import 'package:odin/providers/file_notifier.dart';
Expand All @@ -12,9 +13,13 @@ import 'package:odin/services/logger.dart';
import 'package:provider/provider.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();
if (Platform.environment.containsKey('FLUTTER_TEST')) {
TestWidgetsFlutterBinding.ensureInitialized();
} else {
WidgetsFlutterBinding.ensureInitialized();
}
await dotenv.load();
await setupLocator();
setupLocator();
runZonedGuarded(() {
runApp(
MultiProvider(
Expand Down
2 changes: 1 addition & 1 deletion lib/services/locator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'logger.dart';

GetIt locator = GetIt.instance;

Future<void> setupLocator() async {
void setupLocator() {
Stopwatch stopwatch = Stopwatch()..start();
// locator.registerFactory<CurrentDataNotifier>(() => CurrentDataNotifier());
locator.registerLazySingleton<GithubService>(() => GithubService());
Expand Down

0 comments on commit 2e604f2

Please sign in to comment.