David PHAM-VAN

Add Divider Widget

... ... @@ -7,6 +7,7 @@
- Add dashed lines to Decoration Widgets
- Add TableRow decoration
- Add Chart Widget [Marco Papula]
- Add Divider Widget
## 1.6.2
... ...
... ... @@ -766,3 +766,56 @@ class Opacity extends SingleChildWidget {
}
}
}
class Divider extends StatelessWidget {
Divider({
this.height,
this.thickness,
this.indent,
this.endIndent,
this.color,
}) : assert(height == null || height >= 0.0),
assert(thickness == null || thickness >= 0.0),
assert(indent == null || indent >= 0.0),
assert(endIndent == null || endIndent >= 0.0);
/// The color to use when painting the line.
final PdfColor color;
/// The amount of empty space to the trailing edge of the divider.
final double endIndent;
/// The divider's height extent.
final double height;
/// The amount of empty space to the leading edge of the divider.
final double indent;
/// The thickness of the line drawn within the divider.
final double thickness;
@override
Widget build(Context context) {
final double height = this.height ?? 16;
final double thickness = this.thickness ?? 1;
final double indent = this.indent ?? 0;
final double endIndent = this.endIndent ?? 0;
return SizedBox(
height: height,
child: Center(
child: Container(
height: thickness,
margin: EdgeInsets.only(left: indent, right: endIndent),
decoration: BoxDecoration(
border: BoxBorder(
bottom: true,
color: color,
width: thickness,
),
),
),
),
);
}
}
... ...