import 'package:flutter/material.dart'; import 'package:le_kiosque_by_gcs/model/magazine.dart'; import 'package:le_kiosque_by_gcs/ui/pdf_reader.dart'; class ItemMagSmall extends StatelessWidget { const ItemMagSmall({Key key, this.magazine}) : super(key: key); final Magazine magazine; @override Widget build(BuildContext context) { return InkWell( onTap: () { showPdfReader(context, magazine.magazineUrl); }, child: Container( height: 167, width: 119, decoration: BoxDecoration( shape: BoxShape.rectangle, borderRadius: BorderRadius.all(Radius.circular(5)), image: DecorationImage( image: NetworkImage( "https://miningandbusiness.com/wp-content/uploads/2021/02/03f19c3a-1d92-4be7-ac54-f52b37e626ad-561x771.jpg"), fit: BoxFit.cover, ), ), ), ); } void showPdfReader(BuildContext context, String magazineUrl) { Navigator.of(context).push( MaterialPageRoute( builder: (context) { return PdfReader( pdfUrl: "http://www.africau.edu/images/default/sample.pdf", ); }, ), ); } }