forked from SelfPrivacy/selfprivacy.org.app
Animate BrandLinearIndicator
parent
641e329725
commit
6f6df30767
|
@ -15,21 +15,29 @@ class BrandLinearIndicator extends StatelessWidget {
|
||||||
final double height;
|
final double height;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(final BuildContext context) => Container(
|
Widget build(final BuildContext context) => LayoutBuilder(
|
||||||
height: height,
|
builder: (final context, final constraints) => Container(
|
||||||
width: double.infinity,
|
height: height,
|
||||||
clipBehavior: Clip.antiAlias,
|
width: constraints.maxWidth,
|
||||||
decoration: BoxDecoration(
|
clipBehavior: Clip.antiAlias,
|
||||||
color: backgroundColor,
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(height),
|
color: backgroundColor,
|
||||||
),
|
borderRadius: BorderRadius.circular(height),
|
||||||
alignment: Alignment.centerLeft,
|
),
|
||||||
child: FractionallySizedBox(
|
alignment: Alignment.centerLeft,
|
||||||
widthFactor: value,
|
child: AnimatedSlide(
|
||||||
child: Container(
|
duration: const Duration(milliseconds: 400),
|
||||||
decoration: BoxDecoration(
|
curve: Curves.easeInOut,
|
||||||
color: color,
|
offset: Offset(
|
||||||
borderRadius: BorderRadius.circular(height),
|
-(1 - value),
|
||||||
|
0,
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
width: constraints.maxWidth,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: color,
|
||||||
|
borderRadius: BorderRadius.circular(height),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in New Issue