Convert Figma logo to code with AI

JideGuru logoFlutterEbookApp

A simple Flutter app to Read and Download eBooks.

2,979
853
2,979
11

Top Related Projects

A Java ePub reader and parser framework for Android.

6,394

Enhanced eBooks in the browser.

A cross platform desktop reading app, based on the Readium Desktop toolkit

19,281

The official source code repository for the calibre ebook manager

16,284

An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices

Quick Overview

FlutterEbookApp is an open-source Flutter project that demonstrates how to build a feature-rich eBook reader application. It showcases various Flutter widgets and best practices for creating a responsive and visually appealing user interface for browsing, reading, and managing eBooks.

Pros

  • Comprehensive example of a real-world Flutter application
  • Implements various UI components and animations for an engaging user experience
  • Integrates with external APIs for fetching book data
  • Demonstrates state management using the Provider package

Cons

  • Limited documentation for some of the more complex features
  • Lacks unit and integration tests
  • Some dependencies may be outdated and require updates
  • Not optimized for tablet or large screen devices

Code Examples

  1. Fetching books from an API:
Future<List<Category>> getCategories() async {
  var response = await http.get(
    Uri.parse("${Constants.baseURL}/api/categories"),
  );
  return (json.decode(response.body) as List)
      .map((data) => Category.fromJson(data))
      .toList();
}
  1. Implementing a custom book card widget:
class BookCard extends StatelessWidget {
  final Entry entry;

  BookCard({Key? key, required this.entry}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 120.0,
      child: Card(
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(10.0),
        ),
        elevation: 4.0,
        child: ClipRRect(
          borderRadius: BorderRadius.circular(10.0),
          child: Image.network(
            entry.cover ?? '',
            fit: BoxFit.cover,
          ),
        ),
      ),
    );
  }
}
  1. Using Provider for state management:
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider(create: (_) => AppProvider()),
        ChangeNotifierProvider(create: (_) => DetailsProvider()),
        ChangeNotifierProvider(create: (_) => FavoritesProvider()),
      ],
      child: MaterialApp(
        title: 'Flutter eBook App',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: Splash(),
      ),
    );
  }
}

Getting Started

To run the FlutterEbookApp project:

  1. Clone the repository:

    git clone https://github.com/JideGuru/FlutterEbookApp.git
    
  2. Navigate to the project directory:

    cd FlutterEbookApp
    
  3. Install dependencies:

    flutter pub get
    
  4. Run the app:

    flutter run
    

Make sure you have Flutter and Dart SDK installed on your system before running the project.

Competitor Comparisons

A Java ePub reader and parser framework for Android.

Pros of FolioReader-Android

  • Native Android development, potentially offering better performance and deeper system integration
  • More mature project with a larger community and longer development history
  • Supports a wider range of EPUB features and customization options

Cons of FolioReader-Android

  • Limited to Android platform, lacking cross-platform compatibility
  • Steeper learning curve for developers not familiar with Android development
  • May require more boilerplate code compared to Flutter's declarative UI approach

Code Comparison

FolioReader-Android (Java):

FolioReader folioReader = FolioReader.get()
    .setOnHighlightListener(this)
    .setReadPositionListener(this)
    .setConfig(config)
    .openBook(R.raw.epub_sample);

FlutterEbookApp (Dart):

EpubViewer.setConfig(
  themeColor: Theme.of(context).primaryColor,
  identifier: "iosBook",
  scrollDirection: EpubScrollDirection.ALLDIRECTIONS,
  allowSharing: true,
  enableTts: true,
);
EpubViewer.open('assets/book.epub');

FolioReader-Android offers more granular control over the reader configuration, while FlutterEbookApp provides a simpler, more concise API for basic functionality. The Flutter version benefits from cross-platform compatibility and a more modern, reactive programming model, but may lack some of the advanced features and customization options available in the native Android implementation.

6,394

Enhanced eBooks in the browser.

Pros of epub.js

  • Written in JavaScript, making it more versatile for web-based applications
  • Extensive documentation and API reference available
  • Larger community and more frequent updates

Cons of epub.js

  • Limited to web environments, unlike FlutterEbookApp's cross-platform capabilities
  • Requires additional setup for mobile app integration
  • Less out-of-the-box UI components compared to FlutterEbookApp

Code Comparison

FlutterEbookApp (Dart):

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Flutter eBook App')),
      body: BookList(),
    );
  }
}

epub.js (JavaScript):

var book = ePub("book.epub");
var rendition = book.renderTo("viewer", {
  width: 600,
  height: 400
});
var displayed = rendition.display();

The FlutterEbookApp code snippet shows a basic app structure using Flutter widgets, while the epub.js code demonstrates how to render an EPUB file in a web environment. FlutterEbookApp provides a more complete app structure, whereas epub.js focuses on EPUB rendering functionality.

