-
Notifications
You must be signed in to change notification settings - Fork 151
v1.0.1 #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
v1.0.1 #44
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9ead94b
feat:增加Android Crashlytics SDK
ckken 5bb7581
refactor:优化首页功能
ckken 60dfffd
feat:增加pageview组件
wanwusangzhi 81d1cd2
Merge branch 'dev' of https://github.com/efoxTeam/flutter-ui into dev
wanwusangzhi daa0f06
refact:升级安卓 compileSdkVersion 到 28 支持android x
ckken b3b7813
Merge branch 'dev' of https://github.com/efoxTeam/flutter-ui into dev
ckken 5ffde01
refact:增加中文导航
ckken 0e53181
feat:优化tab‘
wanwusangzhi 21ebfe9
Merge branch 'dev' of https://github.com/efoxTeam/flutter-ui into dev
wanwusangzhi 95433de
style:优化my
ckken File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat:优化tab‘
- Loading branch information
commit 0e53181d7e6c5afa91fb60a9cb2012ba01a7e7d2
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
206 changes: 206 additions & 0 deletions
lib/page/mine/index_1.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,206 @@ | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:efox_flutter/lang/index.dart' show AppLocalizations; | ||
| import 'package:efox_flutter/router/index.dart' show FluroRouter; | ||
| import 'package:efox_flutter/config/theme.dart' show AppTheme; | ||
|
|
||
| class _IndexState extends State<Index> { | ||
| @override | ||
| void initState() { | ||
| super.initState(); | ||
| } | ||
|
|
||
| List<dynamic> _getList() { | ||
| return [ | ||
| { | ||
| 'name': AppLocalizations.$t('common_mine_1.language'), | ||
| 'icon': 59540, // language | ||
| 'index': 0 | ||
| }, | ||
| { | ||
| 'name': AppLocalizations.$t('common_mine_1.environment'), | ||
| 'icon': 57539, // import_export | ||
| 'index': 1, | ||
| }, | ||
| { | ||
| 'name': AppLocalizations.$t('common_mine_1.compProgress'), | ||
| 'icon': 57709, // low_priority | ||
| 'index': 2 | ||
| } | ||
| ]; | ||
| } | ||
|
|
||
| actionsEvent(int index) { | ||
| print('index $index'); | ||
| switch (index) { | ||
| case 0: | ||
| this.openLanguageSelectMenu(); | ||
| break; | ||
| case 1: | ||
| this.openEnvSelectMenu(); | ||
| break; | ||
| case 2: | ||
| FluroRouter.router.navigateTo( | ||
| context, | ||
| '/webview?url=${Uri.encodeComponent(widget.model.config.state.env.githubWeb)}&title=${Uri.encodeComponent(AppLocalizations.$t('common.compProgress'))}', | ||
| ); | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| void pop([message]) { | ||
| Navigator.pop(context); | ||
| if (message != null) { | ||
| Scaffold.of(context).showSnackBar(new SnackBar( | ||
| content: new Text(message), | ||
| )); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * 国际化 | ||
| */ | ||
| void openLanguageSelectMenu() async { | ||
| await showModalBottomSheet( | ||
| context: context, | ||
| builder: (BuildContext bc) { | ||
| return Container( | ||
| child: Wrap( | ||
| children: <Widget>[ | ||
| ListTile( | ||
| leading: Icon(Icons.label_outline), | ||
| title: Text( | ||
| AppLocalizations.$t('common_mine_1.cn'), | ||
| ), | ||
| onTap: () { | ||
| AppLocalizations.changeLanguage(Locale('zh')); | ||
| this.pop(AppLocalizations.$t('common_mine_1.success')); | ||
| }, | ||
| ), | ||
| ListTile( | ||
| leading: Icon(Icons.label_outline), | ||
| title: Text(AppLocalizations.$t('common_mine_1.en')), | ||
| onTap: () { | ||
| AppLocalizations.changeLanguage(Locale('en')); | ||
| this.pop(AppLocalizations.$t('common_mine_1.success')); | ||
| }, | ||
| ), | ||
| ], | ||
| ), | ||
| ); | ||
| }, | ||
| ); | ||
| } | ||
|
|
||
| /** | ||
| * 环境选择 | ||
| */ | ||
| void openEnvSelectMenu() async { | ||
| await showModalBottomSheet( | ||
| context: context, | ||
| builder: (BuildContext bc) { | ||
| return Container( | ||
| child: Wrap( | ||
| children: <Widget>[ | ||
| ListTile( | ||
| leading: Icon(Icons.label_outline), | ||
| title: Text( | ||
| AppLocalizations.$t('mine.loadNetwork'), | ||
| ), | ||
| onTap: () { | ||
| widget.model.dispatch('config', 'setEnv', true); | ||
| this.pop(AppLocalizations.$t('common_mine_1.success')); | ||
| }, | ||
| ), | ||
| ListTile( | ||
| leading: Icon(Icons.label_outline), | ||
| title: Text(AppLocalizations.$t('mine.loadLocal')), | ||
| onTap: () { | ||
| widget.model.dispatch('config', 'setEnv', false); | ||
| this.pop(AppLocalizations.$t('common_mine_1.success')); | ||
| }, | ||
| ), | ||
| ], | ||
| ), | ||
| ); | ||
| }, | ||
| ); | ||
| } | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return SingleChildScrollView( | ||
| child: Column( | ||
| children: <Widget>[ | ||
| Container( | ||
| decoration: BoxDecoration( | ||
| borderRadius: BorderRadius.only( | ||
| bottomLeft: Radius.circular(10), | ||
| bottomRight: Radius.circular(10) | ||
| ), | ||
| color: Colors.red, | ||
| ), | ||
| height: 240, | ||
| child: Stack( | ||
| alignment: const FractionalOffset(0.8, 0.8), | ||
| children: <Widget>[ | ||
| Row( | ||
| children: <Widget>[ | ||
| Image.network( | ||
| 'https://raw.githubusercontent.com/efoxTeam/flutter-ui/master/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png', | ||
| width: 80.0, | ||
| height: 80.0, | ||
| fit: BoxFit.cover, | ||
| ), | ||
| SizedBox( | ||
| width: 10, | ||
| ), | ||
| Text( | ||
| 'Hello Guest', | ||
| style: TextStyle(color: Colors.white), | ||
| ) | ||
| ], | ||
| ) | ||
| ], | ||
| ), | ||
| ), | ||
| ListView.builder( | ||
| shrinkWrap: true, | ||
| itemCount: _getList().length * 2, | ||
| itemBuilder: (context, index) { | ||
| double _index = index / 2; | ||
| if (index % 2 == 0) { | ||
| dynamic item = _getList()[_index.toInt()]; | ||
| return ListTile( | ||
| onTap: () { | ||
| actionsEvent(item['index']); | ||
| }, | ||
| leading: Icon( | ||
| IconData( | ||
| item['icon'], | ||
| fontFamily: 'MaterialIcons', | ||
| matchTextDirection: true, | ||
| ), | ||
| ), | ||
| title: Text(item['name']), | ||
| ); | ||
| } else { | ||
| return Divider( | ||
| color: Color(AppTheme.lineColor), | ||
| ); | ||
| } | ||
| }, | ||
| ), | ||
| ], | ||
| ), | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| class Index extends StatefulWidget { | ||
| final dynamic model; | ||
|
|
||
| Index({Key key, this.model}) : super(key: key); | ||
|
|
||
| @override | ||
| _IndexState createState() => _IndexState(); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.