stack_wallet/lib/widgets/progress_bar.dart

59 lines
1.4 KiB
Dart
Raw Normal View History

2023-05-26 21:21:16 +00:00
/*
* This file is part of Stack Wallet.
*
* Copyright (c) 2023 Cypher Stack
* All Rights Reserved.
* The code is distributed under GPLv3 license, see LICENSE file for details.
* Generated by Cypher Stack on 2023-05-26
*
*/
2022-08-26 08:11:35 +00:00
import 'package:flutter/cupertino.dart';
class ProgressBar extends StatelessWidget {
const ProgressBar({
Key? key,
required this.width,
required this.height,
required this.fillColor,
required this.backgroundColor,
required this.percent,
}) : super(key: key);
final double width;
final double height;
final Color fillColor;
final Color backgroundColor;
final double percent;
@override
Widget build(BuildContext context) {
final double fillLength = width * percent;
return SizedBox(
width: width,
height: height,
child: Container(
width: width,
height: height,
decoration: BoxDecoration(
color: backgroundColor,
borderRadius: BorderRadius.circular(height / 2),
),
child: Row(
children: [
AnimatedContainer(
duration: const Duration(milliseconds: 300),
height: height,
width: fillLength,
decoration: BoxDecoration(
color: fillColor,
borderRadius: BorderRadius.circular(height / 2),
),
)
],
),
),
);
}
}