2020-08-23 00:38:42 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:unofficial_jisho_api/api.dart';
|
|
|
|
|
|
|
|
class JapaneseHeader extends StatelessWidget {
|
2021-03-03 00:24:25 +01:00
|
|
|
final JishoJapaneseWord word;
|
|
|
|
const JapaneseHeader(this.word);
|
2020-08-23 00:38:42 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2021-03-03 00:24:25 +01:00
|
|
|
final hasFurigana = (word.word != null);
|
2020-08-23 00:38:42 +02:00
|
|
|
|
|
|
|
return Container(
|
2020-08-24 23:45:47 +02:00
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
padding: EdgeInsets.only(left: 10.0),
|
2020-08-23 00:38:42 +02:00
|
|
|
child: Column(
|
|
|
|
children: [
|
2021-03-03 00:24:25 +01:00
|
|
|
(hasFurigana) ? Text(word.reading) : Text(''),
|
|
|
|
(hasFurigana) ? Text(word.word) : Text(word.reading),
|
2020-08-23 00:38:42 +02:00
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|