progress_stepper 0.1.0 copy "progress_stepper: ^0.1.0" to clipboard
progress_stepper: ^0.1.0 copied to clipboard

outdated

Flutter package for showing custom progress stepper. You can use either the built in shapes (Arrow or Chevron) or can specify own shapes, using the builder.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:progress_stepper/progress_stepper.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Progress Stepper Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Progress Stepper'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementStepper() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            ProgressStepper(
              width: 300,
              height: 10,
              padding: 2,
              currentStep: _counter,
              onClick: (index) {
                setState(() {
                  _counter = index;
                });
              },
            ),
            SizedBox(
              height: 10,
            ),
            ProgressStepper(
              width: 200,
              height: 25,
              stepCount: 3,
              builder: (index) {
                double widthOfStep = 200 / 3;
                if (index == 1) {
                  return ProgressStepWithArrow(
                    width: widthOfStep,
                    defaultColor: Colors.red,
                    progressColor: Colors.green,
                    wasCompleted: _counter >= index,
                  );
                }
                  return ProgressStepWithChevron(
                    width: widthOfStep,
                    defaultColor: Colors.red,
                    progressColor: Colors.green,
                    wasCompleted: _counter >= index,
                  );
              },
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementStepper,
        tooltip: 'Increment Stepper',
        child: Icon(Icons.plus_one),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
63
likes
0
points
1.34k
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter package for showing custom progress stepper. You can use either the built in shapes (Arrow or Chevron) or can specify own shapes, using the builder.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on progress_stepper