-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from TalebRafiepour/12-customizable-step-node-…
…shapes-for-stepnode-widgets 12 customizable step node shapes for stepnode widgets
- Loading branch information
Showing
24 changed files
with
903 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:step_progress/step_progress.dart'; | ||
|
||
class ExampleEleven extends StatelessWidget { | ||
const ExampleEleven({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final stepProgressController = StepProgressController(totalSteps: 4); | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: const Text('StepProgress - diamond shape'), | ||
), | ||
body: Column( | ||
spacing: 48, | ||
children: [ | ||
StepProgress( | ||
totalSteps: 4, | ||
stepSize: 24, | ||
controller: stepProgressController, | ||
titles: const [ | ||
'Step 1', | ||
'Step 2', | ||
'Step 3', | ||
'Step 4', | ||
], | ||
padding: const EdgeInsets.all(18), | ||
theme: const StepProgressThemeData( | ||
shape: StepNodeShape.diamond, | ||
stepLineSpacing: 18, | ||
stepLineStyle: StepLineStyle( | ||
borderRadius: BorderRadius.all( | ||
Radius.circular(4), | ||
), | ||
), | ||
labelStyle: StepLabelStyle( | ||
margin: EdgeInsets.only(bottom: 6), | ||
), | ||
stepNodeStyle: StepNodeStyle( | ||
activeIcon: null, | ||
decoration: BoxDecoration( | ||
borderRadius: BorderRadius.all( | ||
Radius.circular(6), | ||
), | ||
), | ||
), | ||
), | ||
), | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
spacing: 38, | ||
children: [ | ||
ElevatedButton( | ||
onPressed: stepProgressController.previousStep, | ||
child: const Text('Prev'), | ||
), | ||
ElevatedButton( | ||
onPressed: stepProgressController.nextStep, | ||
child: const Text('Next'), | ||
), | ||
], | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:step_progress/step_progress.dart'; | ||
|
||
class ExampleNine extends StatelessWidget { | ||
const ExampleNine({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final stepProgressController = StepProgressController(totalSteps: 4); | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: const Text('StepProgress - square shape'), | ||
), | ||
body: Column( | ||
spacing: 48, | ||
children: [ | ||
StepProgress( | ||
totalSteps: 4, | ||
controller: stepProgressController, | ||
titles: const [ | ||
'Step 1', | ||
'Step 2', | ||
'Step 3', | ||
'Step 4', | ||
], | ||
padding: const EdgeInsets.all(18), | ||
theme: const StepProgressThemeData( | ||
shape: StepNodeShape.square, | ||
stepLabelAlignment: StepLabelAlignment.top, | ||
stepLineSpacing: 24, | ||
stepNodeStyle: StepNodeStyle( | ||
decoration: BoxDecoration( | ||
borderRadius: BorderRadius.all( | ||
Radius.circular(4), | ||
), | ||
), | ||
activeDecoration: BoxDecoration( | ||
borderRadius: BorderRadius.all( | ||
Radius.circular(6), | ||
), | ||
), | ||
), | ||
stepLineStyle: StepLineStyle( | ||
borderRadius: BorderRadius.all( | ||
Radius.circular(4), | ||
), | ||
), | ||
), | ||
), | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
spacing: 38, | ||
children: [ | ||
ElevatedButton( | ||
onPressed: stepProgressController.previousStep, | ||
child: const Text('Prev'), | ||
), | ||
ElevatedButton( | ||
onPressed: stepProgressController.nextStep, | ||
child: const Text('Next'), | ||
), | ||
], | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.