Skip to content

Commit 2219839

Browse files
committed
fix flex button data error
1 parent 980a5ac commit 2219839

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

lib/app.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ class _FlutterReduxAppState extends State<FlutterReduxApp>
9393
},
9494
HomePage.sName: (context) {
9595
_context = context;
96+
print("##############");
9697
return NavigatorUtils.pageContainer(new HomePage(), context);
9798
},
9899
LoginPage.sName: (context) {

lib/common/utils/common_utils.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ class CommonUtils {
421421
///列表item dialog
422422
static Future<Null> showCommitOptionDialog(
423423
BuildContext context,
424-
StringList? commitMaps,
424+
List<String?>? commitMaps,
425425
ValueChanged<int> onTap, {
426426
width = 250.0,
427427
height = 400.0,
@@ -442,7 +442,7 @@ class CommonUtils {
442442
borderRadius: BorderRadius.all(Radius.circular(4.0)),
443443
),
444444
child: new ListView.builder(
445-
itemCount: commitMaps!.length,
445+
itemCount: commitMaps?.length ?? 0,
446446
itemBuilder: (context, index) {
447447
return GSYFlexButton(
448448
maxLines: 1,
@@ -451,7 +451,7 @@ class CommonUtils {
451451
color: colorList != null
452452
? colorList[index]
453453
: Theme.of(context).primaryColor,
454-
text: commitMaps[index],
454+
text: commitMaps![index],
455455
textColor: GSYColors.white,
456456
onPress: () {
457457
Navigator.pop(context);

lib/page/issue/issue_detail_page.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ class _IssueDetailPageState extends State<IssueDetailPage>
8787
children: <Widget>[
8888
new GSYFlexButton(
8989
color: GSYColors.white,
90+
textColor: GSYColors.primaryDarkValue,
9091
text: GSYLocalizations.i18n(context)!
9192
.issue_edit_issue_edit_commit,
9293
onPress: () {

lib/page/repos/repository_detail_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class _RepositoryDetailPageState extends State<RepositoryDetailPage>
114114
return;
115115
}
116116
CommonUtils.showCommitOptionDialog(
117-
context, reposDetailModel!.branchList, (value) {
117+
context, reposDetailModel?.branchList, (value) {
118118
reposDetailModel!.currentBranch =
119119
reposDetailModel!.branchList![value];
120120
if (infoListKey.currentState != null &&

lib/page/repos/scope/repos_detail_model.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ReposDetailModel extends Model {
2626

2727
List<Widget>? _footerButtons;
2828

29-
List<String>? _branchList;
29+
List<String?>? _branchList;
3030

3131
RepositoryQL? get repository => _repository;
3232

@@ -65,9 +65,9 @@ class ReposDetailModel extends Model {
6565
notifyListeners();
6666
}
6767

68-
List<String>? get branchList => _branchList;
68+
List<String?>? get branchList => _branchList;
6969

70-
set branchList(List<String>? data) {
70+
set branchList(List<String?>? data) {
7171
_branchList = data;
7272
notifyListeners();
7373
}

lib/widget/gsy_flex_button.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:flutter/material.dart';
2-
import 'package:gsy_github_app_flutter/common/style/gsy_style.dart';
32

43
/**
54
* 充满的button
@@ -38,8 +37,6 @@ class GSYFlexButton extends StatelessWidget {
3837
backgroundColor: ButtonStyleButton.allOrNull<Color>(
3938
color,
4039
),
41-
textStyle: ButtonStyleButton.allOrNull<TextStyle>(
42-
new TextStyle(color: textColor)),
4340
padding: ButtonStyleButton.allOrNull<EdgeInsetsGeometry>(
4441
new EdgeInsets.only(
4542
left: 20.0, top: 10.0, right: 20.0, bottom: 10.0),
@@ -51,7 +48,8 @@ class GSYFlexButton extends StatelessWidget {
5148
children: <Widget>[
5249
new Expanded(
5350
child: new Text(text!,
54-
style: new TextStyle(fontSize: fontSize, height: 1),
51+
style: new TextStyle(
52+
color: textColor, fontSize: fontSize, height: 1),
5553
textAlign: TextAlign.center,
5654
maxLines: maxLines,
5755
overflow: TextOverflow.ellipsis),

0 commit comments

Comments
 (0)