回答編集履歴

1

コード修正

2020/07/29 02:33

投稿

tepci
tepci

スコア419

test CHANGED
@@ -64,9 +64,11 @@
64
64
 
65
65
  class _MyWidgetState extends State<MyWidget> {
66
66
 
67
+ bool _isEnd = false;
68
+
67
69
  String _text = "";
68
70
 
69
- List<String> _quizzes = ["a", "b", "c", "d"];
71
+ List<String> _quizzes = ["クイズ1", "クイズ2", "クイズ3", "クイズ4"];
70
72
 
71
73
 
72
74
 
@@ -88,13 +90,15 @@
88
90
 
89
91
  return Column(
90
92
 
93
+ mainAxisAlignment: MainAxisAlignment.center,
94
+
91
95
  children: [
92
96
 
93
- Text(_text),
97
+ _isEnd ? Text("終了") : Text(_text),
94
98
 
95
- RaisedButton(
99
+ if (!_isEnd) RaisedButton(
96
100
 
97
- child: Text("ボタン"),
101
+ child: Text("次へ"),
98
102
 
99
103
  onPressed: _random,
100
104
 
@@ -122,7 +126,7 @@
122
126
 
123
127
  } else {
124
128
 
125
- _text = "終了";
129
+ _isEnd = true;
126
130
 
127
131
  }
128
132