Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception while scrolling through TabBar navigation #18756

Closed
sahil311289 opened this issue Jun 23, 2018 · 33 comments · Fixed by #31581
Closed

Exception while scrolling through TabBar navigation #18756

sahil311289 opened this issue Jun 23, 2018 · 33 comments · Fixed by #31581
Assignees
Labels
c: crash Stack traces logged to the console f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Comments

@sahil311289
Copy link

sahil311289 commented Jun 23, 2018

Performing hot reload...
Reloaded 0 of 415 libraries in 866ms.
flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following assertion was thrown while finalizing the widget tree:
flutter: 'package:flutter/src/widgets/scroll_position.dart': Failed assertion: line 657 pos 12: 'pixels !=
flutter: null': is not true.
flutter:
flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially
flutter: more information in this error message to help you determine and fix the underlying cause.
flutter: In either case, please report this assertion by filing a bug on GitHub:
flutter:   https://github.com/flutter/flutter/issues/new
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #2      ScrollPosition.dispose (package:flutter/src/widgets/scroll_position.dart)
flutter: #3      ScrollPositionWithSingleContext.dispose (package:flutter/src/widgets/scroll_position_with_single_context.dart:255:11)
flutter: #4      ScrollableState.dispose (package:flutter/src/widgets/scrollable.dart:324:14)
flutter: #5      StatefulElement.unmount (package:flutter/src/widgets/framework.dart:3821:12)
flutter: #6      _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1697:13)
flutter: #7      _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #8      ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #9      _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #10     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #11     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #12     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #13     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #14     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #15     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #16     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #17     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #18     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #19     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #20     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #21     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #22     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #23     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #24     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #25     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #26     MultiChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4742:16)
flutter: #27     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #28     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #29     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #30     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #31     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #32     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #33     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #34     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #35     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #36     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #37     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #38     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
flutter: #39     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #40     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #41     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #42     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #43     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #44     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
flutter: #45     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #46     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #47     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #48     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #49     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #50     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #51     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #52     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #53     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #54     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #55     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #56     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #57     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #58     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #59     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #60     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #61     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #62     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #63     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #64     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #65     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
flutter: #66     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #67     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #68     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #69     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #70     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #71     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
flutter: #72     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #73     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #74     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
flutter: #75     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #76     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #77     MultiChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4742:16)
flutter: #78     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #79     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #80     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #81     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #82     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #83     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
flutter: #84     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #85     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #86     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #87     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #88     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #89     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
flutter: #90     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #91     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #92     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #93     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #94     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #95     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
flutter: #96     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #97     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #98     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #99     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #100    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #101    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #102    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #103    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #104    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #105    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #106    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #107    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
flutter: #108    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #109    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #110    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #111    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #112    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #113    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
flutter: #114    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #115    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #116    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #117    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #118    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #119    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #120    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #121    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #122    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
flutter: #123    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #124    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #125    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #126    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #127    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #128    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #129    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #130    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #131    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #132    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #133    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #134    MultiChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4742:16)
flutter: #135    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #136    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #137    _TheatreElement.visitChildren (package:flutter/src/widgets/overlay.dart:465:14)
flutter: #138    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #139    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #140    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #141    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #142    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #143    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #144    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #145    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #146    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
flutter: #147    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #148    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #149    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #150    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #151    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #152    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
flutter: #153    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #154    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #155    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
flutter: #156    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #157    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #158    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #159    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #160    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #161    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #162    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #163    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #164    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
flutter: #165    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #166    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #167    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #168    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #169    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #170    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #171    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #172    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #173    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #174    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #175    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #176    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #177    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #178    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #179    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #180    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #181    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #182    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
flutter: #183    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #184    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #185    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #186    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #187    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #188    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #189    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #190    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #191    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #192    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #193    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #194    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #195    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #196    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #197    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #198    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #199    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #200    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #201    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #202    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #203    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #204    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #205    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #206    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #207    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #208    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #209    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #210    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #211    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #212    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #213    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #214    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #215    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
flutter: #216    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #217    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #218    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #219    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #220    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #221    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #222    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #223    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
flutter: #224    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
flutter: #225    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
flutter: #226    ListIterable.forEach (dart:_internal/iterable.dart:39:13)
flutter: #227    _InactiveElements._unmountAll (package:flutter/src/widgets/framework.dart:1706:25)
flutter: #228    BuildOwner.finalizeTree.<anonymous closure> (package:flutter/src/widgets/framework.dart:2328:27)
flutter: #229    BuildOwner.lockState (package:flutter/src/widgets/framework.dart:2160:15)
flutter: #230    BuildOwner.finalizeTree (package:flutter/src/widgets/framework.dart:2327:7)
flutter: #231    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:628:18)
flutter: #232    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:208:5)
flutter: #233    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
flutter: #234    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
flutter: #235    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
flutter: #236    _invoke (dart:ui/hooks.dart:120:13)
flutter: #237    _drawFrame (dart:ui/hooks.dart:109:3)
flutter: (elided 2 frames from class _AssertionError)
flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════
@escamoteur
Copy link
Contributor

Please add your flutter doctor -v output

seems to be the same as #18763

@ajinasokan
Copy link

I have the same issue. Heres my flutter doctor output:

[✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.13.3 17D102, locale en-IN)
    • Flutter version 0.5.1 at /Users/ajinasokan/flutter
    • Framework revision c7ea3ca377 (4 weeks ago), 2018-05-29 21:07:33 +0200
    • Engine revision 1ed25ca7b7
    • Dart version 2.0.0-dev.58.0.flutter-f981f09760

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/ajinasokan/Library/Android/sdk
    • Android NDK at /Users/ajinasokan/Library/Android/sdk/ndk-bundle
    • Platform android-27, build-tools 27.0.3
    • ANDROID_HOME = /Users/ajinasokan/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.2, Build version 9C40b
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.2

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 25.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] VS Code (version 1.24.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.12.2

[✓] Connected devices (1 available)
    • iPhone 6 • 25B46C9F-DB64-460B-9108-F85437197F3D • ios • iOS 11.2 (simulator)

• No issues found!

@zoechi zoechi added c: crash Stack traces logged to the console framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Jun 25, 2018
@sahil311289
Copy link
Author

screen shot 2018-06-26 at 4 11 18 pm

Issue appears when I click on a TabBar (bottomNavigationBar with a child as TabBar in this case) in a random sequence. Sequentially clicking has no issues. But if I click 3rd tab after clicking 6th, it gives an exception. I hope the screenshot's message is helpful.

@escamoteur
Copy link
Contributor

Please add your flutter doctor -v output, the code of this page fenced in ```Dart above and ``` below the code and the output of the debug view when this exception occurs, Thanks

@zoechi zoechi mentioned this issue Jun 27, 2018
@sahil311289
Copy link
Author

sahil311289 commented Jun 27, 2018

Launching lib/main.dart on LG D802 in debug mode...
Initializing gradle...
Resolving dependencies...
Running 'gradlew assembleDebug'...
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
Warning: Missing asset in fonts for BadScript
Warning: Missing asset in fonts for Roboto
Warning: Missing asset in fonts for Roboto
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk...
I/FlutterActivityDelegate( 5478): onResume setting current activity to this
Warning: Missing asset in fonts for BadScript
Warning: Missing asset in fonts for Roboto
Warning: Missing asset in fonts for Roboto
Syncing files to device LG D802...
W/ResourcesManager( 5478): Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.
W/ResourcesManager( 5478): Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources.
V/NativeCrypto( 5478): Registering com/google/android/gms/org/conscrypt/NativeCrypto's 280 native methods...
I/art     ( 5478): Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.org.conscrypt.Java7ExtendedSSLSession>
I/art     ( 5478): Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.org.conscrypt.Java7ExtendedSSLSession>
I/art     ( 5478): Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.org.conscrypt.Java8ExtendedSSLSession>
I/art     ( 5478): Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.org.conscrypt.Java8ExtendedSSLSession>
W/System  ( 5478): Could not create com.google.android.gms.org.conscrypt.OpenSSLSocketFactoryImpl with ClassLoader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/chat.gabhub.GabHub-2/base.apk"],nativeLibraryDirectories=[/data/app/chat.gabhub.GabHub-2/lib/arm, /vendor/lib, /system/lib]]]: com.google.android.gms.org.conscrypt.OpenSSLSocketFactoryImpl
I/ProviderInstaller( 5478): Installed default security provider GmsCore_OpenSSL
D/libc-netbsd( 5478): [getaddrinfo]: hostname=xxxxx; servname=(null); cache_mode=(null), netid=0; mark=0
D/libc-netbsd( 5478): [getaddrinfo]: ai_addrlen=0; ai_canonname=xxxxx; ai_flags=4; ai_family=0
D/libc-netbsd( 5478): [getaddrinfo]: hostname=xxxxx; servname=(null); cache_mode=(null), netid=0; mark=0
D/libc-netbsd( 5478): [getaddrinfo]: ai_addrlen=0; ai_canonname=xxxxx; ai_flags=1024; ai_family=0
I/System.out( 5478): propertyValue:false
D/libc-netbsd( 5478): [getaddrinfo]: hostname=xxxxx; servname=(null); cache_mode=(null), netid=0; mark=0
D/libc-netbsd( 5478): [getaddrinfo]: ai_addrlen=0; ai_canonname=xxxxx; ai_flags=4; ai_family=0
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_UP
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_UP
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_UP
I/flutter ( 5478): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter ( 5478): The following assertion was thrown while finalizing the widget tree:
I/flutter ( 5478): 'package:flutter/src/widgets/scroll_position.dart': Failed assertion: line 657 pos 12: 'pixels !=
I/flutter ( 5478): null': is not true.
I/flutter ( 5478): Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter ( 5478): more information in this error message to help you determine and fix the underlying cause.
I/flutter ( 5478): In either case, please report this assertion by filing a bug on GitHub:
I/flutter ( 5478):   https://github.com/flutter/flutter/issues/new
I/flutter ( 5478): When the exception was thrown, this was the stack:
I/flutter ( 5478): #2      ScrollPosition.dispose (package:flutter/src/widgets/scroll_position.dart)
I/flutter ( 5478): #3      ScrollPositionWithSingleContext.dispose (package:flutter/src/widgets/scroll_position_with_single_context.dart:255:11)
I/flutter ( 5478): #4      ScrollableState.dispose (package:flutter/src/widgets/scrollable.dart:324:14)
I/flutter ( 5478): #5      StatefulElement.unmount (package:flutter/src/widgets/framework.dart:3821:12)
I/flutter ( 5478): #6      _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1697:13)
I/flutter ( 5478): #7      _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #8      ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #9      _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #10     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #11     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #12     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #13     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #14     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #15     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #16     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #17     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #18     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #19     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #20     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #21     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #22     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #23     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #24     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #25     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #26     MultiChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4742:16)
I/flutter ( 5478): #27     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #28     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #29     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #30     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #31     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #32     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #33     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #34     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #35     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #36     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #37     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #38     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
I/flutter ( 5478): #39     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #40     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #41     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #42     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #43     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #44     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
I/flutter ( 5478): #45     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #46     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #47     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #48     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #49     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #50     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #51     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #52     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #53     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #54     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #55     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #56     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #57     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #58     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #59     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #60     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #61     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #62     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #63     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #64     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #65     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #66     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #67     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #68     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #69     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #70     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #71     MultiChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4742:16)
I/flutter ( 5478): #72     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #73     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #74     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #75     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #76     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #77     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #78     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #79     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #80     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #81     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #82     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #83     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
I/flutter ( 5478): #84     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #85     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #86     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #87     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #88     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #89     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
I/flutter ( 5478): #90     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #91     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #92     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #93     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #94     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #95     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #96     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #97     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #98     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #99     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #100    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #101    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #102    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #103    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #104    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #105    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #106    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #107    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #108    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #109    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #110    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4642:14)
I/flutter ( 5478): #111    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #112    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #113    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #114    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #115    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #116    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #117    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #118    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1695:7)
I/flutter ( 5478): #119    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3676:14)
I/flutter ( 5478): #120    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1693:13)
I/flutter ( 5478): #121    ListIterable.forEach (dart:_internal/iterable.dart:39:13)
I/flutter ( 5478): #122    _InactiveElements._unmountAll (package:flutter/src/widgets/framework.dart:1706:25)
I/flutter ( 5478): #123    BuildOwner.finalizeTree.<anonymous closure> (package:flutter/src/widgets/framework.dart:2328:27)
I/flutter ( 5478): #124    BuildOwner.lockState (package:flutter/src/widgets/framework.dart:2160:15)
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_UP
I/flutter ( 5478): #125    BuildOwner.finalizeTree (package:flutter/src/widgets/framework.dart:2327:7)
I/flutter ( 5478): #126    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:628:18)
I/flutter ( 5478): #127    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:208:5)
I/flutter ( 5478): #128    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
I/flutter ( 5478): #129    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
I/flutter ( 5478): #130    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
I/flutter ( 5478): #131    _invoke (dart:ui/hooks.dart:120:13)
I/flutter ( 5478): #132    _drawFrame (dart:ui/hooks.dart:109:3)
I/flutter ( 5478): (elided 2 frames from class _AssertionError)
I/flutter ( 5478): ════════════════════════════════════════════════════════════════════════════════════════════════════
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_UP
I/flutter ( 5478): Another exception was thrown: 'package:flutter/src/widgets/scroll_position.dart': Failed assertion: line 657 pos 12: 'pixels != null': is not true.
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_UP
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_UP
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_UP
I/flutter ( 5478): Another exception was thrown: 'package:flutter/src/widgets/scroll_position.dart': Failed assertion: line 657 pos 12: 'pixels != null': is not true.
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_UP
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_UP
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_UP
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_UP
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_UP
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_UP
I/flutter ( 5478): Another exception was thrown: 'package:flutter/src/widgets/scroll_position.dart': Failed assertion: line 657 pos 12: 'pixels != null': is not true.
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_UP
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_UP
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_UP
I/ViewRootImpl( 5478): ViewRoot's KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x48, repeatCount=0, eventTime=250143550, downTime=250143550, deviceId=-1, source=0x101 } to com.android.internal.policy.impl.PhoneWindow$DecorView{25d05e4b V.E..... R.....I. 0,0-1080,1920}
I/ViewRootImpl( 5478): ViewRoot's KeyEvent { action=ACTION_UP, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x48, repeatCount=0, eventTime=250143627, downTime=250143550, deviceId=-1, source=0x101 } to com.android.internal.policy.impl.PhoneWindow$DecorView{25d05e4b V.E..... R.....I. 0,0-1080,1920}
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl( 5478): ViewRoot's Touch Event : ACTION_UP
I/flutter ( 5478): Another exception was thrown: 'package:flutter/src/rendering/object.dart': Failed assertion: line 2775 pos 14: '_debugUltimatePreviousSiblingOf(after, equals: _firstChild)': is not true.
I/flutter ( 5478): Another exception was thrown: 'package:flutter/src/rendering/object.dart': Failed assertion: line 2775 pos 14: '_debugUltimatePreviousSiblingOf(after, equals: _firstChild)': is not true.
I/flutter ( 5478): Another exception was thrown: 'package:flutter/src/rendering/object.dart': Failed assertion: line 2775 pos 14: '_debugUltimatePreviousSiblingOf(after, equals: _firstChild)': is not true.
I/flutter ( 5478): Another exception was thrown: 'package:flutter/src/rendering/object.dart': Failed assertion: line 2775 pos 14: '_debugUltimatePreviousSiblingOf(after, equals: _firstChild)': is not true.
I/flutter ( 5478): Another exception was thrown: 'package:flutter/src/widgets/framework.dart': Failed assertion: line 3497 pos 14: 'owner._debugCurrentBuildTarget == this': is not true.
I/flutter ( 5478): Another exception was thrown: 'package:flutter/src/widgets/framework.dart': Failed assertion: line 3497 pos 14: 'owner._debugCurrentBuildTarget == this': is not true.
I/flutter ( 5478): Another exception was thrown: 'package:flutter/src/widgets/framework.dart': Failed assertion: line 3497 pos 14: 'owner._debugCurrentBuildTarget == this': is not true.
I/flutter ( 5478): Another exception was thrown: 'package:flutter/src/widgets/framework.dart': Failed assertion: line 3497 pos 14: 'owner._debugCurrentBuildTarget == this': is not true.
I/flutter ( 5478): Another exception was thrown: 'package:flutter/src/widgets/framework.dart': Failed assertion: line 3497 pos 14: 'owner._debugCurrentBuildTarget == this': is not true.
I/flutter ( 5478): Another exception was thrown: 'package:flutter/src/widgets/framework.dart': Failed assertion: line 3497 pos 14: 'owner._debugCurrentBuildTarget == this': is not true.
I/flutter ( 5478): Another exception was thrown: 'package:flutter/src/widgets/framework.dart': Failed assertion: line 3497 pos 14: 'owner._debugCurrentBuildTarget == this': is not true.
I/flutter ( 5478): Another exception was thrown: 'package:flutter/src/widgets/framework.dart': Failed assertion: line 3497 pos 14: 'owner._debugCurrentBuildTarget == this': is not true.
I/flutter ( 5478): Another exception was thrown: 'package:flutter/src/widgets/framework.dart': Failed assertion: line 3497 pos 14: 'owner._debugCurrentBuildTarget == this': is not true.
I/flutter ( 5478): Another exception was thrown: The _ScaffoldLayout custom multichild layout delegate forgot to lay out the following children:

@sahil311289
Copy link
Author

sahil311289 commented Jun 27, 2018

/Users/sahil/flutterDevelopment/flutter/bin/flutter --no-color doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.13.5 17F77, locale en-IN)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.0-rc1)
    ✗ Android license status unknown.
