-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.dart
executable file
·77 lines (66 loc) · 2.16 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
68
69
70
71
72
73
74
75
76
77
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:worldfunclub/dartin_module.dart';
import 'package:worldfunclub/design.dart';
import 'package:worldfunclub/local_platform_channel.dart';
import 'package:worldfunclub/ui/main_page.dart';
import 'package:worldfunclub/ui/merchant/write_off_page.dart';
import 'package:worldfunclublocal/worldfunclublocal.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await initDartIn();
LocalChannel.listener(LocalChannelResponseDefault());
runApp(App());
}
class LocalChannelResponseDefault extends LocalChannelResponse {
@override
void wechatCode(String code) {}
@override
void responseScan(String result) {
Navigator.of(App.navigatorKey.currentContext)
.push(MaterialPageRoute(builder: (builder) => WriteOffPage(result)));
}
}
class App extends StatelessWidget {
static var navigatorKey = GlobalKey<NavigatorState>();
static var mainKey = GlobalKey<MainPageState>();
@override
Widget build(BuildContext context) {
return initDefaultDesignSize(MaterialApp(
title: "环球途乐会",
localizationsDelegates: [
// ... app-specific localization delegate[s] here
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: [
const Locale('en', 'US'), // English
const Locale('zh', 'CH'), // Hebrew
// ... other locales the app supports
],
darkTheme: ThemeData(
primarySwatch: Colors.blue,
brightness: Brightness.dark,
),
theme: ThemeData(
primarySwatch: Colors.red,
brightness: Brightness.light,
fontFamily: Theme.of(context).platform == TargetPlatform.linux
? "WenQuanYi Micro Hei"
: null),
home: MainPage(mainKey),
//key: mainKey
navigatorKey: navigatorKey,
));
}
}
String userId = "";
String token = "";
String avatar = "";
String nickName = "";
String userType = "";
bool bindPhone = false;
String mobile = "";
bool protocol = false;
bool enable = false;