stepper_complete 0.0.7 copy "stepper_complete: ^0.0.7" to clipboard
stepper_complete: ^0.0.7 copied to clipboard

StepperComplete: A customizable Flutter package for creating intuitive and responsive step-by-step wizards.

example/lib/main.dart

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

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

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  int currentStep = 0;
  final formKeys = List.generate(5, (index) => GlobalKey<FormState>());
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          appBar: AppBar(
            title: const Text('App de Passos'),
          ),
          body: StepperComplete(
            currentStep: currentStep,
            steps: List.generate(
              5,
              (index) => Step(
                title: Text('Step ${index + 1}'),
                content: Form(
                  key: formKeys[index],
                  child: SingleChildScrollView(
                    child: Column(
                      children: [
                        TextFormField(
                          validator: (value) {
                            if (value == null || value.isEmpty) {
                              return 'Please enter some text';
                            }
                            return null;
                          },
                        ),
                        TextFormField(
                          validator: (value) {
                            if (value == null || value.isEmpty) {
                              return 'Please enter some text';
                            }
                            return null;
                          },
                        ),
                      ],
                    ),
                  ),
                ),
              ),
            ),
            // onStepTapped: (step) {
            //   if (formKeys[currentStep].currentState!.validate()) {
            //     setState(() {
            //       currentStep = step;
            //     });
            //   }
            // },
            onStepContinue: () {
              setState(() {
                if (currentStep < 19) {
                  currentStep++;
                }
              });
            },
            onStepBack: () {
              setState(() {
                if (currentStep > 0) {
                  currentStep--;
                }
              });
            },
          )),
    );
  }
}
4
likes
0
points
23
downloads

Publisher

verified publisheraincrad.dev.br

Weekly Downloads

StepperComplete: A customizable Flutter package for creating intuitive and responsive step-by-step wizards.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on stepper_complete