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

30 lines
680 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';
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 {
2021-03-03 00:24:25 +01:00
final JishoResult result;
JishoJapaneseWord mainWord;
List<JishoJapaneseWord> otherForms;
2020-08-23 00:06:09 +02:00
2021-03-03 00:24:25 +01:00
SearchResultCard(this.result) {
this.mainWord = result.japanese[0];
this.otherForms = result.japanese.sublist(1);
2020-08-23 00:06:09 +02:00
}
@override
Widget build(BuildContext context) {
return ExpansionTile(
2021-03-03 00:24:25 +01:00
title: JapaneseHeader(mainWord),
2020-08-24 23:45:47 +02:00
children: [
2021-03-03 00:24:25 +01:00
Senses(result.senses),
OtherForms(otherForms),
2020-08-24 23:45:47 +02:00
],
2020-08-23 00:06:09 +02:00
);
}
}