[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
[✓] Android Studio (version 3.1)
[✓] IntelliJ IDEA Community Edition (version 2018.1.5)
[✓] VS Code (version 1.23.1)
[✓] Connected devices (1 available)

! Doctor found issues in 1 category.

@sahil311289
Copy link
Author

sahil311289 commented Jun 27, 2018

import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
import 'bottom_navigation.dart';
import 'theme.dart';
import 'register.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'GabHub',
      theme: defaultTargetPlatform == TargetPlatform.android ? tealTheme
          : iOSTheme,
      home: new BottomNavBar(),
    );
  }
}

@sahil311289
Copy link
Author

sahil311289 commented Jun 27, 2018

import 'package:flutter/material.dart';
import 'live_chat_tab_base.dart';
import 'posts_tab_base.dart';
import 'events_tab_base.dart';
import 'universities_tab_base.dart';
import 'notifications_tab_base.dart';
import 'profile_tab_base.dart';

class BottomNavBar extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      body: new BottomNav(),
    );
  }
}

class BottomNav extends StatefulWidget {
  @override
  _State createState() => _State();
}

class _State extends State<BottomNav> with SingleTickerProviderStateMixin {
  TabController bottomNavTabController;

  @override
  void initState() {
    super.initState();
    bottomNavTabController = new TabController(length: 6, vsync: this);
  }

