Skip to content

Commit e13c6e2

Browse files
committed
调整部分代码,调整部分调整
1 parent d920bed commit e13c6e2

14 files changed

+327
-297
lines changed

ios/Podfile.lock

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -98,26 +98,26 @@ EXTERNAL SOURCES:
9898
:path: ".symlinks/plugins/webview_flutter/ios"
9999

100100
SPEC CHECKSUMS:
101-
android_intent: 96848466ee23479bdb64dc5fa04e8fe1f59200aa
102-
connectivity: d5992e3758d68b1c4b12d6e012fe0813f1aa1645
103-
device_info: 76ce0b32e13034d1883be4a382433648f9dcee63
104-
Flutter: 9d0fac939486c9aba2809b7982dfdbb47a7b0296
105-
flutter_lottie: b8300e2b6ca2e420508be3a7449e722a8a095d9a
106-
flutter_statusbar: a563eb9416256f17660646aceb2314b113127da9
107-
flutter_webview_plugin: 116575b48572029304775b768e9f15ebfc316274
108-
fluttertoast: 0a20dcbbb8ecfd1a61b6285651ff2d5989d033fb
101+
android_intent: 73316069cd1f6aac919df1c6e640cad190fd5e8b
102+
connectivity: c72716e202a1225ec4810740d5cb56b8ae3bf4cc
103+
device_info: 3ebad48f726348f69abd802f3334a8d1ed795fbd
104+
Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a
105+
flutter_lottie: c1fd7e92e771209f8b623119646c15201c5e8c87
106+
flutter_statusbar: aa4982b847304a72c5ac8439a9f37861b662c6bb
107+
flutter_webview_plugin: ed9e8a6a96baf0c867e90e1bce2673913eeac694
108+
fluttertoast: b644586ef3b16f67fae9a1f8754cef6b2d6b634b
109109
FMDB: 6198a90e7b6900cfc046e6bc0ef6ebb7be9236aa
110110
lottie-ios: 3fef45d3fabe63e3c7c2eb603dd64ddfffc73062
111-
package_info: d7c98b64f60add4c2908b9d94d82a45d3c8827ad
112-
path_provider: 09407919825bfe3c2deae39453b7a5b44f467873
113-
permission_handler: 03dcf3ade9d5f398b8854b366cb9de718d3daa76
111+
package_info: 78cabb3c322943c55d39676f4a5bfc748c01d055
112+
path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259
113+
permission_handler: 047f11d44db785922214783da5f7a3cc8874c843
114114
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
115-
share: 222b5dcc8031238af9d7de91149df65bad1aef75
116-
shared_preferences: 5a1d487c427ee18fcd3ea1f2a131569481834b53
117-
sqflite: d1612813fa7db7c667bed9f1d1b508deffc56999
118-
url_launcher: 92b89c1029a0373879933c21642958c874539095
119-
webview_flutter: 9bd234c07e99632356cba112df56fd1d47d6b6e3
115+
share: 7d22fe8baedfe93aefd864bf0b73f29711fbb0a3
116+
shared_preferences: 1feebfa37bb57264736e16865e7ffae7fc99b523
117+
sqflite: ff1d9da63c06588cc8d1faf7256d741f16989d5a
118+
url_launcher: 0067ddb8f10d36786672aa0722a21717dba3a298
119+
webview_flutter: 1aa7604e6cdb451a9b7ed2c37d5454c0b440246b
120120

121121
PODFILE CHECKSUM: 7765ea4305eaab0b3dfd384c7de11902aa3195fd
122122

