-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Error code: SmartList
@OverRide
Widget build(BuildContext context) {
return NoConnectionHandler(
builder: (context) => SmartList(
onGet: (page) => Provider.of(context).getPdfs(page),
listGetter: (body) => body.data.toList(),
itemBuilder: (context, item) {
BuiltPdf pdf = item as BuiltPdf;
return Card(
elevation: 10,
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
ListTile(
title: Text(
pdf.pdfTitle,
style: TextStyle(color: Colors.black38, fontSize: 17.0),
),
leading: SizedBox(
height: 60.0,
width: 100.0, // fixed width and height
child: Image.network(
'https://savethelibrarymyanmar.org/images/${pdf.image}',
fit: BoxFit.fitWidth)),
subtitle:
Text(pdf.pdfSource, style: TextStyle(color: Colors.red)),
),
ButtonTheme(
child: ButtonBar(
mainAxisSize: MainAxisSize.max,
children: [
RaisedButton(
child: RichText(
text: LinkTextSpan(
url:
'${pdf.downloadLink}',
text: 'Download PDF',
),
),
//Redirect to DownloadLink Page
onPressed: () {
Navigator.popAndPushNamed(context, pdf.downloadLink);
},
),
Container(
child: IconButton(
icon: Icon(
Icons.favorite,
color: Colors.lime,
),
onPressed: () {
Navigator.pop(
context,);
},
),
),
],
),
),
],
),
);
},
),
);
}
}
How can i fix ? Please help guys.
