diff --git a/packages/neon/neon/lib/src/widgets/linear_progress_indicator.dart b/packages/neon/neon/lib/src/widgets/linear_progress_indicator.dart index 06075f42..32a0a58d 100644 --- a/packages/neon/neon/lib/src/widgets/linear_progress_indicator.dart +++ b/packages/neon/neon/lib/src/widgets/linear_progress_indicator.dart @@ -3,6 +3,7 @@ part of '../../neon.dart'; class NeonLinearProgressIndicator extends StatelessWidget { const NeonLinearProgressIndicator({ this.visible = true, + this.alwaysThere = true, this.margin = const EdgeInsets.symmetric(horizontal: 10), this.color, this.backgroundColor = Colors.transparent, @@ -10,21 +11,24 @@ class NeonLinearProgressIndicator extends StatelessWidget { }); final bool visible; + final bool alwaysThere; final EdgeInsets? margin; final Color? color; final Color? backgroundColor; @override - Widget build(final BuildContext context) => Container( - margin: margin, - child: SizedBox( - height: 3, - child: visible - ? LinearProgressIndicator( - color: color, - backgroundColor: backgroundColor, - ) - : null, - ), - ); + Widget build(final BuildContext context) => !alwaysThere && !visible + ? Container() + : Container( + margin: margin, + child: SizedBox( + height: 3, + child: visible + ? LinearProgressIndicator( + color: color, + backgroundColor: backgroundColor, + ) + : null, + ), + ); }