Add linear progress bar widget

This commit is contained in:
Neeraj Gupta 2023-03-14 06:19:08 +05:30
parent 2ed8684cc1
commit 3d2dabc288
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1

View file

@ -0,0 +1,27 @@
import 'package:flutter/material.dart';
class LinearProgressWidget extends StatelessWidget {
final Color color;
final double fractionOfStorage;
const LinearProgressWidget({
required this.color,
required this.fractionOfStorage,
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (context, constrains) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
color: color,
),
width: constrains.maxWidth * fractionOfStorage,
height: 4,
);
},
);
}
}