Jisho-Study-Tool/lib/components/history/date_divider.dart

32 lines
812 B
Dart
Raw Permalink Normal View History

2021-08-03 22:02:42 +02:00
import 'package:flutter/material.dart';
2021-12-01 23:09:53 +01:00
2022-01-19 02:10:05 +01:00
import '../../bloc/theme/theme_bloc.dart';
2021-08-03 22:02:42 +02:00
2022-01-25 20:44:00 +01:00
class TextDivider extends StatelessWidget {
final String text;
2021-08-03 22:02:42 +02:00
2022-01-25 20:44:00 +01:00
const TextDivider({
2021-08-08 23:16:54 +02:00
Key? key,
2022-01-25 20:44:00 +01:00
required this.text,
}) : super(key: key);
2021-08-03 22:02:42 +02:00
@override
Widget build(BuildContext context) => BlocBuilder<ThemeBloc, ThemeState>(
builder: (context, state) {
final colors = state.theme.menuGreyNormal;
return Container(
decoration: BoxDecoration(color: colors.background),
padding: const EdgeInsets.symmetric(
vertical: 5,
horizontal: 10,
),
child: DefaultTextStyle.merge(
2022-01-25 20:44:00 +01:00
child: Text(text),
style: TextStyle(color: colors.foreground),
),
);
},
);
2021-08-03 22:02:42 +02:00
}