lcsvcn / cool-stepper-reloaded Goto Github PK
View Code? Open in Web Editor NEWThis project forked from joaovvrodrigues/flutter-cool-stepper
License: MIT License
This project forked from joaovvrodrigues/flutter-cool-stepper
License: MIT License
I am using CoolStepper for a multi step data collection wizard
For the first step, I want to display a list of options. However, I want the options to be scrollable within the available space. To do th the 'Stepper' content has a column with three items:
To ensure that the list takes up all available vertical space I set an Expanded column entry around the ListView, as shown below...
Widget _buildChooseRoute(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 10.0),
child: Center(
child: Lottie.asset('asset/animation/choose-route.json',
height: 200)),
),
const Padding(
padding: EdgeInsets.only(bottom: 10.0),
child:
Text('Available routes:', style: TextStyle(fontSize: 14.0)),
),
Expanded(
flex: 1,
child: ListView.builder(
shrinkWrap: true,
itemCount: RouteDefinitionUtil.available().length,
itemBuilder: (context, index) {
return RadioListTile<int>(
controlAffinity: ListTileControlAffinity.trailing,
value: RouteDefinitionUtil.available()[index].id,
title: Text(RouteDefinitionUtil.available()[index].name,
style: const TextStyle(fontSize: 14.0)),
subtitle: Text(
RouteDefinitionUtil.available()[index].description,
style: const TextStyle(fontSize: 12.0)),
groupValue: _formModel.routeId,
onChanged: (value) {
if (value != null) {
setState(() {
_formModel.routeId = value;
});
}
},
);
}),
)
]),
);
}
List<CoolStep> _buildSteps(BuildContext context) {
List<CoolStep> aSteps = [];
aSteps.add(CoolStep(
title: 'Select journey route',
subtitle: 'Choose from one of 21 different routes',
content: _buildChooseRoute(context),
validation: () {
return null;
}));
However, when this is run I get
The following assertion was thrown during performLayout():
RenderFlex children have non-zero flex but incoming height constraints are unbounded.
When 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.
These two directives are mutually exclusive. If a parent is to shrink-wrap its child, the child cannot simultaneously expand to fit its parent.
Consider 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.
If 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
The affected RenderFlex is: RenderFlex#de429 relayoutBoundary=up13 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
parentData: offset=Offset(0.0, 0.0) (can use size)
constraints: BoxConstraints(0.0<=w<=395.4, 0.0<=h<=Infinity)
size: MISSING
direction: vertical
mainAxisAlignment: start
mainAxisSize: max
crossAxisAlignment: start
textDirection: ltr
verticalDirection: down
... child 1: RenderPadding#c6761 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
... parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
... constraints: MISSING
... size: MISSING
... padding: EdgeInsets(0.0, 0.0, 0.0, 10.0)
... textDirection: ltr
... child: RenderPositionedBox#2e295 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
... parentData: offset=Offset(0.0, 0.0)
... constraints: MISSING
... size: MISSING
... alignment: Alignment.center
... textDirection: ltr
... widthFactor: expand
... heightFactor: expand
... child: RenderRepaintBoundary#4a3b7 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
... needs compositing
... parentData: offset=Offset(0.0, 0.0)
... constraints: MISSING
... size: MISSING
... usefulness ratio: no metrics collected yet (never painted)
... child: RenderLottie#17c01 NEEDS-LAYOUT NEEDS-PAINT
... parentData: <none>
... constraints: MISSING
... size: MISSING
... composition: null
... height: 200.0
... alignment: Alignment.center
... child 2: RenderPadding#aeaae NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
... parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
... constraints: MISSING
... size: MISSING
... padding: EdgeInsets(0.0, 0.0, 0.0, 10.0)
... textDirection: ltr
... child: RenderParagraph#8c534 NEEDS-LAYOUT NEEDS-PAINT
... parentData: offset=Offset(0.0, 0.0)
... constraints: MISSING
... size: MISSING
... textAlign: start
... textDirection: ltr
... softWrap: wrapping at box width
... overflow: clip
... textScaleFactor: 1.1
... locale: en_US
... maxLines: unlimited
... text: TextSpan
... debugLabel: ((englishLike bodyMedium 2014).merge(blackMountainView bodyMedium)).merge(unknown)
... inherit: false
... color: Color(0xdd000000)
... family: Roboto
... size: 14.0
... weight: 400
... baseline: alphabetic
... decoration: TextDecoration.none
... "Available routes:"
... child 3: RenderRepaintBoundary#84622 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
... needs compositing
... parentData: offset=Offset(0.0, 0.0); flex=1; fit=FlexFit.tight
... constraints: MISSING
... size: MISSING
... usefulness ratio: no metrics collected yet (never painted)
... child: RenderCustomPaint#f2eb0 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
... parentData: <none>
... constraints: MISSING
... size: MISSING
... painter: null
... foregroundPainter: _GlowingOverscrollIndicatorPainter(_GlowController(color: Color(0xff2196f3), axis: vertical), _GlowController(color: Color(0xff2196f3), axis: vertical))
... child: RenderRepaintBoundary#500f5 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
... needs compositing
... parentData: <none>
... constraints: MISSING
... size: MISSING
... usefulness ratio: no metrics collected yet (never painted)
... child: _RenderScrollSemantics#08b55 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
... parentData: <none>
... constraints: MISSING
... semantic boundary
... size: MISSING
The creator information is set to: Column ← Padding ← Padding ← _SingleChildViewport ← IgnorePointer-[GlobalKey#56705] ← Semantics ← Listener ← _GestureSemantics ← RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#8afcb] ← Listener ← _ScrollableScope ← _ScrollSemantics-[GlobalKey#2f880] ← ⋯
The nearest ancestor providing an unbounded width constraint is: _RenderSingleChildViewport#69502 relayoutBoundary=up10 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
... needs compositing
... parentData: <none> (can use size)
... constraints: BoxConstraints(0.0<=w<=411.4, 0.0<=h<=621.8)
... size: MISSING
... offset: Offset(0.0, -0.0)
See also: https://flutter.dev/layout/
It seems that CoolStepper just doesn't like the idea of aligning step content to fill the availablel vertical space. Any suggestions?
Describe the bug
Although documentation is missing description about this, there is a stepColor option in CoolStepperConfig and it is only applied if hasRoundedCorner property of CoolStepper widget is enabled. I guess this should be applied regardless of rounding.
Expected behavior
If defined, stepColor should be applied regardless of hasRoundedCorner value.
Information (please complete the following information):
Additional context
It seems inconsistent that some of the options are located inside CoolStepperConfig class but others are still inside CoolStepper itslef, like contentPadding, showErrorSnackbar, isHeaderEnabled and hasRoundedCorner.
Open keyboard obscures content
If the page has a long list and there is an input field at the bottom of the page, then when the keyboard is opened, it closes the content and it is impossible to see the field where you need to enter data
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.