Skip to content

Commit 7a8cf01

Browse files
committed
Merge branch 'dev' of https://github.com/efoxTeam/flutter-ui into dev
2 parents c6c3174 + bcbd230 commit 7a8cf01

File tree

9 files changed

+208
-20
lines changed

9 files changed

+208
-20
lines changed

lib/components/widgetComp.dart

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,16 @@ class IndexState extends State<Index> {
8787
/* title: Header.Index(
8888
this.title,
8989
), */
90+
elevation: 0,
91+
backgroundColor: Color(AppTheme.secondColor),
9092
actions: this.getActions(
9193
context,
9294
),
95+
leading: IconButton(
96+
icon: Icon(Icons.arrow_back),
97+
color: Color(AppTheme.blackColor),
98+
onPressed: () => Navigator.pop(context),
99+
),
93100
),
94101
body: this.loading ? this.renderLoading() : this.renderWidget(),
95102
);
@@ -126,6 +133,7 @@ class IndexState extends State<Index> {
126133
getActions(context) {
127134
return [
128135
IconButton(
136+
color: Color(AppTheme.blackColor),
129137
icon: Icon(
130138
Icons.insert_link,
131139
),
@@ -136,16 +144,17 @@ class IndexState extends State<Index> {
136144
);
137145
},
138146
),
139-
IconButton(
147+
/* IconButton(
140148
icon: Icon(
141149
Icons.code,
142150
),
143151
onPressed: () async {
144152
this.openPage(context);
145153
},
146-
),
154+
), */
147155
IconButton(
148156
icon: Icon(Icons.share),
157+
color: Color(AppTheme.blackColor),
149158
onPressed: () {
150159
final String msg =
151160
this.model.config.state.env.githubAssetOrigin + this.mdUrl;

lib/config/theme.dart

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
11
import 'package:flutter/material.dart';
22

3+
/**
4+
* yello #FFEB3B
5+
* red #F44336
6+
* blue #2196F3
7+
*/
8+
39
class AppTheme {
4-
static int mainColor = 0xFFD32F2F;
10+
static int yellow = 0xFFFFEB3B;
11+
static int orange = 0xFFFF9800;
12+
static int amber = 0xFFFFC107;
13+
static int lime = 0xFFCDDC39;
14+
static int lightGreen = 0xFF8BC34A;
15+
static int red = 0xFFF44336;
16+
static int deepOrange = 0xFFFF5722;
17+
static int blue = 0xFF2196F3;
18+
static int pink = 0xFFE91E63;
19+
//static int mainColor = 0xFFD32F2F;
20+
static int mainColor = red;
521
static int secondColor = 0xFFFFFFFF;
622
static int thirdColor = 0xFFFAFAFA;
723
static int greyColor = 0x8A000000;

lib/page/component/tabs.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,4 @@ class _IndexState extends State<Index>
138138
),
139139
);
140140
}
141-
142141
}

lib/page/home.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'package:efox_flutter/controller/index.dart' as Controller;
66
//import 'component/index.dart' as TabIndex;
77
// import 'mine/index.dart' as MyIndex;
88
import 'component/tabs.dart' as TabIndex;
9-
import 'mine/index_1.dart' as MyIndex;
9+
import 'mine/index_2.dart' as MyIndex;
1010

1111
class Index extends StatefulWidget {
1212
@override

lib/page/mine/index_1.dart

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class _IndexState extends State<Index> {
6767
child: Wrap(
6868
children: <Widget>[
6969
ListTile(
70-
leading: Icon(Icons.label_outline),
70+
//leading: Icon(Icons.label_outline),
7171
title: Text(
7272
AppLocalizations.$t('common_mine_1.cn'),
7373
),
@@ -77,7 +77,7 @@ class _IndexState extends State<Index> {
7777
},
7878
),
7979
ListTile(
80-
leading: Icon(Icons.label_outline),
80+
//leading: Icon(Icons.label_outline),
8181
title: Text(AppLocalizations.$t('common_mine_1.en')),
8282
onTap: () {
8383
AppLocalizations.changeLanguage(Locale('en'));
@@ -102,7 +102,7 @@ class _IndexState extends State<Index> {
102102
child: Wrap(
103103
children: <Widget>[
104104
ListTile(
105-
leading: Icon(Icons.label_outline),
105+
//leading: Icon(Icons.label_outline),
106106
title: Text(
107107
AppLocalizations.$t('mine.loadNetwork'),
108108
),
@@ -112,7 +112,7 @@ class _IndexState extends State<Index> {
112112
},
113113
),
114114
ListTile(
115-
leading: Icon(Icons.label_outline),
115+
//leading: Icon(Icons.label_outline),
116116
title: Text(AppLocalizations.$t('mine.loadLocal')),
117117
onTap: () {
118118
widget.model.dispatch('config', 'setEnv', false);
@@ -159,13 +159,16 @@ class _IndexState extends State<Index> {
159159
),
160160
opacity: 1,
161161
),
162-
SizedBox(height: 10,),
163-
Text("Flutter-UI",
164-
style: TextStyle(
165-
color: Colors.white,
166-
fontSize: 26,
167-
fontWeight: FontWeight.bold
168-
),)
162+
SizedBox(
163+
height: 10,
164+
),
165+
Text(
166+
"Flutter-UI",
167+
style: TextStyle(
168+
color: Colors.white,
169+
fontSize: 26,
170+
fontWeight: FontWeight.bold),
171+
)
169172
],
170173
),
171174
)

lib/page/mine/index_2.dart

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:efox_flutter/lang/index.dart' show AppLocalizations;
3+
import 'package:efox_flutter/router/index.dart' show FluroRouter;
4+
import 'package:efox_flutter/config/theme.dart' show AppTheme;
5+
6+
class _IndexState extends State<Index> {
7+
@override
8+
void initState() {
9+
super.initState();
10+
}
11+
12+
void pop([message]) {
13+
Navigator.pop(context);
14+
if (message != null) {
15+
Scaffold.of(context).showSnackBar(new SnackBar(
16+
content: new Text(message),
17+
));
18+
}
19+
}
20+
21+
/**
22+
* 国际化
23+
*/
24+
void openLanguageSelectMenu() async {
25+
await showModalBottomSheet(
26+
context: context,
27+
builder: (BuildContext bc) {
28+
return Container(
29+
child: Wrap(
30+
children: <Widget>[
31+
ListTile(
32+
//leading: Icon(Icons.label_outline),
33+
title: Text(
34+
AppLocalizations.$t('common_mine_1.cn'),
35+
),
36+
onTap: () {
37+
AppLocalizations.changeLanguage(Locale('zh'));
38+
this.pop(AppLocalizations.$t('common_mine_1.success'));
39+
},
40+
),
41+
ListTile(
42+
//leading: Icon(Icons.label_outline),
43+
title: Text(AppLocalizations.$t('common_mine_1.en')),
44+
onTap: () {
45+
AppLocalizations.changeLanguage(Locale('en'));
46+
this.pop(AppLocalizations.$t('common_mine_1.success'));
47+
},
48+
),
49+
],
50+
),
51+
);
52+
},
53+
);
54+
}
55+
56+
@override
57+
Widget build(BuildContext context) {
58+
return Scaffold(
59+
appBar: AppBar(
60+
elevation: 0,
61+
centerTitle: true,
62+
title: Text(AppLocalizations.$t('nav_title_1'))),
63+
body: ListView(
64+
children: <Widget>[
65+
ListTile(
66+
onTap: () => this.openLanguageSelectMenu(),
67+
leading: Icon(Icons.language),
68+
title: Text(AppLocalizations.$t('common_mine_1.language')),
69+
trailing: Container(
70+
child: Row(
71+
mainAxisSize: MainAxisSize.min,
72+
children: <Widget>[
73+
Text(AppLocalizations.languageCode),
74+
Icon(Icons.navigate_next)
75+
],
76+
),
77+
)),
78+
Divider(
79+
color: Color(AppTheme.lineColor),
80+
),
81+
ExpansionTile(
82+
title: Text(AppLocalizations.$t('common_mine_1.theme')),
83+
children: <Widget>[
84+
Wrap(
85+
//crossAxisAlignment: WrapCrossAlignment.start,
86+
alignment: WrapAlignment.spaceEvenly,
87+
runAlignment: WrapAlignment.spaceEvenly,
88+
children: <Widget>[
89+
this.Edage(AppTheme.yellow),
90+
this.Edage(AppTheme.blue),
91+
this.Edage(AppTheme.orange),
92+
this.Edage(AppTheme.lightGreen),
93+
this.Edage(AppTheme.red),
94+
],
95+
)
96+
],
97+
)
98+
],
99+
));
100+
}
101+
102+
Widget Edage(color) {
103+
return GestureDetector(
104+
onTap: () {},
105+
child: Container(
106+
color: Color(color),
107+
height: 30,
108+
width: 30,
109+
),
110+
);
111+
}
112+
}
113+
114+
class Index extends StatefulWidget {
115+
final dynamic model;
116+
117+
Index({Key key, this.model}) : super(key: key);
118+
119+
@override
120+
_IndexState createState() => _IndexState();
121+
}

lib/utils/github.dart

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* import 'dart:io';
2+
import 'package:dio/dio.dart';
3+
4+
5+
Dio _dio([Options options]) {
6+
Dio dio = new Dio(BaseOptions(
7+
baseUrl: 'https://api.github.com/graphql',
8+
contentType: ContentType.parse('application/json;charset=UTF-8'),
9+
connectTimeout: 30 * 1000,
10+
receiveTimeout: 30 * 1000,
11+
)); // with default Options
12+
dio.interceptors.add(LogInterceptor(responseBody: true)); // debug
13+
dio.interceptors
14+
.add(InterceptorsWrapper(onRequest: (RequestOptions options) async {
15+
options.headers["Authorization"] = 'Bearer $token';
16+
return options;
17+
}, onResponse: (Response response) {
18+
return response;
19+
}, onError: (DioError e) {
20+
return e;
21+
})); //debug
22+
return dio;
23+
}
24+
25+
Future fetch(String query) async {
26+
Map map = {'query': query};
27+
return _dio().post('', data: map);
28+
}
29+
30+
31+
github.fetch('''
32+
query {
33+
viewer{
34+
login
35+
}
36+
}
37+
''');
38+
*/

locale/en.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
"changeVersion": "checkVersion",
1212
"compProgress": "Components Progress"
1313
},
14-
"common_mine_1" : {
14+
"common_mine_1": {
1515
"cn": "CN",
1616
"en": "EN",
1717
"language": "Select Language",
1818
"environment": "Select Environment",
1919
"compProgress": "Components Progress",
20-
"success": "Success To Change "
20+
"success": "Success To Change ",
21+
"theme": "Select Theme"
2122
},
2223
"mine": {
2324
"loadNetwork": "Load Network Document Resources",

locale/zh.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
"changeVersion": "更新版本",
1212
"compProgress": "组件进度"
1313
},
14-
"common_mine_1" : {
14+
"common_mine_1": {
1515
"cn": "中文",
1616
"en": "英文",
1717
"language": "选择语言",
1818
"environment": "选择环境",
1919
"compProgress": "组件进度",
20-
"success": "切换成功"
20+
"success": "切换成功",
21+
"theme": "选择主题"
2122
},
2223
"mine": {
2324
"loadNetwork": "网络优良,可选择加载线上文档资源",

0 commit comments

Comments
 (0)