  @override
  void dispose() {
    bottomNavTabController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      bottomNavigationBar: new Material(
        color: Theme.of(context).platform == TargetPlatform.android
            ? Theme.of(context).primaryColor
            : Theme.of(context).primaryColor.withOpacity(0.7),
        child: new TabBar(
          indicatorColor: Theme.of(context).accentColor,
          controller: bottomNavTabController,
          tabs: <Widget>[
            new Tab(
              icon: new Icon(Icons.edit, color: Theme.of(context).splashColor),
            ),
            new Tab(
              icon: new Icon(Icons.question_answer,
                  color: Theme.of(context).splashColor),
            ),
            new Tab(
              icon: new Icon(Icons.event_note,
                  color: Theme.of(context).splashColor),
            ),
            new Tab(
              icon: new Icon(Icons.account_balance,
                  color: Theme.of(context).splashColor),
            ),
            new Tab(
              icon: new Icon(Icons.notifications_active,
                  color: Theme.of(context).splashColor),
            ),
            new Tab(
              icon:
                  new Icon(Icons.person, color: Theme.of(context).splashColor),
            ),
          ],
        ),
      ),
      body: new TabBarView(
        children: <Widget>[
          new LiveChatTabBase(),
          new PostsTabBase(),
          new EventsTabBase("Events"),
          new UniversitiesTabBase("Universities"),
          new NotificationsTabBase("Notifications"),
          new ProfileTabBase("Profile"),
        ],
        controller: bottomNavTabController,
      ),
    );
  }
}

@sahil311289
Copy link
Author

sahil311289 commented Jun 27, 2018

import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'dart:math';
import 'package:cloud_firestore/cloud_firestore.dart';

const jsonCodec = const JsonCodec();

class LiveChatTabBase extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      body: new ChatScreen(),
    );
  }
}

