2020-07-09 22:17:10 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import 'package:unofficial_jisho_api/api.dart';
|
|
|
|
|
2021-03-02 23:09:56 +01:00
|
|
|
import './parts/header.dart';
|
|
|
|
import './parts/senses.dart';
|
|
|
|
import './parts/other_forms.dart';
|
2020-08-23 00:38:42 +02:00
|
|
|
|
2020-07-09 22:17:10 +02:00
|
|
|
class SearchResultCard extends StatelessWidget {
|
|
|
|
final JishoResult _result;
|
2020-08-23 00:06:09 +02:00
|
|
|
JishoJapaneseWord _mainWord;
|
|
|
|
List<JishoJapaneseWord> _otherForms;
|
|
|
|
|
|
|
|
SearchResultCard(this._result) {
|
|
|
|
this._mainWord = _result.japanese[0];
|
|
|
|
this._otherForms = _result.japanese.sublist(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return ExpansionTile(
|
2020-08-23 00:38:42 +02:00
|
|
|
title: JapaneseHeader(_mainWord),
|
2020-08-24 23:45:47 +02:00
|
|
|
children: [
|
|
|
|
Senses(_result.senses),
|
|
|
|
OtherForms(_otherForms),
|
|
|
|
],
|
2020-08-23 00:06:09 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|