mirror of
https://github.com/venera-app/venera.git
synced 2025-12-15 22:51:15 +00:00
Home page shared item
This commit is contained in:
@@ -1626,7 +1626,7 @@ class _SMClipper extends CustomClipper<Rect> {
|
|||||||
|
|
||||||
class SimpleComicTile extends StatelessWidget {
|
class SimpleComicTile extends StatelessWidget {
|
||||||
const SimpleComicTile(
|
const SimpleComicTile(
|
||||||
{super.key, required this.comic, this.onTap, this.withTitle = false});
|
{super.key, required this.comic, this.onTap, this.withTitle = false, this.heroID});
|
||||||
|
|
||||||
final Comic comic;
|
final Comic comic;
|
||||||
|
|
||||||
@@ -1634,6 +1634,8 @@ class SimpleComicTile extends StatelessWidget {
|
|||||||
|
|
||||||
final bool withTitle;
|
final bool withTitle;
|
||||||
|
|
||||||
|
final int? heroID;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var image = _findImageProvider(comic);
|
var image = _findImageProvider(comic);
|
||||||
@@ -1659,6 +1661,13 @@ class SimpleComicTile extends StatelessWidget {
|
|||||||
child: child,
|
child: child,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (heroID != null) {
|
||||||
|
child = Hero(
|
||||||
|
tag: "cover$heroID",
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
child = AnimatedTapRegion(
|
child = AnimatedTapRegion(
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
onTap: onTap ??
|
onTap: onTap ??
|
||||||
@@ -1667,6 +1676,9 @@ class SimpleComicTile extends StatelessWidget {
|
|||||||
() => ComicPage(
|
() => ComicPage(
|
||||||
id: comic.id,
|
id: comic.id,
|
||||||
sourceKey: comic.sourceKey,
|
sourceKey: comic.sourceKey,
|
||||||
|
cover: comic.cover,
|
||||||
|
title: comic.title,
|
||||||
|
heroID: heroID,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -302,13 +302,18 @@ class _HistoryState extends State<_History> {
|
|||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
itemCount: history.length,
|
itemCount: history.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
|
final heroID = history[index].id.hashCode;
|
||||||
return SimpleComicTile(
|
return SimpleComicTile(
|
||||||
comic: history[index],
|
comic: history[index],
|
||||||
|
heroID: heroID,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.to(
|
context.to(
|
||||||
() => ComicPage(
|
() => ComicPage(
|
||||||
id: history[index].id,
|
id: history[index].id,
|
||||||
sourceKey: history[index].type.sourceKey,
|
sourceKey: history[index].type.sourceKey,
|
||||||
|
cover: history[index].cover,
|
||||||
|
title: history[index].title,
|
||||||
|
heroID: heroID,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -386,7 +391,9 @@ class _LocalState extends State<_Local> {
|
|||||||
Container(
|
Container(
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 8),
|
margin: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 8, vertical: 2),
|
horizontal: 8,
|
||||||
|
vertical: 2,
|
||||||
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.secondaryContainer,
|
color: Theme.of(context).colorScheme.secondaryContainer,
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
@@ -405,9 +412,22 @@ class _LocalState extends State<_Local> {
|
|||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
itemCount: local.length,
|
itemCount: local.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return SimpleComicTile(comic: local[index])
|
final heroID = local[index].id.hashCode;
|
||||||
.paddingHorizontal(8)
|
return SimpleComicTile(
|
||||||
.paddingVertical(2);
|
comic: local[index],
|
||||||
|
heroID: heroID,
|
||||||
|
onTap: () {
|
||||||
|
context.to(
|
||||||
|
() => ComicPage(
|
||||||
|
id: local[index].id,
|
||||||
|
sourceKey: local[index].sourceKey,
|
||||||
|
cover: local[index].cover,
|
||||||
|
title: local[index].title,
|
||||||
|
heroID: heroID,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
).paddingHorizontal(8).paddingVertical(2);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
).paddingHorizontal(8),
|
).paddingHorizontal(8),
|
||||||
|
|||||||
Reference in New Issue
Block a user