2020-07-11 13:33:31 +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';
|
2020-07-11 13:33:31 +02:00
|
|
|
|
|
|
|
class JlptLevel extends StatelessWidget {
|
2022-01-19 02:10:05 +01:00
|
|
|
final String? jlptLevel;
|
|
|
|
final String ifNullChar;
|
2020-07-11 13:33:31 +02:00
|
|
|
|
2021-12-01 23:09:53 +01:00
|
|
|
const JlptLevel({
|
|
|
|
required this.jlptLevel,
|
2022-01-19 02:10:05 +01:00
|
|
|
this.ifNullChar = '⨉',
|
2021-12-01 23:09:53 +01:00
|
|
|
Key? key,
|
|
|
|
}) : super(key: key);
|
2021-08-03 22:13:50 +02:00
|
|
|
|
2020-07-11 13:33:31 +02:00
|
|
|
@override
|
2022-01-23 04:52:28 +01:00
|
|
|
Widget build(BuildContext context) => BlocBuilder<ThemeBloc, ThemeState>(
|
|
|
|
builder: (context, state) {
|
|
|
|
final colors = state.theme.kanjiResultColor;
|
|
|
|
return Container(
|
|
|
|
padding: const EdgeInsets.all(10.0),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
color: colors.background,
|
|
|
|
),
|
|
|
|
child: Text(
|
|
|
|
jlptLevel ?? ifNullChar,
|
|
|
|
style: TextStyle(
|
|
|
|
color: colors.foreground,
|
|
|
|
fontSize: 20.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
);
|
2021-12-01 23:09:53 +01:00
|
|
|
}
|