Skip to content

NoSuchMethodError: The getter 'length' was called to null. Receiver null show on Screen. #47863

@arkarkyaw88

Description

@arkarkyaw88

Hi....i need help.
Screenshot from 2019-12-27 09-21-37

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions