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

42 lines
1.1 KiB
Dart
Raw Normal View History

2022-01-19 02:10:05 +01:00
import 'package:flutter/material.dart';
import '../../bloc/theme/theme_bloc.dart';
class KanjiBox extends StatelessWidget {
final String kanji;
const KanjiBox({
Key? key,
required this.kanji,
}) : super(key: key);
@override
Widget build(BuildContext context) => IntrinsicHeight(
child: AspectRatio(
aspectRatio: 1,
child: BlocBuilder<ThemeBloc, ThemeState>(
builder: (context, state) {
final colors = state.theme.menuGreyLight;
return Container(
padding: const EdgeInsets.all(5),
alignment: Alignment.center,
decoration: BoxDecoration(
color: colors.background,
borderRadius: BorderRadius.circular(10.0),
),
child: FittedBox(
child: Text(
kanji,
style: TextStyle(
color: colors.foreground,
fontSize: 25,
),
),
2022-01-19 02:10:05 +01:00
),
);
},
2022-01-19 02:10:05 +01:00
),
),
);
2022-01-19 02:10:05 +01:00
}