32 lines
814 B
Dart
32 lines
814 B
Dart
|
|
import 'package:flutter/cupertino.dart';
|
||
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||
|
|
|
||
|
|
import '../theme/themes.dart';
|
||
|
|
|
||
|
|
class HorizontalProgressWidget extends StatelessWidget {
|
||
|
|
final int value;
|
||
|
|
final int length;
|
||
|
|
final Color color;
|
||
|
|
|
||
|
|
HorizontalProgressWidget(this.value, this.length, this.color);
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return ClipRRect(
|
||
|
|
borderRadius: BorderRadius.circular(16.h),
|
||
|
|
child: Container(
|
||
|
|
height: 16.h,
|
||
|
|
color: white,
|
||
|
|
child: AnimatedFractionallySizedBox(
|
||
|
|
alignment: Alignment.centerLeft,
|
||
|
|
widthFactor: length == 0 ? 0 : value.toDouble() / length,
|
||
|
|
duration: Duration(milliseconds: 600),
|
||
|
|
child: Container(
|
||
|
|
color: color,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|