Skip to content

Commit

Permalink
Black screen demo fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
ilteoood authored and j4nk3e committed Oct 16, 2019
1 parent 71173a2 commit 794a7df
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
16 changes: 13 additions & 3 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:flutter_i18n/flutter_i18n_delegate.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

void main() => runApp(new MyApp());
Future main() async {
final FlutterI18nDelegate flutterI18nDelegate = FlutterI18nDelegate(
useCountryCode: false, fallbackFile: 'en', path: 'assets/i18n');
await flutterI18nDelegate.load(null);
runApp(new MyApp(flutterI18nDelegate));
}

class MyApp extends StatelessWidget {
FlutterI18nDelegate flutterI18nDelegate;

MyApp(this.flutterI18nDelegate);

@override
Widget build(BuildContext context) {
return new MaterialApp(
Expand All @@ -15,8 +26,7 @@ class MyApp extends StatelessWidget {
),
home: new MyHomePage(),
localizationsDelegates: [
FlutterI18nDelegate(
useCountryCode: false, fallbackFile: 'en', path: 'assets/i18n'),
flutterI18nDelegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate
],
Expand Down
6 changes: 3 additions & 3 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.2"
version: "1.6.4"
pedantic:
dependency: transitive
description:
Expand All @@ -99,7 +99,7 @@ packages:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
version: "2.0.5"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -132,7 +132,7 @@ packages:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
version: "1.0.5"
term_glyph:
dependency: transitive
description:
Expand Down
6 changes: 3 additions & 3 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.2"
version: "1.6.4"
pedantic:
dependency: transitive
description:
Expand All @@ -85,7 +85,7 @@ packages:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
version: "2.0.5"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -118,7 +118,7 @@ packages:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
version: "1.0.5"
term_glyph:
dependency: transitive
description:
Expand Down

0 comments on commit 794a7df

Please sign in to comment.