Widget build(BuildContext context) {
if
(_controller.hasClients) {
SchedulerBinding.instance.addPostFrameCallback((_)
=>
_controller.jumpTo(
0.0
));
return
Container(
child
:
...
エラーログ
そのままやると:
Widget build(BuildContext context) {
if (_controller.hasClients) {
_controller.jumpTo(0.0);
Performing hot reload...
Syncing files to device iPhone XR...
Reloaded 1 of 553 libraries in 949ms.
flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following assertion was thrown building MyWidget(dirty, dependencies:
flutter: [_LocalizationsScope-[GlobalKey#ab210], _InheritedTheme], state: _MyWidgetState#100b7):
flutter: Unexpected call to replaceSemanticsActions() method of RawGestureDetectorState.
flutter: The replaceSemanticsActions() method can only be called outside of the build phase.