Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 667ef65

Browse files
committed
refactor:优化依赖版本信息
1 parent 3b1badf commit 667ef65

File tree

4 files changed

+32
-28
lines changed

4 files changed

+32
-28
lines changed

‎lib/main.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ class MainAppState extends State<MainApp> {
7171
}
7272

7373
void main() => runApp(
74-
Store.init(
75-
child: MainApp(),
74+
OKToast(
75+
child: Store.init(
76+
child: MainApp(),
77+
),
7678
),
7779
);

‎lib/page/mine/index.dart

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import 'package:efox_flutter/store/index.dart' show ConfigModel, Store;
66
import 'package:efox_flutter/config/color.dart' show materialColor;
77
import 'package:efox_flutter/utils/appVersion.dart' show AppVersion;
88
import 'package:efox_flutter/components/expansion_tile.dart' as Comp;
9+
import 'package:oktoast/oktoast.dart';
910

1011
class _IndexState extends State<Index> {
1112
@override
@@ -108,7 +109,7 @@ class _IndexState extends State<Index> {
108109
)
109110
],
110111
),
111-
/* Divider(
112+
/* Divider(
112113
color: Color(AppTheme.lineColor),
113114
),
114115
ListTile(
@@ -123,28 +124,27 @@ class _IndexState extends State<Index> {
123124
Divider(
124125
color: Color(AppTheme.lineColor),
125126
),
126-
(Platform.isAndroid)
127-
? ListTile(
128-
onTap: () {
129-
AppVersion().check(context, showTips: true);
130-
},
131-
leading: Icon(Icons.history),
132-
title: Text(AppLocalizations.$t('common_mine_1.version')),
133-
trailing: Container(
134-
child: Row(
135-
mainAxisSize: MainAxisSize.min,
136-
children: <Widget>[
137-
Text(Store.value<ConfigModel>(context).appVersion),
138-
Icon(Icons.navigate_next)
139-
],
140-
),
141-
))
142-
: Container(),
143-
(Platform.isAndroid)
144-
? Divider(
145-
color: Color(AppTheme.lineColor),
146-
)
147-
: Container(),
127+
if (Platform.isAndroid)
128+
ListTile(
129+
onTap: () {
130+
AppVersion().check(context, showTips: true);
131+
},
132+
leading: Icon(Icons.history),
133+
title: Text(AppLocalizations.$t('common_mine_1.version')),
134+
trailing: Container(
135+
child: Row(
136+
mainAxisSize: MainAxisSize.min,
137+
children: <Widget>[
138+
Text(Store.value<ConfigModel>(context).appVersion),
139+
Icon(Icons.navigate_next)
140+
],
141+
),
142+
),
143+
),
144+
if (Platform.isAndroid)
145+
Divider(
146+
color: Color(AppTheme.lineColor),
147+
),
148148
],
149149
));
150150
}

‎lib/utils/appVersion.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:open_file/open_file.dart';
77
import 'package:permission_handler/permission_handler.dart';
88
import 'package:efox_flutter/http/index.dart' as Http;
99
import 'package:flutter/material.dart';
10+
import 'package:oktoast/oktoast.dart';
1011

1112
class AppVersion {
1213
Future<bool> _checkPermission() async {
@@ -45,9 +46,10 @@ class AppVersion {
4546
if (d['isNew']) {
4647
this._showDialog(context, d);
4748
} else if (showTips) {
48-
Scaffold.of(context).showSnackBar(new SnackBar(
49+
showToast('已经是最新版本');
50+
/*Scaffold.of(context).showSnackBar(new SnackBar(
4951
content: new Text('已经是最新版本'),
50-
));
52+
));*/
5153
}
5254
}
5355

‎pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: A new Flutter project.
1010
version: 1.0.3+1
1111

1212
environment:
13-
sdk: ">=2.1.0 <3.0.0"
13+
sdk: ">=2.2.2 <3.0.0"
1414

1515
dependencies:
1616
flutter:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /