Skip to content

Commit c4f1189

Browse files
author
Magic
committed
Merge branch 'dev' of https://github.com/efoxTeam/flutter-ui into dev
2 parents 63bf655 + 1121e35 commit c4f1189

File tree

12 files changed

+275
-24
lines changed

12 files changed

+275
-24
lines changed

android/app/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if (keystorePropertiesFile.exists()) {
3232
}
3333

3434
android {
35-
compileSdkVersion 27
35+
compileSdkVersion 28
3636

3737
lintOptions {
3838
disable 'InvalidPackage'
@@ -42,10 +42,10 @@ android {
4242
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4343
applicationId "com.flutter.beer"
4444
minSdkVersion 16
45-
targetSdkVersion 27
45+
targetSdkVersion 28
4646
versionCode flutterVersionCode.toInteger()
4747
versionName flutterVersionName
48-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
48+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4949
}
5050

5151
signingConfigs {
@@ -79,8 +79,8 @@ flutter {
7979

8080
dependencies {
8181
testImplementation 'junit:junit:4.12'
82-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
83-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
82+
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
83+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
8484
//firebase
8585
implementation 'com.google.firebase:firebase-core:16.0.8'
8686
//Crashlytics SDK

android/gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
org.gradle.jvmargs=-Xmx1536M
2+
android.useAndroidX=true
3+
android.enableJetifier=true

lib/components/widgetComp.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ class IndexState extends State<Index> {
6464
this._bodyList.length = 0;
6565
String mdText = await this.getMdFile(this.mdUrl);
6666
if (mdText.length > 30 || !this.model.config.state.isPro) {
67-
this
68-
._bodyList
69-
.add(await MarkDownComp.Index(mdText));
67+
this._bodyList.add(await MarkDownComp.Index(mdText));
7068
// demo
7169
if (this.demoChild != null && this.demoChild.length > 0) {
7270
this.demoChild.forEach((Widget item) {
@@ -87,9 +85,9 @@ class IndexState extends State<Index> {
8785
this.model = model;
8886
return Scaffold(
8987
appBar: AppBar(
90-
title: Header.Index(
88+
/* title: Header.Index(
9189
this.title,
92-
),
90+
), */
9391
actions: this.getActions(
9492
context,
9593
),

lib/config/index.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'development.dart' as Development;
22
import 'production.dart' as Production;
33

4-
const bool isPro = false;
4+
const bool isPro = true;
55

66
Object env = isPro ? Production.Config() : Development.Config();

lib/page/component/tabs.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,12 @@ class _IndexState extends State<Index>
7070

7171
Widget _TabBar() {
7272
return TabBar(
73+
indicatorColor: Color(AppTheme.secondColor),
7374
controller: _tabController,
7475
isScrollable: true,
7576
tabs: _mapList.map((v) {
7677
return new Tab(
77-
text: v.typeName,
78+
text: AppLocalizations.$t(v.typeName),
7879
/* icon: Icon(
7980
IconData(
8081
v.code,

lib/page/home.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import 'package:efox_flutter/store/index.dart' show Store;
44
import 'package:efox_flutter/controller/index.dart' as Controller;
55

66
//import 'component/index.dart' as TabIndex;
7+
// import 'mine/index.dart' as MyIndex;
78
import 'component/tabs.dart' as TabIndex;
8-
import 'mine/index.dart' as MyIndex;
9+
import 'mine/index_1.dart' as MyIndex;
910

1011
class Index extends StatefulWidget {
1112
@override

lib/page/mine/index_1.dart

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
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+
List<dynamic> _getList() {
13+
return [
14+
{
15+
'name': AppLocalizations.$t('common_mine_1.language'),
16+
'icon': 59540, // language
17+
'index': 0
18+
},
19+
{
20+
'name': AppLocalizations.$t('common_mine_1.environment'),
21+
'icon': 57539, // import_export
22+
'index': 1,
23+
},
24+
{
25+
'name': AppLocalizations.$t('common_mine_1.compProgress'),
26+
'icon': 57709, // low_priority
27+
'index': 2
28+
}
29+
];
30+
}
31+
32+
actionsEvent(int index) {
33+
print('index $index');
34+
switch (index) {
35+
case 0:
36+
this.openLanguageSelectMenu();
37+
break;
38+
case 1:
39+
this.openEnvSelectMenu();
40+
break;
41+
case 2:
42+
FluroRouter.router.navigateTo(
43+
context,
44+
'/webview?url=${Uri.encodeComponent(widget.model.config.state.env.githubWeb)}&title=${Uri.encodeComponent(AppLocalizations.$t('common.compProgress'))}',
45+
);
46+
break;
47+
}
48+
}
49+
50+
void pop([message]) {
51+
Navigator.pop(context);
52+
if (message != null) {
53+
Scaffold.of(context).showSnackBar(new SnackBar(
54+
content: new Text(message),
55+
));
56+
}
57+
}
58+
59+
/**
60+
* 国际化
61+
*/
62+
void openLanguageSelectMenu() async {
63+
await showModalBottomSheet(
64+
context: context,
65+
builder: (BuildContext bc) {
66+
return Container(
67+
child: Wrap(
68+
children: <Widget>[
69+
ListTile(
70+
leading: Icon(Icons.label_outline),
71+
title: Text(
72+
AppLocalizations.$t('common_mine_1.cn'),
73+
),
74+
onTap: () {
75+
AppLocalizations.changeLanguage(Locale('zh'));
76+
this.pop(AppLocalizations.$t('common_mine_1.success'));
77+
},
78+
),
79+
ListTile(
80+
leading: Icon(Icons.label_outline),
81+
title: Text(AppLocalizations.$t('common_mine_1.en')),
82+
onTap: () {
83+
AppLocalizations.changeLanguage(Locale('en'));
84+
this.pop(AppLocalizations.$t('common_mine_1.success'));
85+
},
86+
),
87+
],
88+
),
89+
);
90+
},
91+
);
92+
}
93+
94+
/**
95+
* 环境选择
96+
*/
97+
void openEnvSelectMenu() async {
98+
await showModalBottomSheet(
99+
context: context,
100+
builder: (BuildContext bc) {
101+
return Container(
102+
child: Wrap(
103+
children: <Widget>[
104+
ListTile(
105+
leading: Icon(Icons.label_outline),
106+
title: Text(
107+
AppLocalizations.$t('mine.loadNetwork'),
108+
),
109+
onTap: () {
110+
widget.model.dispatch('config', 'setEnv', true);
111+
this.pop(AppLocalizations.$t('common_mine_1.success'));
112+
},
113+
),
114+
ListTile(
115+
leading: Icon(Icons.label_outline),
116+
title: Text(AppLocalizations.$t('mine.loadLocal')),
117+
onTap: () {
118+
widget.model.dispatch('config', 'setEnv', false);
119+
this.pop(AppLocalizations.$t('common_mine_1.success'));
120+
},
121+
),
122+
],
123+
),
124+
);
125+
},
126+
);
127+
}
128+
129+
@override
130+
Widget build(BuildContext context) {
131+
return SingleChildScrollView(
132+
child: Column(
133+
children: <Widget>[
134+
Container(
135+
decoration: BoxDecoration(
136+
borderRadius: BorderRadius.only(
137+
bottomLeft: Radius.circular(10),
138+
bottomRight: Radius.circular(10),
139+
),
140+
color: Colors.red,
141+
gradient: LinearGradient(
142+
begin: Alignment.centerLeft,
143+
end: Alignment.centerRight,
144+
colors: [Colors.red, Colors.blue])),
145+
height: 240,
146+
child: Stack(
147+
alignment: const FractionalOffset(0.8, 0.8),
148+
children: <Widget>[
149+
Center(
150+
child: Column(
151+
mainAxisAlignment: MainAxisAlignment.center,
152+
children: <Widget>[
153+
Opacity(
154+
child: Image.network(
155+
'https://raw.githubusercontent.com/efoxTeam/flutter-ui/master/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png',
156+
width: 80.0,
157+
height: 80.0,
158+
fit: BoxFit.cover,
159+
),
160+
opacity: 1,
161+
),
162+
SizedBox(height: 10,),
163+
Text("Flutter-UI",
164+
style: TextStyle(
165+
color: Colors.white,
166+
fontSize: 26,
167+
fontWeight: FontWeight.bold
168+
),)
169+
],
170+
),
171+
)
172+
],
173+
),
174+
),
175+
ListView.builder(
176+
shrinkWrap: true,
177+
itemCount: _getList().length * 2,
178+
itemBuilder: (context, index) {
179+
double _index = index / 2;
180+
if (index % 2 == 0) {
181+
dynamic item = _getList()[_index.toInt()];
182+
return ListTile(
183+
onTap: () {
184+
actionsEvent(item['index']);
185+
},
186+
leading: Icon(
187+
IconData(
188+
item['icon'],
189+
fontFamily: 'MaterialIcons',
190+
matchTextDirection: true,
191+
),
192+
),
193+
title: Text(item['name']),
194+
);
195+
} else {
196+
return Divider(
197+
color: Color(AppTheme.lineColor),
198+
);
199+
}
200+
},
201+
),
202+
],
203+
),
204+
);
205+
}
206+
}
207+
208+
class Index extends StatefulWidget {
209+
final dynamic model;
210+
211+
Index({Key key, this.model}) : super(key: key);
212+
213+
@override
214+
_IndexState createState() => _IndexState();
215+
}

lib/store/models/config_state_model.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ConfigModel {
3232

3333
switch (name) {
3434
case 'setEnv':
35-
_appConfigInfo.isPro = !_appConfigInfo.isPro;
35+
_appConfigInfo.isPro = payload;
3636
break;
3737
case 'setVersion':
3838
_appConfigInfo.version = await this.getVersion();

lib/widget/navigator/index.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ List widgets = [
3737
),
3838
ItemInfo(
3939
widget: drawer.Index(),
40-
code: 58928, // airline_seat_flat
40+
code: 58928, // airline_seat_flat
4141
title: drawer.Index.title,
4242
),
4343
ItemInfo(
@@ -62,7 +62,7 @@ List widgets = [
6262
),
6363
ItemInfo(
6464
widget: popupmenubutton.Index(),
65-
code: 57440, // art_track
65+
code: 57440, // art_track
6666
title: popupmenubutton.Index.title,
6767
),
6868
ItemInfo(
@@ -81,7 +81,7 @@ List widgetMap = [
8181
ItemListInfo(
8282
nameSpaces: nameSpaces,
8383
widgetList: widgets,
84-
typeName: 'navigator',
84+
typeName: 'Navigator',
8585
code: 58717,
8686
)
8787
];

locale/en.json

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,31 @@
66
"widgetType": {
77
"regularLayout": "common layout"
88
},
9-
"common" : {
9+
"common": {
1010
"changeLanguage": "显示中文",
1111
"changeVersion": "checkVersion",
1212
"compProgress": "Components Progress"
1313
},
14+
"common_mine_1" : {
15+
"cn": "CN",
16+
"en": "EN",
17+
"language": "Select Language",
18+
"environment": "Select Environment",
19+
"compProgress": "Components Progress",
20+
"success": "Success To Change "
21+
},
1422
"mine": {
1523
"loadNetwork": "Load Network Document Resources",
1624
"loadLocal": "Load Local Document Resources"
1725
},
18-
"loading": "Loading"
26+
"loading": "Loading",
27+
"ScrollComponents": "ScrollComponents",
28+
"Common": "Common",
29+
"Form": "Form",
30+
"Regular": "Regular",
31+
"Navigator": "Navigator",
32+
"BulletBox": "BulletBox",
33+
"Animate": "Animate",
34+
"Gestures": "Gestures",
35+
"Vision": "Vision"
1936
}

0 commit comments

Comments
 (0)