Good day. I try to put Zoom image (photoview) in the imageAsset, but all the tutorials mention that I should put the asset.image like this: "child: PhotoView(imageProvider: AssetImage("assets/large-image.jpg")"". This is part of my dart code:
class DetailsPageBody extends StatefulWidget {
final Book bookObject;
DetailsPageBody(this.bookObject);
@override
_DetailsPageBodyState createState() => _DetailsPageBodyState();
}
class _DetailsPageBodyState extends State<DetailsPageBody> {
@override
Widget build(BuildContext context) {
return Container(
child: ListView(
children: <Widget>[
Stack(
children: <Widget>[
Column(
children: <Widget>[
TopContainer(widget: widget),
AuthorContainer(widget: widget),
Padding(
padding: EdgeInsets.only(top: 43),
child: GenreContainer(widget: widget),
),
TabBarContainer(widget: widget),
],
),
Positioned(
left: 25,
top: 20,
child: Container(
height: 260,
width: MediaQuery.of(context).size.width / 2 - 30,
child: ClipRRect(
borderRadius: BorderRadius.circular(0),
child: Image.asset(widget.bookObject.cover,
fit: BoxFit.contain),
),
),
)
],
)
],
),
);
}
}
The issue is that I can't get the "image provider" logic to work or how should I place or rearrange these lines of my code "child: Image.asset(widget.bookObject.cover, fit: BoxFit.contain)," even zoom in on this object-image?
I've already imported the dependency and the photoview package, but I can't get them to deploy.