Skip to content

Commit 87e9d71

Browse files
OsmanOsman
Osman
authored and
Osman
committed
Remove fixed with for progress bar
1 parent f8fe652 commit 87e9d71

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

example/lib/pages/components/progress_example.dart

+9-6
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,15 @@ class _WrapperState extends State<Wrapper> {
103103
return Column(
104104
// Replace with a Column for vertical
105105
children: [
106-
ProgressBar(
107-
progress: progress,
108-
border: widget.border,
109-
type: type,
110-
weight: widget.weight,
111-
label: widget.label),
106+
SizedBox(
107+
width: 400,
108+
child: ProgressBar(
109+
progress: progress,
110+
border: widget.border,
111+
type: type,
112+
weight: widget.weight,
113+
label: widget.label),
114+
),
112115
const SizedBox(width: 40),
113116
Row(
114117
mainAxisAlignment: MainAxisAlignment.center,

lib/src/components/progress/progress_bar.dart

+25-28
Original file line numberDiff line numberDiff line change
@@ -93,37 +93,34 @@ class ProgressBar extends Progress {
9393
class _ProgressBarState extends ProgressState<ProgressBar> {
9494
@override
9595
Widget build(BuildContext context) {
96-
return SizedBox(
97-
width: 400,
98-
child: Column(
99-
children: [
100-
if (widget.label != null)
101-
SizedBox(
102-
child: Text(
103-
widget.label!,
104-
textAlign: TextAlign.start,
105-
),
96+
return Column(
97+
children: [
98+
if (widget.label != null)
99+
SizedBox(
100+
child: Text(
101+
widget.label!,
102+
textAlign: TextAlign.start,
106103
),
107-
Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
108-
Expanded(
109-
child: AnimatedContainer(
110-
duration: const Duration(milliseconds: 500),
111-
height: _weight(),
112-
child: LinearProgressIndicator(
113-
borderRadius: _border(),
114-
value: widget.type == BarType.indeterminate
115-
? null
116-
: animation.value,
117-
backgroundColor: widget.type == BarType.buffering
118-
? const Color.fromRGBO(224, 227, 233, 1)
119-
: Colors.transparent,
120-
),
104+
),
105+
Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
106+
Expanded(
107+
child: AnimatedContainer(
108+
duration: const Duration(milliseconds: 500),
109+
height: _weight(),
110+
child: LinearProgressIndicator(
111+
borderRadius: _border(),
112+
value: widget.type == BarType.indeterminate
113+
? null
114+
: animation.value,
115+
backgroundColor: widget.type == BarType.buffering
116+
? const Color.fromRGBO(224, 227, 233, 1)
117+
: Colors.transparent,
121118
),
122119
),
123-
_extraWidgets(),
124-
])
125-
],
126-
),
120+
),
121+
_extraWidgets(),
122+
])
123+
],
127124
);
128125
}
129126

0 commit comments

Comments
 (0)