import 'package:flutter/material.dart'; import 'splash.dart'; import 'consts.dart'; import 'strings.dart'; import 'common.dart'; import 'dart:async'; class StringsLocalizationDelegate extends LocalizationsDelegate { @override Future load(Locale locale) async { return StringsLocalization.load(await platform.invokeMethod("getLocale")); } @override bool shouldReload(LocalizationsDelegate old) { return false; } } /// Точка входа в приложение. void main() { runApp(new Checker()); } class Checker extends StatefulWidget { @override CheckerState createState() => new CheckerState(); } class CheckerState extends State { @override Widget build(BuildContext context) { return new MaterialApp( title: appName, home: new SplashScreen(), localizationsDelegates: getLocalizationsDelegate() ); } getLocalizationsDelegate() { return [new StringsLocalizationDelegate()]; } }