このエラーの意味と修正方法を誰かに説明してもらえますか?
null-safe で更新した後に取得しましたが、修正方法がわかりません。
ここでスタックオーバーフローの他のスレッドを確認しましたが、問題を理解できませんでした。多分誰かが私にそれをより良い方法で説明できるでしょう。
メインページから別のページに切り替えるたびに表示されます
setState() or markNeedsBuild() called during build.
This _InheritedProviderScope<JourneyProvider?> widget cannot be marked as needing to build because the framework is already in the process of building widgets. A widget can be marked as needing to be built during the build phase only if one of its ancestors is currently building. This exception is allowed because the framework builds parent widgets before children, which means a dirty descendant will always be built. Otherwise, the framework might not visit this widget during this build phase.
The widget on which setState() or markNeedsBuild() was called was: _InheritedProviderScope<JourneyProvider?>
value: Instance of 'JourneyProvider'
listening to value
The widget which was currently being built when the offending call was made was: Builder
When the exception was thrown, this was the stack:
#0 Element.markNeedsBuild.<anonymous closure> (package:flutter/src/widgets/framework.dart:4305:11)
#1 Element.markNeedsBuild (package:flutter/src/widgets/framework.dart:4320:6)
#2 _InheritedProviderScopeElement.markNeedsNotifyDependents (package:provider/src/inherited_provider.dart:570:5)
#3 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:308:24)
#4 JourneyProvider.getMyJourney (package:PinkDrive/providers/journeyProvider.dart:303:5)
#5 MyJourneyState.initData (package:PinkDrive/views/journey/myJounrey.dart:55:58)
#6 MyJourneyState.initState (package:PinkDrive/views/journey/myJounrey.dart:49:9)
#7 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4805:57)
#8 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4638:5)
... Normal element mounting (169 frames)
#177 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3673:14)
#178 MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6333:36)
#179 Element.updateChild (package:flutter/src/widgets/framework.dart:3425:18)
#180 RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:5758:32)
#181 MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6356:17)
#182 Element.updateChild (package:flutter/src/widgets/framework.dart:3412:15)
#183 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4690:16)
#184 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4840:11)
#185 Element.rebuild (package:flutter/src/widgets/framework.dart:4355:5)
#186 StatefulElement.update (package:flutter/src/widgets/framework.dart:4872:5)
#187 Element.updateChild (package:flutter/src/widgets/framework.dart:3412:15)
#188 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4690:16)
#189 Element.rebuild (package:flutter/src/widgets/framework.dart:4355:5)
#190 ProxyElement.update (package:flutter/src/widgets/framework.dart:5020:5)
#191 Element.updateChild (package:flutter/src/widgets/framework.dart:3412:15)
#192 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4690:16)
#193 Element.rebuild (package:flutter/src/widgets/framework.dart:4355:5)
#194 ProxyElement.update (package:flutter/src/widgets/framework.dart:5020:5)
#195 _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:181:11)
#196 Element.updateChild (package:flutter/src/widgets/framework.dart:3412:15)
#197 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6202:14)
#198 Element.updateChild (package:flutter/src/widgets/framework.dart:3412:15)
#199 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4690:16)
#200 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4840:11)
#201 Element.rebuild (package:flutter/src/widgets/framework.dart:4355:5)
#202 StatefulElement.update (package:flutter/src/widgets/framework.dart:4872:5)
#203 Element.updateChild (package:flutter/src/widgets/framework.dart:3412:15)
#204 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6202:14)
#205 Element.updateChild (package:flutter/src/widgets/framework.dart:3412:15)
#206 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6202:14)
#207 Element.updateChild (package:flutter/src/widgets/framework.dart:3412:15)
#208 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4690:16)
#209 Element.rebuild (package:flutter/src/widgets/framework.dart:4355:5)
#210 ProxyElement.update (package:flutter/src/widgets/framework.dart:5020:5)
#211 Element.updateChild (package:flutter/src/widgets/framework.dart:3412:15)
#212 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4690:16)
#213 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4840:11)
#214 Element.rebuild (package:flutter/src/widgets/framework.dart:4355:5)
#215 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2620:33)
#216 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:882:21)
#217 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:319:5)
#218 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1143:15)
#219 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1080:9)
#220 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:996:5)
#224 _invoke (dart:ui/hooks.dart:166:10)
#225 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:270:5)
#226 _drawFrame (dart:ui/hooks.dart:129:31)
(elided 3 frames from dart:async)
The JourneyProvider sending notification was: Instance of 'JourneyProvider'