Skip to content

Commit 68bbd3d

Browse files
committed
fix #120
1 parent 478d15a commit 68bbd3d

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

lib/common/utils/NavigatorUtils.dart

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'dart:async';
22
import 'dart:io';
33

4+
import 'package:flutter/cupertino.dart';
45
import 'package:flutter/material.dart';
56
import 'package:gsy_github_app_flutter/page/CodeDetailPage.dart';
67
import 'package:gsy_github_app_flutter/page/CodeDetailPageWeb.dart';
@@ -45,19 +46,19 @@ class NavigatorUtils {
4546

4647
///个人中心
4748
static goPerson(BuildContext context, String userName) {
48-
Navigator.push(context, new MaterialPageRoute(builder: (context) => new PersonPage(userName)));
49+
Navigator.push(context, new CupertinoPageRoute(builder: (context) => new PersonPage(userName)));
4950
}
5051

5152
///仓库详情
5253
static Future<Null> goReposDetail(BuildContext context, String userName, String reposName) {
53-
return Navigator.push(context, new MaterialPageRoute(builder: (context) => new RepositoryDetailPage(userName, reposName)));
54+
return Navigator.push(context, new CupertinoPageRoute(builder: (context) => new RepositoryDetailPage(userName, reposName)));
5455
}
5556

5657
///仓库版本列表
5758
static Future<Null> goReleasePage(BuildContext context, String userName, String reposName, String releaseUrl, String tagUrl) {
5859
return Navigator.push(
5960
context,
60-
new MaterialPageRoute(
61+
new CupertinoPageRoute(
6162
builder: (context) => new ReleasePage(
6263
userName,
6364
reposName,
@@ -70,7 +71,7 @@ class NavigatorUtils {
7071
static Future<Null> goIssueDetail(BuildContext context, String userName, String reposName, String num, {bool needRightLocalIcon = false}) {
7172
return Navigator.push(
7273
context,
73-
new MaterialPageRoute(
74+
new CupertinoPageRoute(
7475
builder: (context) => new IssueDetailPage(
7576
userName,
7677
reposName,
@@ -83,7 +84,7 @@ class NavigatorUtils {
8384
static gotoCommonList(BuildContext context, String title, String showType, String dataType, {String userName, String reposName}) {
8485
Navigator.push(
8586
context,
86-
new MaterialPageRoute(
87+
new CupertinoPageRoute(
8788
builder: (context) => new CommonListPage(
8889
title,
8990
showType,
@@ -98,7 +99,7 @@ class NavigatorUtils {
9899
{String title, String userName, String reposName, String path, String data, String branch, String htmlUrl}) {
99100
Navigator.push(
100101
context,
101-
new MaterialPageRoute(
102+
new CupertinoPageRoute(
102103
builder: (context) => new CodeDetailPage(
103104
title: title,
104105
userName: userName,
@@ -112,19 +113,19 @@ class NavigatorUtils {
112113

113114
///仓库详情通知
114115
static Future<Null> goNotifyPage(BuildContext context) {
115-
return Navigator.push(context, new MaterialPageRoute(builder: (context) => new NotifyPage()));
116+
return Navigator.push(context, new CupertinoPageRoute(builder: (context) => new NotifyPage()));
116117
}
117118

118119
///搜索
119120
static Future<Null> goSearchPage(BuildContext context) {
120-
return Navigator.push(context, new MaterialPageRoute(builder: (context) => new SearchPage()));
121+
return Navigator.push(context, new CupertinoPageRoute(builder: (context) => new SearchPage()));
121122
}
122123

123124
///提交详情
124125
static Future<Null> goPushDetailPage(BuildContext context, String userName, String reposName, String sha, bool needHomeIcon) {
125126
return Navigator.push(
126127
context,
127-
new MaterialPageRoute(
128+
new CupertinoPageRoute(
128129
builder: (context) => new PushDetailPage(
129130
sha,
130131
userName,
@@ -137,7 +138,7 @@ class NavigatorUtils {
137138
static Future<Null> goGSYWebView(BuildContext context, String url, String title) {
138139
return Navigator.push(
139140
context,
140-
new MaterialPageRoute(
141+
new CupertinoPageRoute(
141142
builder: (context) => new GSYWebView(url, title),
142143
),
143144
);
@@ -148,7 +149,7 @@ class NavigatorUtils {
148149
{String title, String userName, String reposName, String path, String data, String branch, String htmlUrl}) {
149150
Navigator.push(
150151
context,
151-
new MaterialPageRoute(
152+
new CupertinoPageRoute(
152153
builder: (context) => new CodeDetailPageWeb(
153154
title: title,
154155
userName: userName,
@@ -186,11 +187,11 @@ class NavigatorUtils {
186187

187188
///图片预览
188189
static gotoPhotoViewPage(BuildContext context, String url) {
189-
Navigator.push(context, new MaterialPageRoute(builder: (context) => new PhotoViewPage(url)));
190+
Navigator.push(context, new CupertinoPageRoute(builder: (context) => new PhotoViewPage(url)));
190191
}
191192

192193
///用户配置
193194
static gotoUserProfileInfo(BuildContext context) {
194-
Navigator.push(context, new MaterialPageRoute(builder: (context) => new UserProfileInfo()));
195+
Navigator.push(context, new CupertinoPageRoute(builder: (context) => new UserProfileInfo()));
195196
}
196197
}

lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'dart:async';
22

3+
import 'package:flutter/cupertino.dart';
34
import 'package:flutter/foundation.dart';
45
import 'package:flutter/material.dart';
56
import 'package:event_bus/event_bus.dart';
@@ -35,7 +36,6 @@ class FlutterReduxApp extends StatelessWidget {
3536
trendList: new List(),
3637
themeData: new ThemeData(
3738
primarySwatch: GSYColors.primarySwatch,
38-
platform: TargetPlatform.iOS//滑动返回
3939
),
4040
locale: Locale('zh', 'CH')),
4141
);

0 commit comments

Comments
 (0)