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

27 lines
609 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';
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),
children: [OtherForms(_otherForms)],
2020-08-23 00:06:09 +02:00
);
}
}