mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-09-06 03:56:56 +00:00
48 lines
1.3 KiB
Dart
48 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class BrandLinearIndicator extends StatelessWidget {
|
|
const BrandLinearIndicator({
|
|
required this.value,
|
|
required this.color,
|
|
required this.backgroundColor,
|
|
required this.height,
|
|
super.key,
|
|
});
|
|
|
|
final double value;
|
|
final Color color;
|
|
final Color backgroundColor;
|
|
final double height;
|
|
|
|
@override
|
|
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: AnimatedContainer(
|
|
duration: const Duration(milliseconds: 400),
|
|
curve: Curves.easeInOut,
|
|
width: constraints.maxWidth,
|
|
decoration: BoxDecoration(
|
|
color: color,
|
|
borderRadius: BorderRadius.circular(height),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|