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