Skip to content

Trouble with loading cover images. #79

@gohanko

Description

@gohanko

I tried loading the cover image as per flutter app example, and the library seems to have trouble finding the cover image of the epub file even though it exists (confirmed via other apps and me looking at its meta data).

Here is the code :

Widget buildDocumentItem(epub.EpubBookRef book) {
    return Card(
        child: InkWell(
            splashColor: Colors.black.withAlpha(30),
            onTap: () {

            },
            child: Column(
                children: <Widget>[
                    FutureBuilder<epub.Image>(
                        future: book.readCover(),
                        builder: (context, snapshot) {
                            if (snapshot.hasData) {
                                return Image.memory(image.encodeJpg(snapshot.data));
                            } else if (snapshot.hasError) {
                                return Text("${snapshot.error}");
                            }

                            return Container();
                        }
                    ),
                    Text(book.Title),
                    Text(book.Author),
                ]
            ),
        ),
    );
}

Any idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions