Jisho-Study-Tool/lib/components/search/search_card.dart

30 lines
685 B
Dart
Raw Normal View History

2020-07-09 22:17:10 +02:00
import 'package:flutter/material.dart';
import 'package:unofficial_jisho_api/api.dart';
2020-08-23 00:38:42 +02:00
import 'parts/header.dart';
2020-08-24 23:45:47 +02:00
import 'parts/senses.dart';
2020-08-23 00:38:42 +02:00
import 'parts/other_forms.dart';
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
);
}
}