-
Notifications
You must be signed in to change notification settings - Fork 10
/
main.dart
132 lines (130 loc) · 5.94 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
import 'dart:ui' as ui;
import 'package:byr_mobile_app/customizations/translation.dart';
import 'package:byr_mobile_app/nforum/nforum_structures.dart';
import 'package:byr_mobile_app/pages/pages.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:get/get.dart';
void main() {
runApp(
GetMaterialApp(
localizationsDelegates: [
GlobalCupertinoLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
translations: Translation(),
locale: Locale('zh', 'CN'),
fallbackLocale: Locale('zh', 'CN'),
supportedLocales: <Locale>[
Locale('zh', 'CN'),
Locale('zh', 'TW'),
Locale('zh', 'HK'),
Locale('en', 'US'),
Locale('en', 'UK'),
Locale('en', 'AU'),
],
onGenerateRoute: (RouteSettings settings) {
switch (settings.name) {
case "welcome_page":
return FullscreenBackPageRoute(
builder: (context) => WelcomePage(), settings: settings, maintainState: false);
case "login_page":
if (settings.arguments is LoginPageRouteArg) {
return FullscreenBackPageRoute(
builder: (context) => LoginPage(settings.arguments), settings: settings, maintainState: true);
}
return null;
case "home_page":
return FullscreenBackPageRoute(builder: (context) => HomePage(), settings: settings, maintainState: true);
case "front_page":
return FullscreenBackPageRoute(builder: (context) => FrontPage(), settings: settings, maintainState: true);
case "topten_page":
return FullscreenBackPageRoute(builder: (context) => ToptenPage(), settings: settings, maintainState: true);
case "history_page":
return FullscreenBackPageRoute(
builder: (context) => HistoryPage(), settings: settings, maintainState: true);
case "blocklist_page":
return FullscreenBackPageRoute(
builder: (context) => BlocklistPage(), settings: settings, maintainState: true);
case "message_page":
return FullscreenBackPageRoute(
builder: (context) => MessagePage(), settings: settings, maintainState: true);
case "section_page":
if (settings.arguments is String || settings.arguments == null) {
return FullscreenBackPageRoute(
builder: (context) => SectionPage(settings.arguments), settings: settings, maintainState: true);
}
return null;
case "board_page":
if (settings.arguments is BoardPageRouteArg) {
return FullscreenBackPageRoute(
builder: (context) => BoardPage(settings.arguments), settings: settings, maintainState: true);
}
return null;
case "thread_page":
if (settings.arguments is ThreadPageRouteArg) {
return FullscreenBackPageRoute(
builder: (context) => ThreadPage(settings.arguments), settings: settings, maintainState: true);
}
return null;
case "bet_page":
if (settings.arguments is BetPageRouteArg) {
return FullscreenBackPageRoute(
builder: (context) => BetPage(settings.arguments), settings: settings, maintainState: true);
}
return null;
case "vote_page":
if (settings.arguments is VotePageRouteArg) {
return FullscreenBackPageRoute(
builder: (context) => VotePage(settings.arguments), settings: settings, maintainState: true);
}
return null;
case "search_thread_page":
if (settings.arguments is SearchThreadPageRouteArg) {
return FullscreenBackPageRoute(
builder: (context) => SearchThreadPage(settings.arguments), settings: settings, maintainState: true);
}
return null;
case "profile_page":
if (settings.arguments is UserModel) {
return FullscreenBackPageRoute(
builder: (context) => ProfilePage(user: settings.arguments), settings: settings, maintainState: true);
}
return null;
case "video_page":
if (settings.arguments is String) {
return FullscreenBackPageRoute(
builder: (context) => VideoPage(settings.arguments), settings: settings, maintainState: true);
}
return null;
case "settings_page":
return FullscreenBackPageRoute(
builder: (context) => SettingsPage(), settings: settings, maintainState: true);
case "post_page":
return CupertinoPageRoute(
builder: (context) => PostPage(settings.arguments), settings: settings, maintainState: true);
case "send_mail_page":
if (settings.arguments is SendMailPageRouteArg) {
return CupertinoPageRoute(
builder: (context) => SendMailPage(settings.arguments), settings: settings, maintainState: true);
}
return null;
case "mail_page":
if (settings.arguments is MailPageRouteArg) {
return FullscreenBackPageRoute(
builder: (context) => MailPage(settings.arguments), settings: settings, maintainState: true);
}
return null;
case "collection_page":
return FullscreenBackPageRoute(
builder: (context) => CollectionPage(), settings: settings, maintainState: true);
default:
return null;
}
},
home: WelcomePage(),
),
);
}