Skip to content

Commit

Permalink
Remove fixed with for progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Osman authored and Osman committed Feb 28, 2024
1 parent f8fe652 commit 87e9d71
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 34 deletions.
15 changes: 9 additions & 6 deletions example/lib/pages/components/progress_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,15 @@ class _WrapperState extends State<Wrapper> {
return Column(
// Replace with a Column for vertical
children: [
ProgressBar(
progress: progress,
border: widget.border,
type: type,
weight: widget.weight,
label: widget.label),
SizedBox(
width: 400,
child: ProgressBar(
progress: progress,
border: widget.border,
type: type,
weight: widget.weight,
label: widget.label),
),
const SizedBox(width: 40),
Row(
mainAxisAlignment: MainAxisAlignment.center,
Expand Down
53 changes: 25 additions & 28 deletions lib/src/components/progress/progress_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,37 +93,34 @@ class ProgressBar extends Progress {
class _ProgressBarState extends ProgressState<ProgressBar> {
@override
Widget build(BuildContext context) {
return SizedBox(
width: 400,
child: Column(
children: [
if (widget.label != null)
SizedBox(
child: Text(
widget.label!,
textAlign: TextAlign.start,
),
return Column(
children: [
if (widget.label != null)
SizedBox(
child: Text(
widget.label!,
textAlign: TextAlign.start,
),
Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
Expanded(
child: AnimatedContainer(
duration: const Duration(milliseconds: 500),
height: _weight(),
child: LinearProgressIndicator(
borderRadius: _border(),
value: widget.type == BarType.indeterminate
? null
: animation.value,
backgroundColor: widget.type == BarType.buffering
? const Color.fromRGBO(224, 227, 233, 1)
: Colors.transparent,
),
),
Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
Expanded(
child: AnimatedContainer(
duration: const Duration(milliseconds: 500),
height: _weight(),
child: LinearProgressIndicator(
borderRadius: _border(),
value: widget.type == BarType.indeterminate
? null
: animation.value,
backgroundColor: widget.type == BarType.buffering
? const Color.fromRGBO(224, 227, 233, 1)
: Colors.transparent,
),
),
_extraWidgets(),
])
],
),
),
_extraWidgets(),
])
],
);
}

Expand Down

0 comments on commit 87e9d71

Please sign in to comment.