mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
feat: custom animated progressbar.
This commit is contained in:
parent
8300cc4071
commit
0a2a495ab0
@ -3,6 +3,7 @@ import 'package:flutter_i18n/flutter_i18n.dart';
|
|||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:revanced_manager/ui/views/installer/installer_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/installer/installer_viewmodel.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/installerView/custom_material_button.dart';
|
import 'package:revanced_manager/ui/widgets/installerView/custom_material_button.dart';
|
||||||
|
import 'package:revanced_manager/ui/widgets/installerView/gradient_progress_indicator.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
|
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/shared/custom_popup_menu.dart';
|
import 'package:revanced_manager/ui/widgets/shared/custom_popup_menu.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart';
|
import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart';
|
||||||
@ -58,13 +59,8 @@ class InstallerView extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
bottom: PreferredSize(
|
bottom: PreferredSize(
|
||||||
preferredSize: const Size(double.infinity, 1.0),
|
preferredSize: const Size(double.infinity, 1.0),
|
||||||
child: LinearProgressIndicator(
|
child:
|
||||||
color: Theme.of(context).colorScheme.primary,
|
GradientProgressIndicator(progress: model.progress!)),
|
||||||
backgroundColor:
|
|
||||||
Theme.of(context).colorScheme.primaryContainer,
|
|
||||||
value: model.progress,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: const EdgeInsets.all(20.0),
|
padding: const EdgeInsets.all(20.0),
|
||||||
|
@ -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!,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user