Browse Source

neon: Allow completely hiding linear progress indicator

pull/346/head
jld3103 2 years ago
parent
commit
a5a90c6892
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 28
      packages/neon/neon/lib/src/widgets/linear_progress_indicator.dart

28
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,
),
);
}

Loading…
Cancel
Save