epub_kitty 0.1.7

  • Readme
  • Changelog
  • Example
  • Installing
  • 93

epub_kitty #

epub_kitty is an epub ebook reader that encapsulates the folioreader framework. It supports iOS and android, but is customizable on iOS. It is very easy to use, you just need to set up the configuration file can open the ebook, very convenient. However, it is not yet highly customizable on android. But it has been able to meet daily needs.

中文文档

Install #

dependencies:
  epub_kitty: ^0.1.7

Simple Use #

first step
/**
 * @identifier (android useless)
 * @themeColor
 * @scrollDirection (android useless)
 * @allowSharing (android useless)
 */
EpubKitty.setConfig("book", "#32a852","vertical",true);

second step
 /**
 * @bookPath 
 */
EpubReader.open('bookPath');

// page channel used to monitor the current number of pages (only on the ios side)
  static const pageChannel = const EventChannel('com.xiaofwang.epub_kitty/page');

Tool Language #

iOS

plugin in ios default language is en,if you are chinese,you should configuare Localizable.strings. And you can see example to match.

android

android default lanuage is chinese before 0.1.7 and later is en, if you used before 0.1.7 ,you should use res/strings.xml to match chinese. see issue #7

issues #

if you can not install it, mybe it exists some confict in your plugins or may not full-install.

more solutions see issuses.

Good luck to you !

QQ Communication: #

QQ:853797155,Welcome to exchange questions and technologies!

Welcome TO PR #

0.1.7 #

  • iOS support ipad full-screen
  • change android default language to en and fixed some bugs

0.1.6 #

  • fixed iOS epub crash

0.1.5 #

  • replace UIWebView by WKWebview in iOS

0.1.0 #

  • upgrade flutter version to 12.13
  • fix the problem on androidx in example

0.0.4 #

  • add setConfig method.

0.0.3 #

  • change name to epub_kitty.

0.0.2 #

  • ios finished.

0.0.1 #

  • android finished.

example/lib/main.dart

import 'dart:io';

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:epub_kitty/epub_kitty.dart';
import 'package:path_provider/path_provider.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  static const pageChannel =
      const EventChannel('com.xiaofwang.epub_kitty/page');

  @override
  void initState() {
    super.initState();

    // pageChannel.receiveBroadcastStream('com.xiaofwang.epub_kitty/page').listen(
    //     (Object event) {
    //   print('page:$event');
    // }, onError: null);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: GestureDetector(
            onTap: () async {
              Directory appDocDir = await getApplicationDocumentsDirectory();
              print('$appDocDir');

              String iosBookPath = '${appDocDir.path}/4.epub';
              String androidBookPath =
                  'file:///android_asset/PhysicsSyllabus.epub';
              EpubKitty.setConfig("iosBook", "#32a852", "vertical", true);
              EpubKitty.open(iosBookPath);
            },
            child: Container(
              child: Text('open epub'),
            ),
          ),
        ),
      ),
    );
  }
}

//path:file:///var/mobile/Containers/Data/Application/BF0BEEFE-31BC-4989-B779-6517EE275336/Documents/3.epub/OEBPS/cover.xhtml

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  epub_kitty: ^0.1.7

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:epub_kitty/epub_kitty.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
87
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
93
Learn more about scoring.

We analyzed this package on Jul 14, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.15
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform Linux

Because:

  • package:epub_kitty/epub_kitty.dart that declares support for platforms: Android, iOS

Package does not support Flutter platform Web

Because:

  • package:epub_kitty/epub_kitty.dart that declares support for platforms: Android, iOS

Package does not support Flutter platform Windows

Because:

  • package:epub_kitty/epub_kitty.dart that declares support for platforms: Android, iOS

Package does not support Flutter platform macOS

Because:

  • package:epub_kitty/epub_kitty.dart that declares support for platforms: Android, iOS

Package not compatible with SDK dart

Because:

  • epub_kitty that is a package requiring null.

Health suggestions

Format lib/epub_kitty.dart.

Run flutter format to format lib/epub_kitty.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.2
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test