mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 04:37:37 +02:00
feat: custom animated progressbar.
This commit is contained in:
@ -0,0 +1,32 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class GradientProgressIndicator extends StatefulWidget {
|
||||
final double? progress;
|
||||
const GradientProgressIndicator({required this.progress, super.key});
|
||||
|
||||
@override
|
||||
State<GradientProgressIndicator> createState() =>
|
||||
_GradientProgressIndicatorState();
|
||||
}
|
||||
|
||||
class _GradientProgressIndicatorState extends State<GradientProgressIndicator> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 500),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Theme.of(context).colorScheme.primary,
|
||||
Theme.of(context).colorScheme.secondary,
|
||||
],
|
||||
),
|
||||
),
|
||||
height: 5,
|
||||
width: MediaQuery.of(context).size.width * widget.progress!,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user