I am using Sliver widgets along with Tabs. I wanted to have the direct-select-flutter
but I am unable to achieve it.
class IntroductionSection extends StatelessWidget {
final Product product;
final TabController tabController;
const IntroductionSection({Key key, this.product, this.tabController})
: super(key: key);
@override
Widget build(BuildContext context) {
return SliverStickyHeader(
overlapsContent: true,
header: DirectSelectContainer(
child: Container(
color: Colors.white,
padding: EdgeInsets.all(8.0),
child: Column(children: <Widget>[
ListTile(
title: Row(
children: <Widget>[
Expanded(
child: Text(
"(MRP) ₹ ${this.product.price.toString()}",
style: TextStyle(
color: Colors.grey,
fontSize: 20,
decoration: TextDecoration.lineThrough),
),
),
Expanded(
child: Text(
"(Price) ₹ ${this.product.discountedPrice().toString()}",
style: TextStyle(
color: Colors.teal[400],
fontSize: 20,
),
),
)
],
),
),
Row(children: <Widget>[
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisSize: MainAxisSize.min,
verticalDirection: VerticalDirection.down,
children: <Widget>[
DirectSelectDropDown(
data: ['Small', 'Medium', 'Large'],
label: 'Size',
),
],
),
),
),
),
...
....
.....
While interacting with the widget, I am getting the below mentioned exceptions.
Restarted application in 2,804ms.
�[38;5;248m════════ Exception caught by rendering library ═════════════════════════════════�[39;49m
�[38;5;244mThe following assertion was thrown during performLayout():�[39;49m
RenderFlex children have non-zero flex but incoming height constraints are unbounded.
�[38;5;244mWhen a column is in a parent that does not provide a finite height constraint, for example if it is in a vertical scrollable, it will try to shrink-wrap its children along the vertical axis. Setting a flex on a child (e.g. using Expanded) indicates that the child is to expand to fill the remaining space in the vertical direction.�[39;49m
�[38;5;244mThese two directives are mutually exclusive. If a parent is to shrink-wrap its child, the child cannot simultaneously expand to fit its parent.�[39;49m
�[38;5;248mConsider setting mainAxisSize to MainAxisSize.min and using FlexFit.loose fits for the flexible children (using Flexible rather than Expanded). This will allow the flexible children to size themselves to less than the infinite remaining space they would otherwise be forced to take, and then will cause the RenderFlex to shrink-wrap the children rather than expanding to fit the maximum constraints provided by the parent.�[39;49m
�[38;5;244mIf this message did not help you determine the problem, consider using debugDumpRenderTree():
https://flutter.dev/debugging/#rendering-layer
http://api.flutter.dev/flutter/rendering/debugDumpRenderTree.html
�[39;49m�[38;5;244mThe affected RenderFlex is: RenderFlex#5b31c relayoutBoundary=up4 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE�[39;49m
�[38;5;244mparentData: <none> (can use size)�[39;49m
�[38;5;244mconstraints: BoxConstraints(0.0<=w<=411.4, 0.0<=h<=Infinity)�[39;49m
�[38;5;244msize: MISSING�[39;49m
�[38;5;244mdirection: vertical�[39;49m
�[38;5;244mmainAxisAlignment: start�[39;49m
�[38;5;244mmainAxisSize: max�[39;49m
�[38;5;244mcrossAxisAlignment: center�[39;49m
�[38;5;244mverticalDirection: down�[39;49m
�[38;5;244mchild 1: RenderStack#61660 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE�[39;49m
�[38;5;244mparentData: offset=Offset(0.0, 0.0); flex=1; fit=FlexFit.tight�[39;49m
�[38;5;244mconstraints: MISSING�[39;49m
�[38;5;244msize: MISSING�[39;49m
�[38;5;244malignment: AlignmentDirectional.topStart�[39;49m
�[38;5;244mtextDirection: ltr�[39;49m
�[38;5;244mfit: loose�[39;49m
�[38;5;244moverflow: clip�[39;49m
�[38;5;244mchild 1: RenderDecoratedBox#ca8c3 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE�[39;49m
�[38;5;244mparentData: not positioned; offset=Offset(0.0, 0.0)�[39;49m
�[38;5;244mconstraints: MISSING�[39;49m
�[38;5;244msize: MISSING�[39;49m
�[38;5;244mdecoration: BoxDecoration�[39;49m
�[38;5;244mcolor: Color(0xfffafafa)�[39;49m
�[38;5;244mconfiguration: ImageConfiguration(bundle: PlatformAssetBundle#3ac0b(), devicePixelRatio: 2.6, locale: en_US, textDirection: TextDirection.ltr, platform: android)�[39;49m
�[38;5;244mchild: RenderRepaintBoundary#7d2ea NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE�[39;49m
�[38;5;244mneeds compositing�[39;49m
�[38;5;244mparentData: <none>�[39;49m
�[38;5;244mconstraints: MISSING�[39;49m
�[38;5;244msize: MISSING�[39;49m
�[38;5;244musefulness ratio: no metrics collected yet (never painted)�[39;49m
�[38;5;244mchild: RenderCustomPaint#1a9f6 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE�[39;49m
�[38;5;244mparentData: <none>�[39;49m
�[38;5;244mconstraints: MISSING�[39;49m
�[38;5;244msize: MISSING�[39;49m
�[38;5;244mchild 2: RenderConstrainedBox#a9226 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE�[39;49m
�[38;5;244mparentData: top=424.0; right=0.0; left=0.0; height=56.0; offset=Offset(0.0, 0.0)�[39;49m
�[38;5;244mconstraints: MISSING�[39;49m
�[38;5;244msize: MISSING�[39;49m
�[38;5;244madditionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=56.0)�[39;49m
�[38;5;244mchild: RenderDecoratedBox#403fc NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE�[39;49m
�[38;5;244mparentData: <none>�[39;49m
�[38;5;244mconstraints: MISSING�[39;49m
�[38;5;244msize: MISSING�[39;49m
�[38;5;244mdecoration: BoxDecoration�[39;49m
�[38;5;244mborder: BorderDirectional(top: BorderSide(Color(0x1f000000), 1.0, BorderStyle.solid), bottom: BorderSide(Color(0x1f000000), 1.0, BorderStyle.solid))�[39;49m
�[38;5;244mconfiguration: ImageConfiguration(bundle: PlatformAssetBundle#3ac0b(), devicePixelRatio: 2.6, locale: en_US, textDirection: TextDirection.ltr, platform: android)�[39;49m
�[38;5;244mchild: RenderPadding#a81a6 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE�[39;49m
�[38;5;244mparentData: <none>�[39;49m
�[38;5;244mconstraints: MISSING�[39;49m
�[38;5;244msize: MISSING�[39;49m
�[38;5;244mpadding: EdgeInsets(0.0, 1.0, 0.0, 1.0)�[39;49m
�[38;5;244mtextDirection: ltr�[39;49m
�[38;5;244mThe creator information is set to: Column ← FadeTransition ← Visibility ← Stack ← DirectSelectContainer ← SliverStickyHeader ← IntroductionSection ← Viewport ← IgnorePointer-[GlobalKey#3588e] ← Semantics ← _PointerListener ← Listener ← ⋯�[39;49m
�[38;5;248mSee also: https://flutter.dev/layout/�[39;49m
�[38;5;244mIf none of the above helps enough to fix this problem, please don't hesitate to file a bug:
https://github.com/flutter/flutter/issues/new?template=BUG.md
�[39;49m�[38;5;244mUser-created ancestor of the error-causing widget was�[39;49m
�[38;5;248mDirectSelectContainer�[39;49m
�[38;5;244mWhen the exception was thrown, this was the stack�[39;49m
�[38;5;244m#0 RenderFlex.performLayout.<anonymous closure>�[39;49m
�[38;5;244m#1 RenderFlex.performLayout�[39;49m
�[38;5;244m#2 RenderObject.layout�[39;49m
�[38;5;244m#3 RenderProxyBoxMixin.performLayout�[39;49m
�[38;5;244m#4 RenderObject.layout�[39;49m
�[38;5;244m...�[39;49m
�[38;5;244mThe following RenderObject was being processed when the exception was fired: RenderFlex#5b31c relayoutBoundary=up4 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE�[39;49m
�[38;5;244mRenderObject: RenderFlex#5b31c relayoutBoundary=up4 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE�[39;49m
�[38;5;244mparentData: <none> (can use size)�[39;49m
�[38;5;244mconstraints: BoxConstraints(0.0<=w<=411.4, 0.0<=h<=Infinity)�[39;49m
�[38;5;244msize: MISSING�[39;49m
�[38;5;244mdirection: vertical�[39;49m
�[38;5;244mmainAxisAlignment: start�[39;49m
�[38;5;244mmainAxisSize: max�[39;49m
�[38;5;244mcrossAxisAlignment: center�[39;49m
�[38;5;244mverticalDirection: down�[39;49m
�[38;5;244mchild 1: RenderStack#61660 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE�[39;49m
�[38;5;244mparentData: offset=Offset(0.0, 0.0); flex=1; fit=FlexFit.tight�[39;49m
�[38;5;244mconstraints: MISSING�[39;49m
�[38;5;244msize: MISSING�[39;49m
�[38;5;244malignment: AlignmentDirectional.topStart�[39;49m
�[38;5;244mtextDirection: ltr�[39;49m
�[38;5;244mfit: loose�[39;49m
�[38;5;244moverflow: clip�[39;49m
�[38;5;244mchild 1: RenderDecoratedBox#ca8c3 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE�[39;49m
�[38;5;244mparentData: not positioned; offset=Offset(0.0, 0.0)�[39;49m
�[38;5;244mconstraints: MISSING�[39;49m
�[38;5;244msize: MISSING�[39;49m
�[38;5;244mdecoration: BoxDecoration�[39;49m
�[38;5;244mcolor: Color(0xfffafafa)�[39;49m
�[38;5;244mconfiguration: ImageConfiguration(bundle: PlatformAssetBundle#3ac0b(), devicePixelRatio: 2.6, locale: en_US, textDirection: TextDirection.ltr, platform: android)�[39;49m
�[38;5;244mchild: RenderRepaintBoundary#7d2ea NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE�[39;49m
�[38;5;244mneeds compositing�[39;49m
�[38;5;244mparentData: <none>�[39;49m
�[38;5;244mconstraints: MISSING�[39;49m
�[38;5;244msize: MISSING�[39;49m
�[38;5;244musefulness ratio: no metrics collected yet (never painted)�[39;49m
�[38;5;244mchild: RenderCustomPaint#1a9f6 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE�[39;49m
�[38;5;244mparentData: <none>�[39;49m
�[38;5;244mconstraints: MISSING�[39;49m
�[38;5;244msize: MISSING�[39;49m
�[38;5;244mchild 2: RenderConstrainedBox#a9226 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE�[39;49m
�[38;5;244mparentData: top=424.0; right=0.0; left=0.0; height=56.0; offset=Offset(0.0, 0.0)�[39;49m
�[38;5;244mconstraints: MISSING�[39;49m
�[38;5;244msize: MISSING�[39;49m
�[38;5;244madditionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=56.0)�[39;49m
�[38;5;244mchild: RenderDecoratedBox#403fc NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE�[39;49m
�[38;5;244mparentData: <none>�[39;49m
�[38;5;244mconstraints: MISSING�[39;49m
�[38;5;244msize: MISSING�[39;49m
�[38;5;244mdecoration: BoxDecoration�[39;49m
�[38;5;244mborder: BorderDirectional(top: BorderSide(Color(0x1f000000), 1.0, BorderStyle.solid), bottom: BorderSide(Color(0x1f000000), 1.0, BorderStyle.solid))�[39;49m
�[38;5;244mconfiguration: ImageConfiguration(bundle: PlatformAssetBundle#3ac0b(), devicePixelRatio: 2.6, locale: en_US, textDirection: TextDirection.ltr, platform: android)�[39;49m
�[38;5;244mchild: RenderPadding#a81a6 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE�[39;49m
�[38;5;244mparentData: <none>�[39;49m
�[38;5;244mconstraints: MISSING�[39;49m
�[38;5;244msize: MISSING�[39;49m
�[38;5;244mpadding: EdgeInsets(0.0, 1.0, 0.0, 1.0)�[39;49m
�[38;5;244mtextDirection: ltr�[39;49m
�[38;5;248m════════════════════════════════════════════════════════════════════════════════�[39;49m
�[38;5;248m════════ Exception caught by rendering library ═════════════════════════════════�[39;49m
RenderBox was not laid out: RenderFlex#5b31c relayoutBoundary=up4 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1681 pos 12: 'hasSize'
�[38;5;244mUser-created ancestor of the error-causing widget was�[39;49m
�[38;5;248mDirectSelectContainer�[39;49m
�[38;5;248m════════════════════════════════════════════════════════════════════════════════�[39;49m
�[38;5;248m════════ Exception caught by rendering library ═════════════════════════════════�[39;49m
RenderBox was not laid out: RenderAnimatedOpacity#77276 relayoutBoundary=up3 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1681 pos 12: 'hasSize'
�[38;5;244mUser-created ancestor of the error-causing widget was�[39;49m
�[38;5;248mDirectSelectContainer�[39;49m
�[38;5;248m════════════════════════════════════════════════════════════════════════════════�[39;49m
�[38;5;248m════════ Exception caught by rendering library ═════════════════════════════════�[39;49m
The method '>' was called on null.
Receiver: null
Tried calling: >(1e-10)
�[38;5;244mUser-created ancestor of the error-causing widget was�[39;49m
�[38;5;248mDirectSelectContainer�[39;49m
�[38;5;248m════════════════════════════════════════════════════════════════════════════════�[39;49m
�[38;5;248m════════ Exception caught by rendering library ═════════════════════════════════�[39;49m
The method '>' was called on null.
Receiver: null
Tried calling: >(1e-10)
�[38;5;244mUser-created ancestor of the error-causing widget was�[39;49m
�[38;5;248mDirectSelectContainer�[39;49m
�[38;5;248m════════════════════════════════════════════════════════════════════════════════�[39;49m
I/flutter (17086): NoSuchMethodError: The method 'toDouble' was called on null.
I/flutter (17086): Receiver: null
I/flutter (17086): Tried calling: toDouble()
�[38;5;248m════════ Exception caught by animation library ═════════════════════════════════�[39;49m
The method '>' was called on null.
Receiver: null
Tried calling: >(347.77678571428567)
�[38;5;248m════════════════════════════════════════════════════════════════════════════════�[39;49m
�[38;5;248m════════ Exception caught by animation library ═════════════════════════════════�[39;49m
The method '>' was called on null.
Receiver: null
Tried calling: >(347.77678571428567)
�[38;5;248m════════════════════════════════════════════════════════════════════════════════�[39;49m
�[38;5;248m════════ Exception caught by animation library ═════════════════════════════════�[39;49m
The method '>' was called on null.
Receiver: null
Tried calling: >(347.77678571428567)
�[38;5;248m════════════════════════════════════════════════════════════════════════════════�[39;49m
�[38;5;248m════════ Exception caught by animation library ═════════════════════════════════�[39;49m
The method '>' was called on null.
Receiver: null
Tried calling: >(347.77678571428567)
�[38;5;248m════════════════════════════════════════════════════════════════════════════════�[39;49m
�[38;5;248m════════ Exception caught by animation library ═════════════════════════════════�[39;49m
The method '>' was called on null.
Receiver: null
Tried calling: >(347.77678571428567)
�[38;5;248m════════════════════════════════════════════════════════════════════════════════�[39;49m
�[38;5;248m════════ Exception caught by animation library ═════════════════════════════════�[39;49m
The method '>' was called on null.
Receiver: null
Tried calling: >(347.77678571428567)
�[38;5;248m════════════════════════════════════════════════════════════════════════════════�[39;49m
I/chatty (17086): uid=10130(com.example.conjuror_app) Thread-2 identical 14 lines
I/flutter (17086): NoSuchMethodError: The method 'toDouble' was called on null.
I/flutter (17086): Receiver: null
I/flutter (17086): Tried calling: toDouble()
E/flutter (17086): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: NoSuchMethodError: The method '>' was called on null.
E/flutter (17086): Receiver: null
E/flutter (17086): Tried calling: >(347.77678571428567)
�[38;5;244mE/flutter (17086): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)�[39;49m
�[38;5;244mE/flutter (17086): #1 double.< (dart:core-patch/double.dart:88:18)�[39;49m
�[38;5;244mE/flutter (17086): #2 ScrollMetrics.outOfRange�[39;49m
�[38;5;244mE/flutter (17086): #3 ClampingScrollPhysics.createBallisticSimulation�[39;49m
�[38;5;244mE/flutter (17086): #4 ScrollPositionWithSingleContext.goBallistic�[39;49m
�[38;5;244mE/flutter (17086): #5 DrivenScrollActivity._end�[39;49m
�[38;5;244mE/flutter (17086): #6 _rootRun (dart:async/zone.dart:1120:38)�[39;49m
�[38;5;244mE/flutter (17086): #7 _CustomZone.run (dart:async/zone.dart:1021:19)�[39;49m
�[38;5;244mE/flutter (17086): #8 _FutureListener.handleWhenComplete (dart:async/future_impl.dart:161:18)�[39;49m
�[38;5;244mE/flutter (17086): #9 Future._propagateToListeners.handleWhenCompleteCallback (dart:async/future_impl.dart:648:39)�[39;49m
�[38;5;244mE/flutter (17086): #10 Future._propagateToListeners (dart:async/future_impl.dart:704:37)�[39;49m
�[38;5;244mE/flutter (17086): #11 Future._completeWithValue (dart:async/future_impl.dart:522:5)�[39;49m
�[38;5;244mE/flutter (17086): #12 Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:552:7)�[39;49m
�[38;5;244mE/flutter (17086): #13 _rootRun (dart:async/zone.dart:1124:13)�[39;49m
�[38;5;244mE/flutter (17086): #14 _CustomZone.run (dart:async/zone.dart:1021:19)�[39;49m
�[38;5;244mE/flutter (17086): #15 _CustomZone.runGuarded (dart:async/zone.dart:923:7)�[39;49m
�[38;5;244mE/flutter (17086): #16 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)�[39;49m
�[38;5;244mE/flutter (17086): #17 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)�[39;49m
�[38;5;244mE/flutter (17086): #18 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)�[39;49m
E/flutter (17086):
Please do let me know in case if you need more information.