How to make this UI, Row widget with 1st children as curved line on left 2nd child as text 3rd child as line which will be curved at right .
for image reference click here
Tried custom painter but i haven’t used custom paint so i dont have much knowledge about it . so kindly help me.
2
Answers
Maybe the package flutter-titled-container is something you can use.
See https://github.com/johandb/flutter_titled_container
To create a UI with a Row widget that includes a curved line on the left, text in the middle, and a curved line on the right, you can indeed use a CustomPainter. Below, I’ll guide you through the process step by step.
Step 1: Set Up the Basic Structure
First, you’ll need a basic Flutter application structure. If you haven’t created a Flutter app yet, you can use the following command to create a new one:
Step 2: Create the Custom Painter
You will need to create a custom painter for the curved lines. Create a new file called curved_line_painter.dart:
}
Step 3: Build the Row Widget
Now, use the CustomPainter in your main widget. Open main.dart and replace the content with the following code:
Step 4: Run Your Application
After setting everything up, run your application:
Explanation
CurvedLinePainter: This is a custom painter that draws a quadratic Bezier curve. The isLeft parameter determines if the curve should be drawn on the left or the right side.
CustomPaint: This widget is used to render the curves. You can adjust the size of the CustomPaint widget to change the width and height of the curves.
Row: This is used to align the curved lines and text horizontally.
Customization