Jisho-Study-Tool/lib/view/components/kanji/kanji_result_body/radical.dart

32 lines
785 B
Dart
Raw Permalink Normal View History

2020-07-11 13:33:31 +02:00
import 'package:flutter/material.dart';
import 'package:unofficial_jisho_api/api.dart' as jisho;
2021-12-01 23:09:53 +01:00
import '../../../../bloc/theme/theme_bloc.dart';
2020-07-11 13:33:31 +02:00
class Radical extends StatelessWidget {
2021-03-03 00:24:25 +01:00
final jisho.Radical radical;
2020-07-11 13:33:31 +02:00
2021-12-01 23:09:53 +01:00
const Radical({required this.radical, Key? key,}) : super(key: key);
2020-07-11 13:33:31 +02:00
@override
Widget build(BuildContext context) {
2021-08-08 23:16:54 +02:00
final _kanjiColors = BlocProvider.of<ThemeBloc>(context).state.theme.kanjiResultColor;
2020-07-11 13:33:31 +02:00
return Container(
2021-12-01 23:09:53 +01:00
padding: const EdgeInsets.all(10.0),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _kanjiColors.background,
),
2020-07-11 13:33:31 +02:00
child: Text(
2021-03-03 00:24:25 +01:00
radical.symbol,
2020-07-11 13:33:31 +02:00
style: TextStyle(
2021-08-08 23:16:54 +02:00
color: _kanjiColors.foreground,
2020-07-11 13:33:31 +02:00
fontSize: 40.0,
),
),
);
}
2021-12-01 23:09:53 +01:00
}