books
This commit is contained in:
@@ -5,7 +5,8 @@ import '../view_books.dart';
|
||||
|
||||
class BookCell extends StatefulWidget {
|
||||
final BookInfo bookInfo;
|
||||
const BookCell({super.key, required this.bookInfo});
|
||||
final ValueChanged<BookInfo> onSelect;
|
||||
const BookCell({super.key, required this.bookInfo, required this.onSelect});
|
||||
|
||||
@override
|
||||
State<BookCell> createState() => _BookCellState();
|
||||
@@ -14,31 +15,34 @@ class BookCell extends StatefulWidget {
|
||||
class _BookCellState extends State<BookCell> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MouseRegion(
|
||||
onEnter: _onEnter,
|
||||
cursor: SystemMouseCursors.click,
|
||||
child: Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Center(child: ClipRRect(
|
||||
child: Image.asset(widget.bookInfo.cover),
|
||||
borderRadius:BorderRadius.circular(8)
|
||||
))),
|
||||
const SizedBox(height: 8),
|
||||
return GestureDetector(
|
||||
onTap: ()=> widget.onSelect(widget.bookInfo),
|
||||
child: MouseRegion(
|
||||
onEnter: _onEnter,
|
||||
cursor: SystemMouseCursors.click,
|
||||
child: Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Center(child: ClipRRect(
|
||||
child: Image.asset(widget.bookInfo.cover),
|
||||
borderRadius:BorderRadius.circular(8)
|
||||
))),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Text(
|
||||
'${widget.bookInfo.info}',
|
||||
style:
|
||||
TextStyle(fontSize: 12, color: Color(0xff515767)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Text(
|
||||
'${widget.bookInfo.info}',
|
||||
style:
|
||||
TextStyle(fontSize: 12, color: Color(0xff515767)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:components/toly_ui/decoration/title.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../components/toly_ui/decoration/title.dart';
|
||||
|
||||
class TitleGroup extends StatelessWidget {
|
||||
final String title;
|
||||
final Color? color;
|
||||
|
||||
Reference in New Issue
Block a user