File tree Expand file tree Collapse file tree 7 files changed +21
-28
lines changed Expand file tree Collapse file tree 7 files changed +21
-28
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ class _ListStatefulScaffoldState<T, K>
213
213
return CommonScaffold (
214
214
title: widget.title,
215
215
body: _buildBody (),
216
- action: widget.actionBuilder == null ? null : widget. actionBuilder ! (),
216
+ action: widget.actionBuilder? . call (),
217
217
);
218
218
}
219
219
}
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ class BbRepoScreen extends StatelessWidget {
64
64
text: Text ('Code' ),
65
65
rightWidget: Text (filesize (p.size)),
66
66
url:
67
- '/bitbucket/$owner /$name /src/${branch == null ? p .mainbranch !.name : branch }' ,
67
+ '/bitbucket/$owner /$name /src/${branch ?? p .mainbranch !.name }' ,
68
68
),
69
69
TableViewItem (
70
70
leftIconData: Octicons .issue_opened,
@@ -80,16 +80,15 @@ class BbRepoScreen extends StatelessWidget {
80
80
leftIconData: Octicons .history,
81
81
text: Text ('Commits' ),
82
82
url:
83
- '/bitbucket/$owner /$name /commits/${branch == null ? p .mainbranch !.name : branch }' ,
83
+ '/bitbucket/$owner /$name /commits/${branch ?? p .mainbranch !.name }' ,
84
84
),
85
85
if (branches != null )
86
86
TableViewItem (
87
87
leftIconData: Octicons .git_branch,
88
88
text: Text (AppLocalizations .of (context)! .branches),
89
- rightWidget: Text (
90
- (branch == null ? p.mainbranch! .name : branch)! +
91
- ' • ' +
92
- branches.length.toString ()),
89
+ rightWidget: Text ((branch ?? p.mainbranch! .name)! +
90
+ ' • ' +
91
+ branches.length.toString ()),
93
92
onTap: () async {
94
93
if (branches.length < 2 ) return ;
95
94
Original file line number Diff line number Diff line change @@ -139,8 +139,7 @@ class GeRepoScreen extends StatelessWidget {
139
139
leftIconData: Octicons .code,
140
140
text: Text ('Code' ),
141
141
rightWidget: Text (p.license ?? '' ),
142
- url:
143
- '/gitee/$owner /$name /tree/${branch == null ? p .defaultBranch : branch }' ,
142
+ url: '/gitee/$owner /$name /tree/${branch ?? p .defaultBranch }' ,
144
143
),
145
144
TableViewItem (
146
145
leftIconData: Octicons .issue_opened,
@@ -158,16 +157,15 @@ class GeRepoScreen extends StatelessWidget {
158
157
leftIconData: Octicons .history,
159
158
text: Text ('Commits' ),
160
159
url:
161
- '/gitee/$owner /$name /commits?branch=${branch == null ? p .defaultBranch : branch }' ,
160
+ '/gitee/$owner /$name /commits?branch=${branch ?? p .defaultBranch }' ,
162
161
),
163
162
if (branches != null )
164
163
TableViewItem (
165
164
leftIconData: Octicons .git_branch,
166
165
text: Text (AppLocalizations .of (context)! .branches),
167
- rightWidget: Text (
168
- (branch == null ? p.defaultBranch : branch)! +
169
- ' • ' +
170
- branches.length.toString ()),
166
+ rightWidget: Text ((branch ?? p.defaultBranch)! +
167
+ ' • ' +
168
+ branches.length.toString ()),
171
169
onTap: () async {
172
170
if (branches.length < 2 ) return ;
173
171
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ class GhObjectScreen extends StatelessWidget {
22
22
Widget build (BuildContext context) {
23
23
return RefreshStatefulScaffold <RepositoryContents >(
24
24
// canRefresh: !_isImage, // TODO:
25
- title: AppBarTitle (path == null ? 'Files' : path ),
25
+ title: AppBarTitle (path ?? 'Files' ),
26
26
fetch: () async {
27
27
// Do not request again for images
28
28
if (path != null &&
Original file line number Diff line number Diff line change @@ -199,17 +199,16 @@ class GlProjectScreen extends StatelessWidget {
199
199
? null
200
200
: Text (p.statistics! .commitCount.toString ()),
201
201
url:
202
- '/gitlab/projects/$id /commits?prefix=$prefix &branch=${branch == null ? p .defaultBranch : branch }' , // EDIT
202
+ '/gitlab/projects/$id /commits?prefix=$prefix &branch=${branch ?? p .defaultBranch }' , // EDIT
203
203
),
204
204
if (branches != null )
205
205
TableViewItem (
206
206
leftIconData: Octicons .git_branch,
207
207
text: Text (AppLocalizations .of (context)! .branches),
208
- rightWidget: Text (
209
- ((branch == null ? p.defaultBranch : branch) ??
210
- '' /** empty project */ ) +
211
- ' • ' +
212
- branches.length.toString ()),
208
+ rightWidget: Text (((branch ?? p.defaultBranch) ??
209
+ '' /** empty project */ ) +
210
+ ' • ' +
211
+ branches.length.toString ()),
213
212
onTap: () async {
214
213
if (branches.length < 2 ) return ;
215
214
Original file line number Diff line number Diff line change @@ -57,8 +57,7 @@ class GoObjectScreen extends StatelessWidget {
57
57
]);
58
58
} else {
59
59
final v = GogsBlob .fromJson (p);
60
- return BlobView (v.name,
61
- base64Text: v.content == null ? '' : v.content);
60
+ return BlobView (v.name, base64Text: v.content);
62
61
}
63
62
},
64
63
);
Original file line number Diff line number Diff line change @@ -94,8 +94,7 @@ class GoRepoScreen extends StatelessWidget {
94
94
TableViewItem (
95
95
leftIconData: Octicons .code,
96
96
text: Text ('Code' ),
97
- url:
98
- '/gogs/$owner /$name /blob?ref=${branch == null ? 'master' : branch }' ,
97
+ url: '/gogs/$owner /$name /blob?ref=${branch ?? 'master' }' ,
99
98
),
100
99
TableViewItem (
101
100
leftIconData: Octicons .issue_opened,
@@ -110,13 +109,12 @@ class GoRepoScreen extends StatelessWidget {
110
109
TableViewItem (
111
110
leftIconData: Octicons .history,
112
111
text: Text ('Commits' ),
113
- url:
114
- '/gogs/$owner /$name /commits?ref=${branch == null ? 'master' : branch }' ,
112
+ url: '/gogs/$owner /$name /commits?ref=${branch ?? 'master' }' ,
115
113
),
116
114
TableViewItem (
117
115
leftIconData: Octicons .git_branch,
118
116
text: Text (AppLocalizations .of (context)! .branches),
119
- rightWidget: Text ((branch == null ? 'master' : branch )! +
117
+ rightWidget: Text ((branch ?? 'master' )! +
120
118
' • ' +
121
119
'${branches == null ? '1' : branches .length .toString ()}' ),
122
120
onTap: () async {
You can’t perform that action at this time.
0 commit comments