flureadium 0.2.0 copy "flureadium: ^0.2.0" to clipboard
flureadium: ^0.2.0 copied to clipboard

Flutter plugin for reading EPUB ebooks, audiobooks, and comics using the Readium toolkits. Supports EPUB 2/3, PDF, TTS, audiobook playback, highlights, and reading preferences.

example/lib/main.dart

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:hydrated_bloc/hydrated_bloc.dart';
import 'package:path_provider/path_provider.dart';

import 'pages/index.dart';
import 'state/index.dart';

Future<void> main() async {
  // Flureadium.init(
  //   androidNotificationChannelId: 'r2.navigator.flutter.audio',
  //   androidNotificationChannelName: 'Audio playback',
  //   downloadDebug: true,
  // );
  WidgetsFlutterBinding.ensureInitialized();

  HydratedBloc.storage = await HydratedStorage.build(
    storageDirectory:
        kIsWeb ? HydratedStorageDirectory.web : HydratedStorageDirectory((await getTemporaryDirectory()).path),
  );

  runApp(
    MultiBlocProvider(
      providers: [
        BlocProvider(
          create: (final _) => PublicationBloc(),
          lazy: false,
        ),
        BlocProvider(
          create: (final _) {
            final bloc = TextSettingsBloc();
            bloc.setDefaultPreferences();
            return bloc;
          },
        ),
        // BlocProvider(
        //   create: (final _) => TtsSettingsBloc(),
        //   lazy: false,
        // ),
        BlocProvider(create: (final _) => PlayerControlsBloc()),
      ],
      child: MyApp(),
    ),
  );
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> with RestorationMixin {
  @override
  String? get restorationId => 'root';

  @override
  void restoreState(RestorationBucket? oldBucket, bool initialRestore) {
    // Register any restorable properties here if needed
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      restorationScopeId: 'app',
      routes: {
        '/': (context) => BookshelfPage(),
        '/player': (context) => PlayerPage(),
        '/toc': (context) => TableOfContentsPage(),
      },
    );
  }
}
0
likes
160
points
83
downloads

Publisher

verified publishermulev.dev

Weekly Downloads

Flutter plugin for reading EPUB ebooks, audiobooks, and comics using the Readium toolkits. Supports EPUB 2/3, PDF, TTS, audiobook playback, highlights, and reading preferences.

Repository (GitHub)
View/report issues
Contributing

Topics

#epub #ebook #readium #reader #pdf

Documentation

API reference

License

LGPL-3.0 (license)

Dependencies

collection, flureadium_platform_interface, flutter, flutter_web_plugins, rxdart, wakelock_plus, web

More

Packages that depend on flureadium

Packages that implement flureadium