fayis672 / epub_viewer

A Flutter package for rendering Epub documents
https://pub.dev/packages/flutter_epub_viewer
BSD 3-Clause "New" or "Revised" License
12 stars 12 forks source link

chapters on controller was empty #31

Open mhnadimy opened 3 weeks ago

mhnadimy commented 3 weeks ago

epubController.chapters returning empty value

my Code :

onEpubLoaded: () async {
 print('loaded');
 print(epubController.chapters.length);
 setState(() {
  isLoading = false;
 });
}

OUT PUT :

flutter: loaded
flutter: 0
mhnadimy commented 3 weeks ago

i think problem on parseChapters function :D

fayis672 commented 3 weeks ago

Please use onChaptersLoaded callback to get chapters

mhnadimy commented 2 weeks ago

thanks for your help but it doesn't work

check your example file i clone and edit your file :)

fayis672 commented 2 weeks ago

@mhnadimy The existing example is working correctly for me, you can use either onChaptersLoaded or getChapters() method from epubController to get chapters, if still don't work please share tthe code snippet