1
0
mirror of https://github.com/h7x4/Jisho-Study-Tool.git synced 2024-12-14 02:41:50 +01:00
Jisho-Study-Tool/lib/components/kanji/kanji__search_page/kanji_search_page.dart
2020-07-11 13:33:31 +02:00

84 lines
2.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:unofficial_jisho_api/api.dart' as jisho;
import './grade.dart';
import './header.dart';
import './jlpt_level.dart';
import './radical.dart';
import './rank.dart';
import './stroke_order_gif.dart';
class KanjiResultCard extends StatelessWidget {
final jisho.KanjiResult _result;
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 30.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Flexible(
flex: 1,
fit: FlexFit.tight,
child: Center(child: SizedBox()),
),
Flexible(
flex: 1,
fit: FlexFit.tight,
child: Center(child: Header(_result.query)),
),
Flexible(
flex: 1,
fit: FlexFit.tight,
child: Center(
child: Radical(_result.radical),
),
),
],
),
),
IntrinsicHeight(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
StrokeOrderGif(_result.strokeOrderGifUri),
Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text("JLPT: ", style: TextStyle(fontSize: 20.0)),
JlptLevel(_result.jlptLevel ?? ""),
],
),
Row(
children: [
Text("Grade: ", style: TextStyle(fontSize: 20.0)),
Grade(_result.taughtIn ?? ""),
],
),
Row(
children: [
Text("Rank: ", style: TextStyle(fontSize: 20.0)),
Rank(_result.newspaperFrequencyRank ?? -1),
],
),
],
),
),
],
),
),
],
);
}
KanjiResultCard(this._result);
}