Add meaning widget
This commit is contained in:
parent
e254d128a3
commit
a695c3f106
|
@ -1,11 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:jisho_study_tool/components/kanji/kanji__search_page/kunyomi.dart';
|
||||
|
||||
import 'package:unofficial_jisho_api/api.dart' as jisho;
|
||||
|
||||
import './grade.dart';
|
||||
import './header.dart';
|
||||
import './jlpt_level.dart';
|
||||
import './meaning.dart';
|
||||
import './radical.dart';
|
||||
import './rank.dart';
|
||||
import './stroke_order_gif.dart';
|
||||
|
@ -44,6 +44,7 @@ class KanjiResultCard extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
),
|
||||
Meaning(_result.meaning),
|
||||
_result.onyomi.length != 0 ? Onyomi(_result.onyomi) : SizedBox.shrink(),
|
||||
_result.kunyomi.length != 0 ? Kunyomi(_result.kunyomi) : SizedBox.shrink(),
|
||||
IntrinsicHeight(
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class Meaning extends StatelessWidget {
|
||||
String _meaning;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: EdgeInsets.symmetric(
|
||||
horizontal: 10.0,
|
||||
vertical: 5.0,
|
||||
),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Wrap(
|
||||
runSpacing: 10.0,
|
||||
children: _meaning
|
||||
.split(',')
|
||||
.map((meaning) => Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Text(meaning),
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Meaning(this._meaning);
|
||||
}
|
Loading…
Reference in New Issue