<p>Hello Guys, In this article, I'm going to show you how to draw a horizontal line in Flutter. See below images on how the output is going to look. Nothing fancy. ; white-space: pre-wrap; background-color: rgb(233, 236, 239);]( font-size: 1rem; color: rgb(33, 37, 41); white-space: pre-wrap; background-color: rgb(233, 236, 239);](---------- or ----------- font-size: 1rem;](), then here is the link for that article. How to draw a Decorative Horizontal line in Flutter? - <a href="https://fluttercentral.com/Articles/Post/1148">https://fluttercentral.com/Articles/Post/1148font-size: 1rem;</a> ; background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;](color: #569cd6;](import color: #ce9178;]('package:flutter/material.dart'; color: #569cd6;](void main() { runApp(MyApp());} color: #569cd6;](class MyApp color: #569cd6;](extends StatelessWidget { color: #569cd6;](@override Widget build(BuildContext context) { color: #569cd6;](return Center( child: Container( child: CustomPaint(painter: Drawhorizontalline()), ), ); }} color: #569cd6;](class Drawhorizontalline color: #569cd6;](extends CustomPainter { Paint _paint; Drawhorizontalline() { _paint = Paint() ..color = Colors.white ..strokeWidth = color: #b5cea8;](1 ..strokeCap = StrokeCap.round; } color: #569cd6;](@override color: #569cd6;](void paint(Canvas canvas, Size size) { canvas.drawLine(Offset(-color: #b5cea8;](90.0, color: #b5cea8;](0.0), Offset(color: #b5cea8;](90.0, color: #b5cea8;](0.0), _paint); } color: #569cd6;](@override color: #569cd6;](bool shouldRepaint(CustomPainter oldDelegate) }</p> <p>Actually, by changing a few things. You can draw vertical and cross lines too using this class. Hope this is useful to you. Thanks,Srikanth</p>
How to draw a Horizontal line in Flutter?
This Article is posted by seven.srikanth at 12/27/2018 2:15:50 PM
Check out our other latest articles
Safearea widget - How to avoid visual overlap with Notch on flutter mobile app?How to convert row of widgets into column of widgets in flutter based on screen size?
How to run Flutter programs from GitHub?
How to get screen orientation in flutter?
NavigationRail example in flutter
Tags: How to draw a Horizontal line in Flutter?
Check out our other latest articles
Safearea widget - How to avoid visual overlap with Notch on flutter mobile app?How to convert row of widgets into column of widgets in flutter based on screen size?
How to run Flutter programs from GitHub?
How to get screen orientation in flutter?
NavigationRail example in flutter