Giter VIP home page Giter VIP logo

cool-stepper-reloaded's People

Contributors

emrade avatar joaovvrodrigues avatar lcsvcn avatar raulmarquezinclan avatar

Watchers

 avatar  avatar

cool-stepper-reloaded's Issues

Cannot use 'Expanded' in Step content to fill available vertical space

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:

  • An image
  • A text prompt
  • A ListView.builder to present the list of options

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?

Unable to set step color when hasRoundedCorner is false

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):

  • Device: Pixel 2 API 30
  • Platform: mobile
  • Flutter version: 2.8.1
  • Package version 3.2.5

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

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.