mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-02-02 14:16:58 +00:00
Animate BrandLinearIndicator
This commit is contained in:
parent
641e329725
commit
6f6df30767
|
@ -15,21 +15,29 @@ class BrandLinearIndicator extends StatelessWidget {
|
|||
final double height;
|
||||
|
||||
@override
|
||||
Widget build(final BuildContext context) => Container(
|
||||
height: height,
|
||||
width: double.infinity,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
color: backgroundColor,
|
||||
borderRadius: BorderRadius.circular(height),
|
||||
),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: value,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: color,
|
||||
borderRadius: BorderRadius.circular(height),
|
||||
Widget build(final BuildContext context) => LayoutBuilder(
|
||||
builder: (final context, final constraints) => Container(
|
||||
height: height,
|
||||
width: constraints.maxWidth,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
color: backgroundColor,
|
||||
borderRadius: BorderRadius.circular(height),
|
||||
),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: AnimatedSlide(
|
||||
duration: const Duration(milliseconds: 400),
|
||||
curve: Curves.easeInOut,
|
||||
offset: Offset(
|
||||
-(1 - value),
|
||||
0,
|
||||
),
|
||||
child: Container(
|
||||
width: constraints.maxWidth,
|
||||
decoration: BoxDecoration(
|
||||
color: color,
|
||||
borderRadius: BorderRadius.circular(height),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue