book_adapter

Status:

  1. On hiatus for the foreseeable future, or until paginated HTML is solved in Flutter without using webviews.
  2. Plan is to move away from Firebase in the future. This means that older app versions will stop working when this happens.
  3. The EPUB library used is buggy, so some EPUB files will fail to open.

BookAdapter - ePub Reader & Library Management

CI codecov

A new Flutter app for reading ePub books, built for android and iOS.

Architecture

This project uses riverpod state management with MVC+S architecture.

Domain Logic (rules around data storage, manipulation, and validation) and Application Logic (what your application actually does. How it behaves.) You also find that:

Model – Holds the state of the application and provides an API to access/filter/manipulate that data. Its concern is data encapsulation and management. It contains logic to structure, validate or compare different pieces of data that we call Domain Logic. It also notifies the view of any changes in the data.

View – Views are all the Widgets and Pages within the Flutter Application. These views may contain a “view controller” themselves, but that is still considered part of the view application tier.

ViewController - A controller that handles UI state changes due to user interaction. ViewController makes calls on other controllers, it does not touch the model directly. If the view needs to handle UI state changes due to user interaction, use a view controller to manage and hold the state.

Controller – Contains the applications logic. They are used to complete any significant action within the app. Controllers managing UI state should be separated as a ViewController

Services – Services fetch data from the outside world, and return it to the app. Controllers call on services and inject the results into the model. Services do not touch the model directly.

Source: gskinner

Example Usage

Read about Riverpod

Setup

  1. Clone the repo
  2. Install Flutter instructions here
  3. Open the project in Android Studio or VSCode, install the Flutter plugin
  4. Setup Firebase for the app with analytics enabled, tutorial here
    • If you need to connect to the official Firebase backend, contact @getBoolean for the (iOS) GoogleService-Info.plist or (Android) google-services.json. It is not guarenteed you will be given access.
  5. Enable Email/Password login in the Firebase console “Authentication” tab
  6. Launch the emulator installed in step 2
  7. Run flutter pub get in terminal or press the button when prompted by VSCode
  8. Launch the app to the emulator with flutter run, or with the play button in Android Studio with the emulator selected in the dropdown menu

Testing

Unit tests and widget tests

Run the following command

Integration tests

Launch an emulator, then run the following command

Code Coverage

Code coverage is generated automatically when GitHub Actions are run, and uploaded to codecov.io

Contributing

  1. Choose an existing issue to fix/implement
  2. Fork the ‘main’ branch and give it a relevant name
  3. Implemement your changes. Do not make more changes than necessary
  4. Resolve all linter problems (other than todos). It cannot merge otherwise
  5. Open a Pull Request from your branch to main
  6. The PR can be merged by an Admin if there are no issues

Debugging

IOS Build Errors

If you run into this error

Umbrella header for module 'GoogleUtilities' does not include header 'GULSwizzler.h'

This error is caused by improperly removing the GoogleServices-info.plist file. Readd the file with XCode and then remove the file again through XCode instead of using the file manager.

Getting Started with Flutter

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.