smart_stepper 0.0.5
smart_stepper: ^0.0.5 copied to clipboard
A simple smart stepper package
import 'package:flutter/material.dart';
import 'package:smart_stepper/smart_stepper.dart';
class SmartStepperExample extends StatefulWidget {
const SmartStepperExample({super.key});
@override
State<SmartStepperExample> createState() => _SmartStepperExampleState();
}
class _SmartStepperExampleState extends State<SmartStepperExample> {
int currentStep = 3;
int totalSteps = 4;
int currentStep1 = 2;
int currentStep2 = 1;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.blue,
title: const Text(
"Smart Stepper Example",
style: TextStyle(color: Colors.white),
),
),
body: Column(
children: [
const SizedBox(height: 12),
const Text(
"Example",
style: TextStyle(color: Colors.black, fontSize: 22),
),
SmartStepper(
currentStep: currentStep,
totalSteps: totalSteps,
onStepperTap: (value) {
setState(() {
currentStep = value;
});
},
),
const SizedBox(height: 24),
const Text(
"Example - 1",
style: TextStyle(color: Colors.black, fontSize: 22),
),
SmartStepper(
currentStep: currentStep1,
totalSteps: totalSteps,
completeStepColor: Colors.orange,
currentStepColor: Colors.red,
inactiveStepColor: Colors.purple,
borderWidth: 0,
onStepperTap: (value) {
setState(() {
currentStep1 = value;
});
},
),
const SizedBox(height: 24),
const Text(
"Example - 2",
style: TextStyle(color: Colors.black, fontSize: 22),
),
SmartStepper(
currentStep: currentStep2,
totalSteps: totalSteps,
isTextShowing: false,
borderWidth: 0,
onStepperTap: (value) {
setState(() {
currentStep2 = value;
});
},
),
const SizedBox(height: 24),
const Text(
"Example - 3",
style: TextStyle(color: Colors.black, fontSize: 22),
),
SmartStepper(
currentStep: currentStep1,
totalSteps: totalSteps,
completeStepColor: Colors.orange,
currentStepColor: Colors.red,
inactiveStepColor: Colors.purple,
completeBorderColor: Colors.yellow,
currentBorderColor: Colors.green,
inactiveBorderColor: Colors.cyan,
borderWidth: 2,
onStepperTap: (value) {
setState(() {
currentStep1 = value;
});
},
),
const SizedBox(height: 24),
const Text(
"Example - 4",
style: TextStyle(color: Colors.black, fontSize: 22),
),
SmartStepper(
currentStep: currentStep2,
totalSteps: totalSteps,
completeTextColor: Colors.black,
currentTextColor: Colors.red,
inactiveTextColor: Colors.blue,
borderWidth: 2,
onStepperTap: (value) {
setState(() {
currentStep2 = value;
});
},
),
const SizedBox(height: 24),
const Text(
"Example - 5",
style: TextStyle(color: Colors.black, fontSize: 22),
),
SmartStepper(
currentStep: currentStep,
totalSteps: totalSteps,
completeLineColor: Colors.black,
currentLineColor: Colors.red,
inactiveLineColor: Colors.blue,
lineHeight: 10,
lineWidth: 50,
lineBorderRadius: 12,
linePadding: const EdgeInsets.symmetric(horizontal: 12),
onStepperTap: (value) {
setState(() {
currentStep = value;
});
},
),
const SizedBox(height: 12),
const Text(
"Example - 6",
style: TextStyle(color: Colors.black, fontSize: 22),
),
SmartStepper(
currentStep: currentStep1,
totalSteps: totalSteps,
stepWidth: 48,
stepHeight: 48,
completeStepColor: Colors.orange,
currentStepColor: Colors.red,
inactiveStepColor: Colors.purple,
onStepperTap: (value) {
setState(() {
currentStep1 = value;
});
},
),
],
),
);
}
}