31 lines
685 B
Dart
31 lines
685 B
Dart
part of 'home_page.dart';
|
|
|
|
typedef OnKnowCallBack = void Function(String title, bool isKnow)?;
|
|
// Класс карточки
|
|
class _Card extends StatefulWidget {
|
|
final String word;
|
|
final String translation;
|
|
final String image;
|
|
final int mark;
|
|
final OnKnowCallBack onKnow;
|
|
|
|
const _Card({
|
|
required this.word,
|
|
required this.translation,
|
|
required this.image,
|
|
this.mark = 0,
|
|
this.onKnow,
|
|
});
|
|
|
|
factory _Card.fromData(
|
|
_Card data, {
|
|
OnKnowCallBack? onKnow,
|
|
}) =>
|
|
_Card(word: data.word, translation: data.translation, image: data.image, mark: data.mark, onKnow: onKnow);
|
|
|
|
@override
|
|
State<_Card> createState() => _CardState();
|
|
|
|
}
|
|
|