horizontal_stepper_step 0.0.5 copy "horizontal_stepper_step: ^0.0.5" to clipboard
horizontal_stepper_step: ^0.0.5 copied to clipboard

This is a package for a simple horizontal stepper ,this can be used to show the progress in form of steps.

example/example.md

import 'package:flutter/material.dart';
import 'package:horizontal_stepper_step/horizontal_stepper.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

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

  void _incrementCounter() {
    setState(() {
      _counter < _totalSteps ? _counter++ : _counter--;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Padding(
        padding: const EdgeInsets.only(top: 40.0),
        child: HorizontalStepper(
          totalStep: _totalSteps,
          completedStep: _counter,
          selectedColor: Colors.red,
          backGroundColor: Colors.blue,
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}



10
likes
140
points
30
downloads

Publisher

unverified uploader

Weekly Downloads

This is a package for a simple horizontal stepper ,this can be used to show the progress in form of steps.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on horizontal_stepper_step