Jisho-Study-Tool/lib/view/components/history/phrase_search_item.dart

40 lines
928 B
Dart
Raw Normal View History

2021-08-03 22:02:42 +02:00
import 'package:flutter/material.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
import './search_item.dart';
2021-12-01 23:09:53 +01:00
import '../../../models/history/word_query.dart';
2021-08-03 22:02:42 +02:00
class PhraseSearchItem extends StatelessWidget {
final WordQuery search;
final DateTime timestamp;
const PhraseSearchItem({
required this.search,
required this.timestamp,
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Slidable(
2021-12-01 23:09:53 +01:00
actionPane: const SlidableScrollActionPane(),
secondaryActions: const [
2021-08-03 22:02:42 +02:00
IconSlideAction(
2021-12-01 23:09:53 +01:00
caption: 'Delete',
color: Colors.red,
icon: Icons.delete,
),
2021-08-03 22:02:42 +02:00
],
child: SearchItem(
2021-12-01 23:09:53 +01:00
onTap: () => Navigator.pushNamed(
context,
'/search',
arguments: search.query,
),
2021-08-03 22:02:42 +02:00
time: timestamp,
search: Text(search.query),
),
);
}
}