Flutter error on some conversation panes (no history?) #108

Closed
opened 2021-07-13 17:09:10 +00:00 by dan · 1 comment
Owner

build 1.0+93

Screenshots:

logs:

flutter: Error: Could not find the correct Provider<ContactListState> above this MessageRow Widget
flutter:
flutter: This happens because you used a `BuildContext` that does not include the provider
flutter: of your choice. There are a few common scenarios:
flutter:
flutter: - You added a new provider in your `main.dart` and performed a hot-reload.
flutter:   To fix, perform a hot-restart.
flutter:
flutter: - The provider you are trying to read is in a different route.
flutter:
flutter:   Providers are "scoped". So if you insert of provider inside a route, then
flutter:   other routes will not be able to access that provider.
flutter:
flutter: - You used a `BuildContext` that is an ancestor of the provider you are trying to read.
flutter:
flutter:   Make sure that MessageRow is under your MultiProvider/Provider<ContactListState>.
flutter:   This usually happens when you are creating a provider and trying to read it immediately.
flutter:
flutter:   For example, instead of:
flutter:
flutter:   ```
flutter:   Widget build(BuildContext context) {
flutter:     return Provider<Example>(
flutter:       create: (_) => Example(),
flutter:       // Will throw a ProviderNotFoundError, because `context` is associated
flutter:       // to the widget that is the parent of `Provider<Example>`
flutter:       child: Text(context.watch<Example>()),
flutter:     ),
flutter:   }
flutter:   ```
flutter:
flutter:   consider using `builder` like so:
flutter:
flutter:   ```
flutter:   Widget build(BuildContext context) {
flutter:     return Provider<Example>(
flutter:       create: (_) => Example(),
flutter:       // we use `builder` to obtain a new `BuildContext` that has access to the provider
flutter:       builder: (context) {
flutter:         // No longer throws
flutter:         return Text(context.watch<Example>()),
flutter:       }
flutter:     ),
flutter:   }
flutter:   ```
flutter:
flutter: If none of these solutions work, consider asking for help on StackOverflow:
flutter: https://stackoverflow.com/questions/tagged/flutter
flutter:
flutter: #0      Provider._inheritedElementOf (package:provider/src/provider.dart:332)
flutter: #1      Provider.of (package:provider/src/provider.dart:284)
flutter: #2      MessageRowState.build (package:cwtch/widgets/messagerow.dart:28)
flutter: #3      StatefulElement.build (package:flutter/src/widgets/framework.dart:4691)
flutter: #4      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4574)
flutter: #5      StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4746)
flutter: #6      Element.rebuild (package:flutter/src/widgets/framework.dart:4267)
flutter: #7      ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4553)
flutter: #8      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4737)
flutter: #9      ComponentElement.mount (package:flutter/src/widgets/framework.dart:4548)
flutter: #10     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3611)
flutter: #11     Element.updateChild (package:flutter/src/widgets/framework.dart:3363)
flutter: #12     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599)
flutter: #13     Element.rebuild (package:flutter/src/widgets/framework.dart:4267)
flutter: #14     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4553)
flutter: #15     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4548)
flutter: #16     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3611)
flutter: #17     Element.updateChild (package:flutter/src/widgets/framework.dart:3363)
flutter: #18     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599)
flutter: #19     _InheritedProviderScopeElement.performRebuild (package:provider/src/inherited_provider.dart:456)
flutter: #20     Element.rebuild (package:flutter/src/widgets/framework.dart:4267)
flutter: #21     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4553)
flutter: #22     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4548)
flutter: #23     _InheritedProviderScopeElement.mount (package:provider/src/inherited_provider.dart:356)
flutter: #24     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3611)
flutter: #25     Element.updateChild (package:flutter/src/widgets/framework.dart:3363)
flutter: #26     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599)
flutter: #27     Element.rebuild (package:flutter/src/widgets/framework.dart:4267)
flutter: #28     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4553)
flutter: #29     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4548)
flutter: #30     SingleChildWidgetElementMixin.mount (package:nested/nested.dart:222)
flutter: #31     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3611)
flutter: #32     Element.updateChild (package:flutter/src/widgets/framework.dart:3360)
flutter: #33     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599)
flutter: #34     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4746)
flutter: #35     Element.rebuild (package:flutter/src/widgets/framework.dart:4267)
flutter: #36     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2582)
flutter: #37     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:875)
flutter: #38     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:328)
flutter: #39     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144)
flutter: #40     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1082)
flutter: #41     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:998)
flutter: #45     _invoke (dart:ui/hooks.dart:163)
flutter: #46     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:259)
flutter: #47     _drawFrame (dart:ui/hooks.dart:126)
flutter: (elided 3 frames from dart:async)
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
build 1.0+93 Screenshots: - http://imgur.com/a/jnyjyBZ  - https://imgur.com/FlVlmEi.png  logs: ``` flutter: Error: Could not find the correct Provider<ContactListState> above this MessageRow Widget flutter: flutter: This happens because you used a `BuildContext` that does not include the provider flutter: of your choice. There are a few common scenarios: flutter: flutter: - You added a new provider in your `main.dart` and performed a hot-reload. flutter: To fix, perform a hot-restart. flutter: flutter: - The provider you are trying to read is in a different route. flutter: flutter: Providers are "scoped". So if you insert of provider inside a route, then flutter: other routes will not be able to access that provider. flutter: flutter: - You used a `BuildContext` that is an ancestor of the provider you are trying to read. flutter: flutter: Make sure that MessageRow is under your MultiProvider/Provider<ContactListState>. flutter: This usually happens when you are creating a provider and trying to read it immediately. flutter: flutter: For example, instead of: flutter: flutter: ``` flutter: Widget build(BuildContext context) { flutter: return Provider<Example>( flutter: create: (_) => Example(), flutter: // Will throw a ProviderNotFoundError, because `context` is associated flutter: // to the widget that is the parent of `Provider<Example>` flutter: child: Text(context.watch<Example>()), flutter: ), flutter: } flutter: ``` flutter: flutter: consider using `builder` like so: flutter: flutter: ``` flutter: Widget build(BuildContext context) { flutter: return Provider<Example>( flutter: create: (_) => Example(), flutter: // we use `builder` to obtain a new `BuildContext` that has access to the provider flutter: builder: (context) { flutter: // No longer throws flutter: return Text(context.watch<Example>()), flutter: } flutter: ), flutter: } flutter: ``` flutter: flutter: If none of these solutions work, consider asking for help on StackOverflow: flutter: https://stackoverflow.com/questions/tagged/flutter flutter: flutter: #0 Provider._inheritedElementOf (package:provider/src/provider.dart:332) flutter: #1 Provider.of (package:provider/src/provider.dart:284) flutter: #2 MessageRowState.build (package:cwtch/widgets/messagerow.dart:28) flutter: #3 StatefulElement.build (package:flutter/src/widgets/framework.dart:4691) flutter: #4 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4574) flutter: #5 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4746) flutter: #6 Element.rebuild (package:flutter/src/widgets/framework.dart:4267) flutter: #7 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4553) flutter: #8 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4737) flutter: #9 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4548) flutter: #10 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3611) flutter: #11 Element.updateChild (package:flutter/src/widgets/framework.dart:3363) flutter: #12 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599) flutter: #13 Element.rebuild (package:flutter/src/widgets/framework.dart:4267) flutter: #14 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4553) flutter: #15 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4548) flutter: #16 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3611) flutter: #17 Element.updateChild (package:flutter/src/widgets/framework.dart:3363) flutter: #18 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599) flutter: #19 _InheritedProviderScopeElement.performRebuild (package:provider/src/inherited_provider.dart:456) flutter: #20 Element.rebuild (package:flutter/src/widgets/framework.dart:4267) flutter: #21 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4553) flutter: #22 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4548) flutter: #23 _InheritedProviderScopeElement.mount (package:provider/src/inherited_provider.dart:356) flutter: #24 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3611) flutter: #25 Element.updateChild (package:flutter/src/widgets/framework.dart:3363) flutter: #26 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599) flutter: #27 Element.rebuild (package:flutter/src/widgets/framework.dart:4267) flutter: #28 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4553) flutter: #29 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4548) flutter: #30 SingleChildWidgetElementMixin.mount (package:nested/nested.dart:222) flutter: #31 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3611) flutter: #32 Element.updateChild (package:flutter/src/widgets/framework.dart:3360) flutter: #33 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599) flutter: #34 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4746) flutter: #35 Element.rebuild (package:flutter/src/widgets/framework.dart:4267) flutter: #36 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2582) flutter: #37 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:875) flutter: #38 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:328) flutter: #39 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144) flutter: #40 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1082) flutter: #41 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:998) flutter: #45 _invoke (dart:ui/hooks.dart:163) flutter: #46 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:259) flutter: #47 _drawFrame (dart:ui/hooks.dart:126) flutter: (elided 3 frames from dart:async) flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' flutter: Another exception was thrown: Instance of 'DiagnosticsProperty<void>' ```
dan added the
bug
label 2021-07-13 17:09:10 +00:00
dan added this to the Cwtch Beta 1.1 project 2021-07-13 17:09:10 +00:00
sarah added the
cwtch-beta-1.1
label 2021-07-13 17:49:09 +00:00

same problem on flwtch-v1.0.0-96-g7b397ec-2021-07-13-22-32/​ ( android and linux version )

same problem on flwtch-v1.0.0-96-g7b397ec-2021-07-13-22-32/​ ( android and linux version )
dan closed this issue 2021-07-14 16:35:03 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cwtch.im/cwtch-ui#108
No description provided.