A cross platform desktop reading app, based on the Readium Desktop toolkit

Pros of Thorium Reader

  • Cross-platform support (Windows, macOS, Linux) vs Flutter's mobile focus
  • Advanced EPUB3 and PDF support with accessibility features
  • Open-source and actively maintained by a non-profit organization

Cons of Thorium Reader

  • Larger application size due to Electron framework
  • Potentially slower performance compared to native Flutter app
  • Steeper learning curve for contributors (TypeScript vs Dart)

Code Comparison

Thorium Reader (TypeScript):

export function convertContentToHtml(
    content: string,
    link: string,
    rootFile: string,
): string {
    const resourceResolver = (contentRef: string) =>
        resolveHref(contentRef, link, rootFile);
    return convertCustomSchemeToHttpUrl(content, resourceResolver);
}

FlutterEbookApp (Dart):

Future<List<Entry>> getFeeds() async {
  var response = await http.get(Uri.parse(api));
  if (response.statusCode == 200) {
    var jsonResponse = convert.jsonDecode(response.body);
    return Entry.parseEntries(jsonResponse);
  } else {
    throw ('Request failed with status: ${response.statusCode}');
  }
}

The code snippets showcase different approaches to handling content and data retrieval in each project, reflecting their respective languages and frameworks.

19,281

The official source code repository for the calibre ebook manager

Pros of Calibre

  • Comprehensive e-book management system with library organization, metadata editing, and format conversion
  • Cross-platform support (Windows, macOS, Linux) with a native desktop application
  • Large and active community with frequent updates and extensive plugin ecosystem

Cons of Calibre

  • Steeper learning curve due to its extensive feature set
  • Heavier resource usage compared to lightweight mobile apps
  • Desktop-focused, lacking native mobile apps (though web-based viewer available)

Code Comparison

FlutterEbookApp (Dart/Flutter):

class BookListItem extends StatelessWidget {
  final Entry entry;
  BookListItem({Key key, @required this.entry}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      // Widget implementation
    );
  }
}

Calibre (Python):

class BookList(QWidget):
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        self.layout = QVBoxLayout(self)
        self.setLayout(self.layout)

    def populate(self, books):
        for book in books:
            self.layout.addWidget(BookItem(book))

Both repositories focus on e-book management, but FlutterEbookApp is a mobile-first Flutter application, while Calibre is a comprehensive desktop e-book management suite. FlutterEbookApp offers a modern, lightweight mobile experience, whereas Calibre provides a feature-rich desktop solution with extensive library management capabilities.

16,284

An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices

Pros of koreader

  • More feature-rich and customizable e-reader application
  • Supports a wider range of e-book formats, including PDF, EPUB, DJVU, and more
  • Actively maintained with frequent updates and a large community

Cons of koreader

  • More complex setup and configuration process
  • Limited to specific devices and platforms (e-ink devices, Linux, macOS)
  • Steeper learning curve for new users

Code Comparison

FlutterEbookApp (Dart):

class BookListItem extends StatelessWidget {
  final Entry entry;
  BookListItem({Key key, @required this.entry}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      // Widget implementation
    );
  }
}

koreader (Lua):

local ReaderUI = require("apps/reader/readerui")
function ReaderUI:init()
    self.doc_settings = DocSettings:open(self.document.file)
    self.view = DocumentRegistry:openDocument(self.document)
    -- Additional initialization
end

The code snippets showcase the different programming languages and approaches used in each project. FlutterEbookApp uses Dart with Flutter for cross-platform mobile development, while koreader uses Lua for its implementation on various devices and platforms.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

📖📖 OpenLeaf (Flutter eBook App) Codemagic build status

Twitter Follow

A simple Flutter app to Read and Download books. The Books included in the app are from the Public Domain (Expired Copyright and completely free).


The Feedbooks API was used to fetch books.

App icon

To download this app, click here to see the codemagic builds. You can choose to install the apk. You can download from the appstore if you use an iPhone, iPad or a Mac with Silicon chip.

Please star⭐ the repo if you like what you see😉.

💻 Requirements

  • Any Operating System (ie. MacOS X, Linux, Windows)
  • Any IDE with Flutter SDK installed (ie. IntelliJ, Android Studio, VSCode etc)
  • A little knowledge of Dart and Flutter

✨ Features

  • Download eBooks.
  • Read eBooks.
  • Favorites.
  • Dark Mode
  • Swipe to delete downloads.

📸 ScreenShots

LightDark
Desktop

🔌 Plugins

NameUsage
RiverpodState Management
SembastNoSQL database to store Favorites & Downloads
XML2JSONConvert XML to JSON
DIONetwork calls and File Download
Iridium ReaderPlug and play reader widget for epubs

🤓 Author(s)

Festus Babajide Olusegun Twitter Follow

🔖 LICENCE

Apache-2.0

Star History Chart