質問編集履歴

1

ソースの不要部分を削除しました

2020/06/06 03:05

投稿

copp
copp

スコア11

test CHANGED
File without changes
test CHANGED
@@ -260,24 +260,8 @@
260
260
 
261
261
  floatingActionButton: FloatingActionButton(
262
262
 
263
- // こちらは OK
264
-
265
263
  onPressed: context.select((AppController value) => value.increment),
266
264
 
267
- // onPressed: () => {
268
-
269
- //// こちらは NG (error: Any usage other than inside the `build` method of a widget are not supported.)
270
-
271
- // if (context.select((AppState value) => value.counter) < 5)
272
-
273
- // {
274
-
275
- // context.select((AppController value) => value.increment),
276
-
277
- // }
278
-
279
- // },
280
-
281
265
  child: const Icon(Icons.add, color: Colors.white),
282
266
 
283
267
  ),