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

Documentation request for Stepper Class #11789

Closed
chrislondon opened this issue Aug 25, 2017 · 18 comments
Closed

Documentation request for Stepper Class #11789

chrislondon opened this issue Aug 25, 2017 · 18 comments
Labels
d: api docs Issues with https://api.flutter.dev/ f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Comments

@chrislondon
Copy link

At the moment I'm blindly making a stepper and experimenting with the settings. Documentation would greatly speed up my efforts.

@eseidelGoogle
Copy link
Contributor

eseidelGoogle commented Aug 25, 2017

@Hixie Hixie added the d: api docs Issues with https://api.flutter.dev/ label Aug 25, 2017
@Hixie Hixie added this to the 4: Next milestone milestone Aug 25, 2017
@Hixie
Copy link
Contributor

Hixie commented Aug 25, 2017

@chrislondon If you have specific questions you'd like answered which the docs don't currently answer please list them explicitly here, then when we add docs we'll make sure to explicit answer the specific questions you list here (along with anything else we can think of). It's often really hard to write good docs without a prompt. :-)

@chrislondon
Copy link
Author

chrislondon commented Aug 25, 2017

I'll probably post more comments as I go. Here were the first snags I ran into:

  1. How do I implement the "Mobile dot steps" listed in the Material design guide?

  2. Why do I have to set isActive? Seems like that should just be automatic since the stepper automatically displays the content based on the currentStep.

  3. How do I implement onStepContinue?

I did get this working but I was trying things like:

    onStepContinue: () {
        setState(() {
            _currentStep++;
        });
    }

But _currentStep is final so I ended up having to do:

    Stepper _stepper;

    Stepper buildStepper(int step) {
        _stepper = new Stepper(
            currentStep: step,
            ...
            onStepContinue: () {
                setState(() {
                    buildStepper(step + 1);
                });
            };

        return _stepper;
    }

    Widget build(BuildContext context) {
        return buildStepper(0);
    }

@nisrulz
Copy link

nisrulz commented Aug 26, 2017

@eseidelGoogle I actually didn't have the example for Stepper. But it was easy to implement, I saw this and update my flutter-examples repo

@chrislondon this example should help you out with managing the state of the Stepper Widget, have a look at code here

https://github.com/nisrulz/flutter-examples/blob/master/using_stepper/lib/main.dart

I have added comments in there, but if you have any questions please let me know 😺

@sethladd
Copy link
Contributor

There are many Steppers defined in https://material.io/guidelines/components/steppers.html, we could specifically document which Stepper(s) is implemented by https://docs.flutter.io/flutter/material/Stepper-class.html

I'd also love a screenshot for https://docs.flutter.io/flutter/material/Stepper-class.html to help me understand what kind of stepper this is.

For example, do we show dots? Progress bar?

@nisrulz
Copy link

nisrulz commented Oct 11, 2017

@sethladd I have working gifs in my example app here, showing 2 possible ones as of now.

@sethladd
Copy link
Contributor

Thanks! Would you be willing to send a PR to update and clarify the API docs for https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/material/stepper.dart#L128 ?

@chrislondon
Copy link
Author

I would love the following Material specs to be implemented:
screenshot from 2017-10-11 15-34-15
screenshot from 2017-10-11 15-34-26
screenshot from 2017-10-11 15-34-37

@sethladd
Copy link
Contributor

@chrislondon apologies, but would you be willing to comment on #12500 or open a new issue specifically for "stepper with progress bar" ?

This issue is about updating the API docs in Stepper to better clarify what kinds of steppers we currently implement.

Sorry for the confusion here... we thank you for your feedback!

@nisrulz
Copy link

nisrulz commented Oct 11, 2017

@sethladd I could do that sometime towards the EOD. Can't promise though 😅

@sethladd
Copy link
Contributor

Today or tomorrow.. either works :) Thanks!!

@nisrulz
Copy link

nisrulz commented Oct 12, 2017

@sethladd Just wanted to clarify, the only update I need to be sending as a PR has to be dartdoc comment mentioning the kinds of steppers flutter currently implements, at the line you earlier linked?

Since there isn't any example for Stepper, should I add that too here? or just add a link to my repository in the readme (that way I wouldn't be changing anything in flutter repo except the readme.md and examples repo would be decoupled from flutter project, just a suggestion). Let me know what you think.

Thank you

@sethladd
Copy link
Contributor

@nisrulz at a minimum, please update the API docs for the Stepper class to be specific about which kinds of steppers one can use.

A bonus would be a small snippet of code in the API docs for the Stepper class, which shows how to use Stepper class for the various configurations/types.

All this would be in a single PR.

Other PRs can add examples and links, perhaps to our Sample catalog.

Thank you!

@ghost
Copy link

ghost commented Jul 30, 2018

@nisrulz I got a clue about how to implement stepper, thanks to your example. However, I tried putting a TextField widget in the content of a step. The problem I am facing is that if I enter some text in the widget, and traverse to the next step, the text entered in the TextField at the previous Step is gone. This happens with StepperType.horizontal and not vertical. Can you help me out here. I have opened a separate issue #19835 . It would be great if we can figure this out soon.

@ghost
Copy link

ghost commented Aug 16, 2018

### I was able to implement horizontal mode for stepper, and making it look good after customizing the widget. Here is a screenshot, I added some icons to display stepper state, instead of building circle, or triangle.

screenshot_2018-08-16-15-01-49-093_com example stepper

@lukasgit
Copy link

@Shantanu-Kotambkar do you have example code for how you implemented horizontal mode for stepper? Thanks!

@zoechi zoechi added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Dec 10, 2018
@TahaTesser
Copy link
Member

Looks like Stepper Class documentation exist now https://api.flutter.dev/flutter/material/Stepper-class.html

There are definitely improvements needed in the doc but it does exist so i am closing this issue and for improvements, please created new issue

@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 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
d: api docs Issues with https://api.flutter.dev/ f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
Widget Documentation
Awaiting triage
Development

No branches or pull requests

8 participants