mirror of
https://github.com/h7x4/Jisho-Study-Tool.git
synced 2024-12-22 22:07:29 +01:00
h7x4
28f900c02e
* Add lots of new functionality to search results * Fix jlpt level * Make antonyms clickable * Add kanji list * Replace Blocof with BlocBuilder * Make kanji widgets squared * Add missing colons to headers * add romaji under sentences * Fix extensive search not showing * Miscellaneous refactoring
34 lines
868 B
Dart
34 lines
868 B
Dart
import 'package:collection/collection.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:unofficial_jisho_api/api.dart';
|
|
|
|
import 'sense/sense.dart';
|
|
|
|
class Senses extends StatelessWidget {
|
|
final List<JishoWordSense> senses;
|
|
final List<PhraseScrapeMeaning>? extraData;
|
|
|
|
const Senses({
|
|
required this.senses,
|
|
this.extraData,
|
|
Key? key,
|
|
}) : super(key: key);
|
|
|
|
List<Widget> get _senseWidgets => [
|
|
for (int i = 0; i < senses.length; i++)
|
|
Sense(
|
|
index: i,
|
|
sense: senses[i],
|
|
meaning: extraData?.firstWhereOrNull(
|
|
(m) => m.definition == senses[i].englishDefinitions.join('; '),
|
|
),
|
|
),
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) => Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: _senseWidgets,
|
|
);
|
|
}
|