Comments (2)
any solution?
from step-progress-indicator.
Hi @pratikbutani (cc @kevin4dhd)
The height of each step with StepProgressIndicator
is computed based on the parent container size. Therefore, if you want the size of the each step to change based on a dynamic value, you should change the height of the container.
Below an example:
class HomePage extends StatelessWidget {
const HomePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: const [
Box(height: 100),
Box(height: 200),
Box(height: 300),
Box(height: 400),
Box(height: 500),
],
),
),
);
}
}
class Box extends StatelessWidget {
final double height;
const Box({
Key? key,
required this.height,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
border: Border.all(
color: Colors.black,
width: 2,
),
),
width: 100,
height: height,
child: const Indicator(),
);
}
}
class Indicator extends StatelessWidget {
const Indicator({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return const StepProgressIndicator(
totalSteps: 10,
currentStep: 5,
size: 20,
direction: Axis.vertical,
);
}
}
The principle is the same if your parent container is scrollable:
class ScrollContainerSize extends StatelessWidget {
const ScrollContainerSize({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: SizedBox(
height: 300,
child: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: const [
Box(height: 500),
],
),
),
),
),
);
}
}
class Box extends StatelessWidget {
final double height;
const Box({
Key? key,
required this.height,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
border: Border.all(
color: Colors.black,
width: 2,
),
),
width: 100,
height: height,
child: const Indicator(),
);
}
}
class Indicator extends StatelessWidget {
const Indicator({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return const StepProgressIndicator(
totalSteps: 10,
currentStep: 5,
size: 20,
direction: Axis.vertical,
);
}
}
from step-progress-indicator.
Related Issues (20)
- ProgressIndicator not work with gradientColor and padding > 0 HOT 3
- Nested (step) indicators HOT 2
- OnTap tooltip for circularStepIndicator and individual steps HOT 3
- make unrounded caps steps same size as rounded caps HOT 3
- Using rounded caps results in losing opacity with progressCircle
- Apply rounded Edges even when steps are 0 HOT 1
- Animation between oldValue and new Value HOT 3
- Nullsafety support
- When use customeSize, CrossAxisAlignment does not working good... HOT 2
- Circular Progress Indicator is not Circular HOT 1
- roundedEdges: not working HOT 1
- An option to have labels with the current step to help with onboarding or relevant flows HOT 1
- roundedEdges doesn't work when steps are completed HOT 2
- Black lines are seen on every step
- Is it possible to set-them In the appBar?
- Issues with size HOT 1
- How to remove border width, or border color for StepProgressIndicator?
- How to remove the leading/trailing paddings
- That's a super nice component, but how to perform looping animations when loading?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from step-progress-indicator.