extensions_flutter 0.3.12 copy "extensions_flutter: ^0.3.12" to clipboard
extensions_flutter: ^0.3.12 copied to clipboard

Adds Flutter integration for the extensions package.

pub package package publisher

Extensions for Flutter #

Bootstrap Flutter apps with the same host, dependency injection, configuration, and logging stack provided by the extensions package.

What it adds #

  • addFlutter wires up Flutter-specific lifetimes, runApp, and graceful shutdown using the shared host pipeline.
  • Automatic error capture from FlutterError.onError and PlatformDispatcher.onError, routed through Logger.
  • FlutterApplicationLifetime publishes paused, resumed, inactive, hidden, and detached events via WidgetsBindingObserver.
  • Access to Host.configuration, Host.environment, and typed loggers inside widgets through the provided extensions.

Install #

flutter pub add extensions_flutter

Quick start: host-driven Flutter bootstrap #

import 'package:extensions_flutter/extensions_flutter.dart';
import 'package:flutter/widgets.dart';

final _builder = Host.createApplicationBuilder()
  ..addLogging((logging) => logging.addSimpleConsole())
  ..addFlutter((flutter) => flutter.useApp((services) => MyApp()));

final host = _builder.build();

Future<void> main() async => host.run();

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

  @override 
  Widget build(BuildContext context) {
    return Text('Hi');
  }
}

The Flutter host wraps your root widget with a lifecycle observer and keeps logging/configuration consistent across Flutter, CLI, and background service entry points.

1
likes
140
points
460
downloads

Publisher

verified publisherjamiewest.dev

Weekly Downloads

Adds Flutter integration for the extensions package.

Repository
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

collection, extensions, flutter

More

Packages that depend on extensions_flutter