const Divider(
thickness: 5, // thickness of the line
indent: 20, // empty space to the leading edge of divider.
endIndent: 20, // empty space to the trailing edge of the divider.
color: Colors.black, // The color to use when painting the line.
height: 20, // The divider's height extent.
),
import 'package:flutter/material.dart';
class TitleDivider extends StatelessWidget {
const TitleDivider({
Key? key,
required this.title,
}) : super(key: key);
final String title;
@override
Widget build(BuildContext context) {
return Row(
children: [
expandedDivider(),
textLineGrey(title),
expandedDivider(),
],
);
}
Expanded expandedDivider() {
return const Expanded(
child: Divider(
color: Color(0xffbdbdbd),
endIndent: 5,
thickness: 1,
indent: 5,
),
);
}
Text textLineGrey(String text) {
return Text(
text,
semanticsLabel: text,
style: const TextStyle(
color: Color(0xff9E9E9E),
),
);
}
}
SomeTimes I used Container Instead of Divider
Divider(
thickness: 5, // thickness of the line
indent: 20, // empty space to the leading edge of divider.
endIndent: 20, // empty space to the trailing edge of the divider.
color: Colors.black, // The color to use when painting the line.
height: 20, // The divider's height extent.
),
Divider is used to create a horizontal line divider