forked from ilteoood/flutter_i18n
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.dart
67 lines (63 loc) · 2.11 KB
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:logging/logging.dart';
import 'basic_example.dart' as basicExample;
import 'local_example.dart' as localeExample;
import 'namespace_example.dart' as namespaceExample;
import 'network_example.dart' as networkExample;
Future main() async {
WidgetsFlutterBinding.ensureInitialized();
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
Logger.root.onRecord.listen((record) {
print(record);
});
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.green,
),
home: Scaffold(
appBar: AppBar(title: Text("Flutter i18n")),
body: Builder(builder: (BuildContext context) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
ElevatedButton(
key: Key('basicExample'),
onPressed: () {
basicExample.main();
},
child: Text("Run `basic` example"),
),
ElevatedButton(
key: Key('networkExample'),
onPressed: () {
networkExample.main();
},
child: Text("Run `network` example"),
),
ElevatedButton(
key: Key('nameSpaceExample'),
onPressed: () {
namespaceExample.main();
},
child: Text("Run `namespace` example"),
),
ElevatedButton(
key: Key('localeExample'),
onPressed: () {
localeExample.main();
},
child: Text("Run `locale` example"),
)
],
));
})));
}
}