class ChatScreen extends StatefulWidget {
  @override
  State createState() => new ChatScreenState();
}

class ChatScreenState extends State<ChatScreen> with TickerProviderStateMixin {
  final List<ChatMessage> _messages = <ChatMessage>[];
  final TextEditingController _textController = new TextEditingController();
  bool _isComposing = false;

  @override
  void dispose() {
    for (ChatMessage message in _messages)
      message.animationController.dispose();
    super.dispose();
  }

  Widget _buildTextComposer() {
    return new IconTheme(
      data: new IconThemeData(
        color: Theme.of(context).accentColor,
      ),
      child: new Column(
        mainAxisSize: MainAxisSize.max,
        mainAxisAlignment: MainAxisAlignment.end,
        children: <Widget>[
          new Row(
            children: <Widget>[
              new Container(
                margin: new EdgeInsets.only(
                  left: 5.0,
                ),
                child: new IconButton(
                  icon: new Icon(
                    Icons.add_circle,
                    color: Colors.black87,
                    size: 28.0,
                  ),
                  onPressed: () => _handleAddContent(),
                ),
              ),
              new Flexible(
                child: Padding(
                  padding: new EdgeInsets.only(
                    left: 5.0,
                  ),
                  child: new TextField(
                    controller: _textController,
                    maxLines: null,
//                    maxLength: 2000,
                    onChanged: (String text) {
                      setState(() {
                        _isComposing = text.replaceAll(" ", "").length > 0;
                      });
                    },
                    decoration: new InputDecoration.collapsed(
                      hintText: "Write a message",
                      hintStyle: new TextStyle(
                        color: Colors.black87,
                      ),
                    ),
                    style: new TextStyle(
                      color: Colors.black87,
                      fontSize: 17.0,
                    ),
//                    onChanged: () => _valueChanged(_textController.text),
                  ),
                ),
              ),
              new Container(
                margin: new EdgeInsets.only(
                  right: 5.0,
                ),
                child: _isComposing
                    ? Theme.of(context).platform == TargetPlatform.android
                        ? new IconButton(
                            icon: new Icon(
                              Icons.send,
                              color: Colors.black87,
                              size: 28.0,
                            ),
                            onPressed: () =>
                                _handleSubmitted(_textController.text),
                          )
                        : new CupertinoButton(
                            child: new Text('Send'),
                            onPressed: () =>
                                _handleSubmitted(_textController.text),
                          )
                    : new IconButton(
                        icon: new Icon(
                          Icons.keyboard_voice,
                          color: Colors.black87,
                          size: 28.0,
                        ),
                        onPressed: () => _handleVoiceInput(),
                      ),
              ),
            ],
          ),
        ],
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      backgroundColor: Theme.of(context).backgroundColor,
      appBar: new AppBar(
        backgroundColor: Theme.of(context).primaryColor,
        title: new Text(
          'Live chat',
          style: new TextStyle(color: Theme.of(context).hintColor),
        ),
        elevation:
            Theme.of(context).platform == TargetPlatform.android ? 4.0 : 0.0,
      ),
      body: new Container(
          child: new Column(
            children: <Widget>[
              new Flexible(
                child:
//                new ListView.builder(
//                  padding: new EdgeInsets.all(8.0),
//                  reverse: true,
//                  itemBuilder: (_, int index) => _messages[index],
//                  itemCount: _messages.length,
//                ),

                    new StreamBuilder(
                  stream:
                      Firestore.instance.collection('live_chat').snapshots(),
                  builder: (context, snapshot) {
                    if (!snapshot.hasData) return const Text('Loading...');

                    return new ListView.builder(
                      itemCount: snapshot.data.documents.length,
                      padding: const EdgeInsets.all(8.0),
                      reverse: true,
                      itemExtent: 55.0,
                      itemBuilder: (context, index) {
                        DocumentSnapshot ds = snapshot.data.documents[index];
                        return new Text(
                          " ${ds['message']}",
                          style: TextStyle(color: Colors.white70),
                        );
                      },
                    );
                  },
                ),
              ),
              new Divider(
                height: 1.0,
              ),
              new Container(
                decoration: new BoxDecoration(
                  color: Theme.of(context).cardColor, //Colors.white70,
                ),
                child: _buildTextComposer(),
              ),
            ],
          ),
          decoration: Theme.of(context).platform == TargetPlatform.iOS
              ? new BoxDecoration(
                  border: new Border(
                    top: new BorderSide(color: Colors.grey[200]),
                  ),
                )
              : null),
    );
  }

  void _handleSubmitted(String text) {
    _textController.clear();
    setState(() {
      _isComposing = false;
    });

    // TODO: Change color to a color based on email id so that every person's color remains constant
    final String username = "sahilwad";
    List<int> ints = username.codeUnits;
    var range = new Random();

    ChatMessage message = new ChatMessage(
      text,
      ints[5] + ints[6],
      ints[2],
      ints[1] + ints[0],
      ints[3] + ints[4],
      new AnimationController(
        duration: new Duration(milliseconds: 400),
        vsync: this,
      ),
    );
    setState(() {
      _messages.insert(0, message);
    });
    message.animationController.forward();
  }

  _handleVoiceInput() {
    print('Voice input method');
  }

  _handleAddContent() {
    print('Add content clicked');
  }
}

class ChatMessage extends StatelessWidget {
  final String text;
  final int colorA;
  final int colorR;
  final int colorG;
  final int colorB;
  final AnimationController animationController;

