57 lines
1.5 KiB
Dart
57 lines
1.5 KiB
Dart
import 'package:didvan/config/design_config.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class TextDivider extends StatelessWidget {
|
|
final String text;
|
|
final Color? textColor;
|
|
final Color? lineColor;
|
|
final TextStyle? textStyle;
|
|
final double? lineThickness;
|
|
final EdgeInsets? padding;
|
|
|
|
const TextDivider({
|
|
Key? key,
|
|
required this.text,
|
|
this.textColor,
|
|
this.lineColor,
|
|
this.textStyle,
|
|
this.lineThickness,
|
|
this.padding,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
padding:
|
|
padding ?? const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
|
|
child: Row(
|
|
children: [
|
|
Expanded(
|
|
child: Divider(
|
|
color: const Color.fromARGB(255, 184, 184, 184),
|
|
thickness: lineThickness ?? 1.0,
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
child: Text(
|
|
text,
|
|
style: textStyle ??
|
|
Theme.of(context).textTheme.bodyLarge?.copyWith(
|
|
color: DesignConfig.isDark? const Color.fromARGB(255, 0, 90, 119) : const Color.fromARGB(255, 0, 53, 70),
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Divider(
|
|
color: const Color.fromARGB(255, 184, 184, 184),
|
|
thickness: lineThickness ?? 1.0,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|