123-
COCOAPODS: 1.5.3
123+
COCOAPODS: 1.6.1

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@
532532
files = (
533533
);
534534
inputPaths = (
535-
"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
535+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
536536
"${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework",
537537
"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
538538
"${BUILT_PRODUCTS_DIR}/Reachability/Reachability.framework",
@@ -577,7 +577,7 @@
577577
);
578578
runOnlyForDeploymentPostprocessing = 0;
579579
shellPath = /bin/sh;
580-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
580+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
581581
showEnvVarsInLog = 0;
582582
};
583583
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {

lib/common/utils/navigator_utils.dart

Lines changed: 77 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import 'package:gsy_github_app_flutter/page/release_page.dart';
1717
import 'package:gsy_github_app_flutter/page/repository_detail_page.dart';
1818
import 'package:gsy_github_app_flutter/page/search_page.dart';
1919
import 'package:gsy_github_app_flutter/page/user_profile_page.dart';
20+
2021
/**
2122
* 导航栏
2223
* Created by guoshuyu
@@ -49,61 +50,73 @@ class NavigatorUtils {
4950
}
5051

5152
///仓库详情
52-
static Future goReposDetail(BuildContext context, String userName, String reposName) {
53+
static Future goReposDetail(
54+
BuildContext context, String userName, String reposName) {
5355
return NavigatorRouter(context, RepositoryDetailPage(userName, reposName));
5456
}
5557

5658
///仓库版本列表
57-
static Future goReleasePage(BuildContext context, String userName, String reposName, String releaseUrl, String tagUrl) {
59+
static Future goReleasePage(BuildContext context, String userName,
60+
String reposName, String releaseUrl, String tagUrl) {
5861
return NavigatorRouter(
5962
context,
6063
new ReleasePage(
61-
userName,
62-
reposName,
63-
releaseUrl,
64-
tagUrl,
65-
));
64+
userName,
65+
reposName,
66+
releaseUrl,
67+
tagUrl,
68+
));
6669
}
6770

6871
///issue详情
69-
static Future goIssueDetail(BuildContext context, String userName, String reposName, String num, {bool needRightLocalIcon = false}) {
72+
static Future goIssueDetail(
73+
BuildContext context, String userName, String reposName, String num,
74+
{bool needRightLocalIcon = false}) {
7075
return NavigatorRouter(
7176
context,
7277
new IssueDetailPage(
73-
userName,
74-
reposName,
75-
num,
76-
needHomeIcon: needRightLocalIcon,
77-
));
78+
userName,
79+
reposName,
80+
num,
81+
needHomeIcon: needRightLocalIcon,
82+
));
7883
}
7984

8085
///通用列表
81-
static gotoCommonList(BuildContext context, String title, String showType, String dataType, {String userName, String reposName}) {
86+
static gotoCommonList(
87+
BuildContext context, String title, String showType, String dataType,
88+
{String userName, String reposName}) {
8289
NavigatorRouter(
8390
context,
8491
new CommonListPage(
85-
title,
86-
showType,
87-
dataType,
88-
userName: userName,
89-
reposName: reposName,
90-
));
92+
title,
93+
showType,
94+
dataType,
95+
userName: userName,
96+
reposName: reposName,
97+
));
9198
}
9299

93100
///文件代码详情
94101
static gotoCodeDetailPage(BuildContext context,
95-
{String title, String userName, String reposName, String path, String data, String branch, String htmlUrl}) {
102+
{String title,
103+
String userName,
104+
String reposName,
105+
String path,
106+
String data,
107+
String branch,
108+
String htmlUrl}) {
96109
NavigatorRouter(
97110
context,
98111
new CodeDetailPage(
99-
title: title,
100-
userName: userName,
101-
reposName: reposName,
102-
path: path,
103-
data: data,
104-
branch: branch,
105-
htmlUrl: htmlUrl,
106-
));
112+
title: title,
113+
userName: userName,
114+
reposName: reposName,
115+
path: path,
116+
data: data,
117+
branch: branch,
118+
htmlUrl: htmlUrl,
119+
));
107120
}
108121

109122
///仓库详情通知
@@ -117,48 +130,60 @@ class NavigatorUtils {
117130
}
118131

119132
///提交详情
120-
static Future goPushDetailPage(BuildContext context, String userName, String reposName, String sha, bool needHomeIcon) {
133+
static Future goPushDetailPage(BuildContext context, String userName,
134+
String reposName, String sha, bool needHomeIcon) {
121135
return NavigatorRouter(
122136
context,
123137
new PushDetailPage(
124-
sha,
125-
userName,
126-
reposName,
127-
needHomeIcon: needHomeIcon,
128-
));
138+
sha,
139+
userName,
140+
reposName,
141+
needHomeIcon: needHomeIcon,
142+
));
129143
}
130144

131145
///全屏Web页面
132146
static Future goGSYWebView(BuildContext context, String url, String title) {
133-
return NavigatorRouter(
134-
context,
135-
new GSYWebView(url, title)
136-
);
147+
return NavigatorRouter(context, new GSYWebView(url, title));
137148
}
138149

139150
///文件代码详情Web
140151
static gotoCodeDetailPageWeb(BuildContext context,
141-
{String title, String userName, String reposName, String path, String data, String branch, String htmlUrl}) {
152+
{String title,
153+
String userName,
154+
String reposName,
155+
String path,
156+
String data,
157+
String branch,
158+
String htmlUrl}) {
142159
NavigatorRouter(
143-
context, new CodeDetailPageWeb(
144-
title: title,
145-
userName: userName,
146-
reposName: reposName,
147-
path: path,
148-
data: data,
149-
branch: branch,
150-
htmlUrl: htmlUrl,
151-
));
160+
context,
161+
new CodeDetailPageWeb(
162+
title: title,
163+
userName: userName,
164+
reposName: reposName,
165+
path: path,
166+
data: data,
167+
branch: branch,
168+
htmlUrl: htmlUrl,
169+
));
152170
}
153171

154172
///根据平台跳转文件代码详情Web
155173
static gotoCodeDetailPlatform(BuildContext context,
156-
{String title, String userName, String reposName, String path, String data, String branch, String htmlUrl}) {
174+
{String title,
175+
String userName,
176+
String reposName,
177+
String path,
178+
String data,
179+
String branch,
180+
String htmlUrl}) {
157181
NavigatorUtils.gotoCodeDetailPageWeb(
158182
context,
159183
title: title,
160184
reposName: reposName,
161185
userName: userName,
186+
data: data,
162187
path: path,
163188
branch: branch,
164189
);
@@ -174,9 +199,8 @@ class NavigatorUtils {
174199
NavigatorRouter(context, new UserProfileInfo());
175200
}
176201

177-
178202
static NavigatorRouter(BuildContext context, Widget widget) {
179-
return Navigator.push(context, new CupertinoPageRoute(builder: (context) => widget));
203+
return Navigator.push(
204+
context, new CupertinoPageRoute(builder: (context) => widget));
180205
}
181-
182206
}

lib/page/code_detail_page.dart

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,37 +31,24 @@ class CodeDetailPage extends StatefulWidget {
3131
CodeDetailPage({this.title, this.userName, this.reposName, this.path, this.data, this.branch, this.htmlUrl});
3232

3333
@override
34-
_CodeDetailPageState createState() => _CodeDetailPageState(this.title, this.userName, this.reposName, this.path, this.data, this.branch, this.htmlUrl);
34+
_CodeDetailPageState createState() => _CodeDetailPageState();
3535
}
3636

3737
class _CodeDetailPageState extends State<CodeDetailPage> {
38-
final String userName;
39-
40-
final String reposName;
41-
42-
final String path;
43-
44-
final String branch;
45-
46-
final String htmlUrl;
47-
48-
final String title;
4938

5039
final OptionControl titleOptionControl = new OptionControl();
5140

5241
String data;
5342

54-
_CodeDetailPageState(this.title, this.userName, this.reposName, this.path, this.data, this.branch, this.htmlUrl);
55-
5643
@override
5744
void initState() {
5845
super.initState();
5946
if (data == null) {
60-
ReposDao.getReposFileDirDao(userName, reposName, path: path, branch: branch, text: true).then((res) {
47+
ReposDao.getReposFileDirDao(widget.userName, widget.reposName, path: widget.path, branch: widget.branch, text: true).then((res) {
6148
if (res != null && res.result) {
6249
setState(() {
6350
data = res.data;
64-
titleOptionControl.url = htmlUrl ?? "";
51+
titleOptionControl.url = widget.htmlUrl ?? "";
6552
});
6653
}
6754
});
@@ -70,7 +57,7 @@ class _CodeDetailPageState extends State<CodeDetailPage> {
7057

7158
@override
7259
Widget build(BuildContext context) {
73-
Widget widget = (data == null)
60+
Widget widgetContent = (data == null)
7461
? new Center(
7562
child: new Container(
7663
width: 200.0,
@@ -94,12 +81,12 @@ class _CodeDetailPageState extends State<CodeDetailPage> {
9481
return new Scaffold(
9582
appBar: new AppBar(
9683
title: GSYTitleBar(
97-
title,
84+
widget.title,
9885
rightWidget: new GSYCommonOptionWidget(titleOptionControl),
9986
needRightLocalIcon: false,
10087
),
10188
),
102-
body: widget,
89+
body: widgetContent,
10390
);
10491
}
10592
}

0 commit comments

Comments
 (0)