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

41 lines
1.2 KiB
Dart
Raw 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;
2022-01-19 02:10:05 +01:00
import '../../../bloc/theme/theme_bloc.dart';
import '../../../routing/routes.dart';
2022-01-23 23:56:26 +01:00
import '../../../settings.dart';
2021-12-01 23:09:53 +01:00
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
const Radical({
required this.radical,
Key? key,
}) : super(key: key);
2021-12-01 23:09:53 +01:00
2020-07-11 13:33:31 +02:00
@override
Widget build(BuildContext context) => BlocBuilder<ThemeBloc, ThemeState>(
builder: (context, state) {
final colors = state.theme.kanjiResultColor;
2021-08-08 23:16:54 +02:00
return InkWell(
onTap: () => Navigator.pushNamed(context, Routes.kanjiSearchRadicals, arguments: radical.symbol),
child: Container(
padding: const EdgeInsets.all(15.0),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: colors.background,
),
child: Text(
radical.symbol,
style: TextStyle(
color: colors.foreground,
fontSize: 40.0,
2022-01-23 23:56:26 +01:00
).merge(japaneseFont.textStyle),
),
),
);
},
);
2021-12-01 23:09:53 +01:00
}