  ChatMessage(this.text, this.colorA, this.colorR, this.colorG, this.colorB,
      this.animationController);

  @override
  Widget build(BuildContext context) {
    return new SizeTransition(
      sizeFactor: new CurvedAnimation(
        parent: animationController,
        curve: Curves.easeOut,
      ),
      axisAlignment: 0.0,
      child: new Container(
        margin: const EdgeInsets.symmetric(vertical: 7.0),
        child: new Row(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            new Container(
              margin: const EdgeInsets.only(
                right: 10.0,
              ),
              child: new Padding(
                padding: new EdgeInsets.only(top: 12.0),
                child: new CircleAvatar(
                  maxRadius: 13.0,
                  backgroundColor:
                      Color.fromARGB(colorA, colorR, colorG, colorB),
                ),
              ),
            ),
            new Expanded(
              child: new Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: <Widget>[
                  new Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: <Widget>[
                      new Padding(
                        padding: new EdgeInsets.only(
                          bottom: 4.0,
                          right: 35.0,
                        ),
                        child: new Text(
                          '25 June 2018, 4:11 am',
                          style: new TextStyle(
                            color: Theme.of(context).platform ==
                                    TargetPlatform.android
                                ? Colors.white70
                                : Colors.black54,
                            fontSize: 12.0,
                            letterSpacing: 0.6,
                          ),
                        ),
                      ),
                    ],
                  ),
                  new Container(
                    width: 300.0,
                    child: new Text(
                      text,
                      style: new TextStyle(
                        color:
                            Theme.of(context).platform == TargetPlatform.android
                                ? Colors.white
                                : Colors.black87,
                        letterSpacing: 0.4,
                      ),
                    ),
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}

@sahil311289
Copy link
Author

sahil311289 commented Jun 27, 2018

import 'package:flutter/material.dart';

class NotificationsTabBase extends StatelessWidget {
  final String title;

  NotificationsTabBase(this.title);

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      backgroundColor: Theme.of(context).backgroundColor,
      appBar: new AppBar(
        title: new Text(
          title,
          style: new TextStyle(
            color: Theme.of(context).hintColor,
          ),
        ),
        elevation:
            Theme.of(context).platform == TargetPlatform.android ? 4.0 : 0.0,
        backgroundColor: Theme.of(context).primaryColor,
      ),
      body: new Container(
          child: new Center(
            child: new Text(title),
          ),
          decoration: Theme.of(context).platform == TargetPlatform.iOS
              ? new BoxDecoration(
                  border: new Border(
                    top: new BorderSide(color: Colors.grey[200]),
                  ),
                )
              : null),
    );
  }
}

@sahil311289
Copy link
Author

sahil311289 commented Jun 27, 2018

  1. If I comment using the live_chat tab and click on notification tab, the code breaks!
  2. Typing in a TextField gets me only white space once the keyboard is up. I've seen threads for non-TabBar pages and they are still manageable but while in a TabBar, Android still gives you the option of Back icon which closes the keyboard so I was able to post content. While in iOS once the keyboard is up, I have white screen and nothing else to do since there is no back button.

Also, you may not be able to see but I have top level TabBar within Bottom TabBar on some tabs. So it's a complex structure. Please help!

As much as I wanted to keep the code private, I guess there is no other option. I have a private repo on GitHub.

@sahil311289
Copy link
Author

I'm now using BottomNavigationBar instead of TabBar for bottom navigation. That fixed one of the issues. The app doesn't crash while switching between tabs.

@ajinasokan
Copy link

@escamoteur Is this issue related to #11895?

@zoechi
Copy link
Contributor

zoechi commented Jul 12, 2018

@sahil311289 I hope it's fine with you if I close this as dup of #11895.
Please add a comment if you think differently.

@zoechi zoechi closed this as completed Jul 12, 2018
@s-limo
Copy link

s-limo commented Jul 12, 2018

Is #11895 really duplicate? I see exceptions are raised at different places. For me this issue is important as well so I am afraid that it could be lost and never fixed :)

P.S. My case is just Tabs in Tabs (I am not using BottomNavigationBar)

@zoechi
Copy link
Contributor

zoechi commented Jul 12, 2018

@s-limo no prob. I'll leave it open then.

@zoechi zoechi reopened this Jul 12, 2018
@timsneath
Copy link
Contributor

@sahil311289 I created https://github.com/timsneath/tabbar_exception to try and produce a repro based off your files. On the latest Flutter master builds, I get the following exception when I type in the live tab and then select the notifications tab:

I/flutter ( 6084): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter ( 6084): The following assertion was thrown building NotificationListener<KeepAliveNotification>:
I/flutter ( 6084): 'package:flutter/src/rendering/object.dart': Failed assertion: line 2805 pos 14:
I/flutter ( 6084): '_debugUltimatePreviousSiblingOf(after, equals: _firstChild)': is not true.

Different error to yours, so could you confirm that this is the issue you're hitting, or help me adapt to a more accurate repro?

@ajinasokan
Copy link

@timsneath, I will summarise two issues related to TabBarView we have experienced. One happens when you have a nested TabBarView and second is when you have a TextField in focus in one of the tab pages. In the app we are building we have both scenarios. @sahil311289 had the TextField issue. I believe he fixed the issue by using Stack instead of TabBarView along with the BottomNavigation as implemented in the Gallery app.

Stack-BottomNavigation combo is fine for simple child widgets. But if the tab pages have more heavy widgets then it might consume more memory because Stack is rendering all children. On the other hand I believe TabBarView has some optimization which removes the pages that is not displayed in the view port. I guess this optimization is the reason for these exceptions as it conflicts with the focus keep alive of the text field and scroll position of nested tab.

I have posted gists to reproduce the issue below. I have also added the complete stack trace in the gist.

This gist reproduces nested TabBarView issue. There is a TabBarView for the bottom navigation with 4 children. And there is another TabBarView inside the second tab page. If you navigate from 1st to 3rd or 4th without visiting the second page it gives the following exception.

flutter: The following assertion was thrown while finalizing the widget tree:
flutter: 'package:flutter/src/widgets/scroll_position.dart': Failed assertion: line 658 pos 12: 'pixels !=
flutter: null': is not true.

This gist reproduces the focused TextField issue. There is a TabBarView for the bottom navigation with 4 children. In the first page, I have added a TextField. If you focus the text field and move to the 4th page below exception happens.

flutter: The following assertion was thrown building NotificationListener<KeepAliveNotification>:
flutter: 'package:flutter/src/rendering/object.dart': Failed assertion: line 2811 pos 14:
flutter: '_debugUltimatePreviousSiblingOf(after, equals: _firstChild)': is not true.

@apat183
Copy link

apat183 commented Jul 15, 2018

I was getting same issue, but have a temp fix (really not idea fix) which is to just take focus off during build.

flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following assertion was thrown while finalizing the widget tree:
flutter: 'package:flutter/src/widgets/scroll_position.dart': Failed assertion: line 657 pos 12: 'pixels !=
flutter: null': is not true.

Temp fix:

  1. create focus node in state, one for each input field:
final FocusNode urlFocus = FocusNode();
final FocusNode apiFocus = FocusNode();
  1. create function to clear all focus nodes:
void unFocusAll() {
    urlFocus.unfocus();
    apiFocus.unfocus();
  }
  1. during build, call function:
  ....
  @override
  Widget build(BuildContext context) {
    unFocusAll();
    return Scaffold(
  .....
  1. put focus node on each textformfield:
new TextFormField(
                 .....
                  focusNode: urlFocus,
                ),
....

@SteveAlexander
Copy link

SteveAlexander commented Aug 23, 2018

In ScrollPosition.dispose(), there is an assert(pixels != null) — which is the immediate cause of the crash I'm seeing when using nested TabBarViews.

It's not clear to my why it's important that pixels not be null when disposing a ScrollPosition. And unfortunately, the assert doesn't have a message to explain the rationale.

  @override
  void dispose() {
    assert(pixels != null);
    activity?.dispose(); // it will be null if it got absorbed by another ScrollPosition
    _activity = null;
    super.dispose();
  }

If I remove the assert, and use my app, I don't see any issues arising.

Is this assert necessary and correct? Is a fix (at least to the nested TabBarView aspect of this issue) to simply remove this assert?

@Djafox
Copy link

Djafox commented Aug 27, 2018

Got the exactly same error. But only appear when i have more than 4 tabs...

@andrescr94
Copy link

@apat183 if I try your fix then the textField wont let me input text

@apat183
Copy link

apat183 commented Aug 27, 2018

@andrescr94 you might need to use TextEditingControllers but i wouldn't use my temp solution anymore. I ended up moving to a move permanent solution of navigating to form in new page rather then in tab page and everything working fine now.

@HerrNiklasRaab
Copy link

Any updates on this issue, it is also occuring on my app, do you need code examples or something else?

@zoechi zoechi added this to the Goals milestone Dec 7, 2018
@vijaykanta
Copy link

This happens to me when I use an ExpandedTile widget and have gridview inside each tile. Both grid and tile are growable. Each grid view taps to open a dialog with a text field.

I/flutter (11555): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter (11555): The following assertion was thrown while finalizing the widget tree:
I/flutter (11555): 'package:flutter/src/widgets/scroll_position.dart': Failed assertion: line 683 pos 12: 'pixels !=
I/flutter (11555): null': is not true.
I/flutter (11555): 
I/flutter (11555): Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter (11555): more information in this error message to help you determine and fix the underlying cause.
I/flutter (11555): In either case, please report this assertion by filing a bug on GitHub:
I/flutter (11555):   https://github.com/flutter/flutter/issues/new?template=BUG.md
I/flutter (11555): 
I/flutter (11555): When the exception was thrown, this was the stack:
I/flutter (11555): #2      ScrollPosition.dispose (package:flutter/src/widgets/scroll_position.dart:683:12)
I/flutter (11555): #3      ScrollPositionWithSingleContext.dispose (package:flutter/src/widgets/scroll_position_with_single_context.dart:255:11)
I/flutter (11555): #4      ScrollableState.dispose (package:flutter/src/widgets/scrollable.dart:343:14)
I/flutter (11555): #5      StatefulElement.unmount (package:flutter/src/widgets/framework.dart:3900:12)
I/flutter (11555): #6      _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1709:13)
I/flutter (11555): #7      _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1707:7)
I/flutter (11555): #8      ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
I/flutter (11555): #9      _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1705:13)
I/flutter (11555): #10     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1707:7)
I/flutter (11555): #11     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
I/flutter (11555): #12     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1705:13)
I/flutter (11555): #13     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1707:7)
I/flutter (11555): #14     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
I/flutter (11555): #15     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1705:13)
I/flutter (11555): #16     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1707:7)
I/flutter (11555): #17     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
I/flutter (11555): #18     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1705:13)
I/flutter (11555): #19     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1707:7)
I/flutter (11555): #20     MultiChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4948:16)
I/flutter (11555): #21     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1705:13)
I/flutter (11555): #22     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1707:7)
I/flutter (11555): #23     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
I/flutter (11555): #24     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1705:13)
I/flutter (11555): #25     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1707:7)
I/flutter (11555): #26     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
I/flutter (11555): #27     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1705:13)
I/flutter (11555): #28     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1707:7)
I/flutter (11555): #29     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
I/flutter (11555): #30     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1705:13)
I/flutter (11555): #31     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1707:7)
I/flutter (11555): #32     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4848:14)
I/flutter (11555): #33     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1705:13)
I/flutter (11555): #34     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1707:7)
I/flutter (11555): #35     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
I/flutter (11555): #36     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1705:13)
I/flutter (11555): #37     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1707:7)
I/flutter (11555): #38     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4848:14)
I/flutter (11555): #39     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1705:13)
I/flutter (11555): #40     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1707:7)
I/flutter (11555): #41     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
I/flutter (11555): #42     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1705:13)
I/flutter (11555): #43     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1707:7)
I/flutter (11555): #44     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
I/flutter (11555): #45     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1705:13)
I/flutter (11555): #46     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1707:7)
I/flutter (11555): #47     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
I/flutter (11555): #48     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1705:13)
I/flutter (11555): #49     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1707:7)
I/flutter (11555): #50     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
I/flutter (11555): #51     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1705:13)
I/flutter (11555): #52     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1707:7)
I/flutter (11555): #53     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
I/flutter (11555): #54     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1705:13)
I/flutter (11555): #55     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1707:7)
I/flutter (11555): #56     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
I/flutter (11555): #57     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1705:13)
I/flutter (11555): #58     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1707:7)
I/flutter (11555): #59     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
I/flutter (11555): #60     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1705:13)
I/flutter (11555): #61     ListIterable.forEach (dart:_internal/iterable.dart:39:13)
I/flutter (11555): #62     _InactiveElements._unmountAll (package:flutter/src/widgets/framework.dart:1718:25)
I/flutter (11555): #63     BuildOwner.finalizeTree.<anonymous closure> (package:flutter/src/widgets/framework.dart:2372:27)
I/flutter (11555): #64     BuildOwner.lockState (package:flutter/src/widgets/framework.dart:2204:15)
I/flutter (11555): #65     BuildOwner.finalizeTree (package:flutter/src/widgets/framework.dart:2371:7)
I/flutter (11555): #66     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:678:18)
I/flutter (11555): #67     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:219:5)
I/flutter (11555): #68     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
I/flutter (11555): #69     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
I/flutter (11555): #70     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:751:7)
I/flutter (11555): #72     _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
I/flutter (11555): #73     _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
I/flutter (11555): #74     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
I/flutter (11555): (elided 3 frames from class _AssertionError and package dart:async)
I/flutter (11555): ════════════════════════════════════════════════════════════════════════════════════════════════════
D/libGLESv2(11555): STS_GLApi : DTS, ODTC are not allowed for Package : com.xx.xx.xx

@gildaswise
Copy link
Contributor

I'm having the same issue and the fix of removing the assert solved it for me, but I'm not using TabBars and the issue happens when either using Navigator.of(context).pop() or the automatically generated BackButton for the AppBar. The error doesn't happen when in release mode, only when in debug.

@vijaykanta
Copy link

vijaykanta commented Mar 22, 2019 via email

@MichaelDark
Copy link

MichaelDark commented Apr 4, 2019

Hi! The solution is just not to forget to dispose TabContoller:

@override
  void dispose() {
    _tabController.dispose();
    super.dispose();
  }

Check, please, if it is the right solution and tag people who faced this trouble in this issue
I think you know how to do it, @escamoteur
@shihaohong, could you have a look at this please?

@shihaohong
Copy link
Contributor

Hi @MichaelDark, I'm currently working through a different issue, but I'm planning to get to this this after I'm done. That could definitely be a solution for some, if they forget to dispose their TabControllers. I'll provide an update once I've had an opportunity to dive deeper into the issue.

@shihaohong
Copy link
Contributor

I looked at @ajinasokan's first gist and noticed that TabController was paired with BottomNavigationBar, and I'm not sure if they were meant to be used like that. I was able to get a running sample using BottomNavigationBar, while nesting the TabBarView.

However, I did create a reproducible sample that throws the exception with two TabBar/TabBarView/TabController combinations, and will be looking into it.

@MichaelDark
Copy link

MichaelDark commented Apr 5, 2019 via email

@mrgray
Copy link

mrgray commented Apr 27, 2019

I resolved it during debug by commenting out assert(pixels != null);, but that's not very kewl. I'm not using TabView or TabBar or TabController. I'm rendering conditional widgets with BottomAppBar and InkWell tabs.

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: crash Stack traces logged to the console f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.