extensions 0.3.18 copy "extensions: ^0.3.18" to clipboard
extensions: ^0.3.18 copied to clipboard

A set of APIs for commonly used programming patterns and utilities, such as dependency injection, logging, and configuration.

pub package package publisher

Extensions for Dart #

Microsoft.Extensions-style hosting, dependency injection, logging, configuration, and HTTP client plumbing for Dart and Flutter.

Highlights #

  • hosting: Host builder with graceful startup/shutdown, background services, cancellation tokens, and lifetime notifications.
  • dependency_injection: Familiar ServiceCollection APIs with singleton/scoped/transient lifetimes and validation options.
  • configuration: Compose JSON, environment variables, command line, INI, XML, in-memory, and stream-based sources with reload support.
  • logging: Structured logging abstractions with console/debug/json/systemd formatters, filter rules, and scopes.
  • options: Typed options with validation, change tokens, and monitors.
  • http: IHttpClientFactory-style pipeline with delegating handlers, logging, handler lifetime control, and header redaction.
  • File providers, globbing, caching, and primitives that mirror the .NET ecosystem.

Install #

dart pub add extensions

Quick start: minimal host with logging #

import 'package:extensions/hosting.dart';

final _builder = Host.createApplicationBuilder()
  ..addLogging((logging) => logging.addSimpleConsole());

final host = _builder.build();

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

More examples #

See packages/extensions/example for focused samples (background services, configuration, console formatters, caching, HTTP client logging, and more).

  • extensions_flutter – bootstraps Flutter with the same host/DI/logging stack.

Credits #

This is a Dart port of the Microsoft.Extensions.* stack from the dotnet/runtime repository, adapted where Dart and C# differ.

1
likes
150
points
535
downloads

Publisher

verified publisherjamiewest.dev

Weekly Downloads

A set of APIs for commonly used programming patterns and utilities, such as dependency injection, logging, and configuration.

Repository
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

async, characters, collection, cross_file, file, glob, http, path, uuid, watcher, xml

More

Packages that depend on extensions