Add linear progress bar widget
This commit is contained in:
parent
2ed8684cc1
commit
3d2dabc288
1 changed files with 27 additions and 0 deletions
27
lib/ui/linear_progress_widget.dart
Normal file
27
lib/ui/linear_progress_widget.dart
Normal 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,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue