Skip to content

Instantly share code, notes, and snippets.

@horgag
Last active March 30, 2020 19:12
Show Gist options
  • Select an option

  • Save horgag/8ed4c8308a43078168565fff4e6298fa to your computer and use it in GitHub Desktop.

Select an option

Save horgag/8ed4c8308a43078168565fff4e6298fa to your computer and use it in GitHub Desktop.

Revisions

  1. horgag renamed this gist Mar 30, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. horgag revised this gist Mar 30, 2020. No changes.
  3. horgag created this gist Mar 30, 2020.
    70 changes: 70 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,70 @@
    import 'package:flutter/material.dart';


    void main(){
    runApp(MyApp());
    }

    class MyApp extends StatefulWidget {
    @override
    _MyAppState createState() => new _MyAppState();
    }

    class _MyAppState extends State<MyApp> {
    int _currentStep = 0;

    @override
    Widget build(BuildContext context) {
    return new MaterialApp(
    title: 'App',
    home: new Scaffold(
    appBar: new AppBar(title: new Text('App')),
    body: new Stepper(

    currentStep: _currentStep,
    onStepTapped: (int step) => setState(() => _currentStep = step),
    onStepContinue: _currentStep < 6 ? () => setState(() => _currentStep += 1) : null,
    onStepCancel: _currentStep > 0 ? () => setState(() => _currentStep -= 1) : null,
    steps: <Step>[
    new Step(
    title: new Text('Gender'),
    content: new Text('This is the first step.'),
    isActive: _currentStep >= 0,
    state: _currentStep >= 0 ? StepState.complete : StepState.disabled,
    ),
    new Step(
    title: new Text('Year of birth'),
    content: new Text('This is the second step.'),
    isActive: _currentStep >= 0,
    state: _currentStep >= 1 ? StepState.complete : StepState.disabled,
    ),
    new Step(
    title: new Text('Education'),
    content: new Text('This is the third step.'),
    isActive: _currentStep >= 0,
    state: _currentStep >= 2 ? StepState.complete : StepState.disabled,
    ),
    new Step(
    title: new Text('Marital Status'),
    content: new Text('This is the third step.'),
    isActive: _currentStep >= 0,
    state: _currentStep >= 3 ? StepState.complete : StepState.disabled,
    ),
    new Step(
    title: new Text('Living situation'),
    content: new Text('This is the third step.'),
    isActive: _currentStep >= 0,
    state: _currentStep >= 4 ? StepState.complete : StepState.disabled,
    ),
    new Step(
    title: new Text('Employment status'),
    content: new Text('This is the last step.'),
    isActive: _currentStep >= 0,
    state: _currentStep >= 5 ? StepState.complete : StepState.disabled,
    ),
    ],
    ),
    ),
    );
    }
    }