extensions_flutter library Null safety

To use, import package:extensions_flutter/extensions_flutter.dart

Classes

ApplicationLifetime
Allows consumers to perform cleanup during a graceful shutdown.
AsyncDisposable
Provides a mechanism for releasing unmanaged resources asynchronously.
BackgroundService
Base class for implementing a long running HostedService.
CancellationChangeToken
A ChangeToken implementation using CancellationToken.
CancellationToken
Propagates notification that operations should be canceled.
CancellationTokenRegistration
CancellationTokenSource
Signals to a CancellationToken that it should be canceled.
ChainedConfigurationProvider
Chained implementation of ConfigurationProvider.
ChainedConfigurationSource
Represents a chained Configuration as an ConfigurationSource.
ChangeToken
Propagates notifications that a change has occurred.
CommandLineConfigurationProvider
A command line based ConfigurationProvider.
CommandLineConfigurationSource
Represents command line arguments as an ConfigurationSource.
CompositeChangeToken
An ChangeToken which represents one or more ChangeToken instances.
Configuration
Represents a set of key/value application configuration properties.
ConfigurationBuilder
Represents a type used to build application configuration.
ConfigurationBuilderProperties
ConfigurationManager
ConfigurationManager is a mutable configuration object. It is both an ConfigurationBuilder and an ConfigurationRoot. As sources are added, it updates its current view of configuration.
ConfigurationPath
Utility methods and constants for manipulating Configuration paths
ConfigurationProvider
Provides configuration key/values for an application.
ConfigurationReloadToken
Implements ChangeToken.
ConfigurationRoot
Represents the root of an Configuration hierarchy.
ConfigurationSection
Represents a section of application configuration values.
ConfigurationSource
Represents a source of configuration key/values for an application.
ConfigurationSources
ConfigureContainerAdapter<TContainerBuilder>
ConfigureNamedOptions<TOptions>
Represents something that configures the TOptions type.
ConfigureOptions<TOptions>
Represents something that configures the TOptions type. Note: These are run before all PostConfigureOptions.
ConsoleLogger
A logger that writes messages in the debug output window only when a debugger is attached.
ConsoleLoggerProvider
The provider for the ConsoleLogger.
DebugLogger
A logger that writes messages in the debug output window only when a debugger is attached.
DebugLoggerProvider
The provider for the DebugLogger.
DefaultLoggerLevelConfigureOptions
Disposable
Provides a mechanism for releasing unmanaged resources.
Environments
Commonly used environment names.
EventId
Identifies a logging event.
FlutterApplicationLifetime
Allows consumers to be notified of application lifetime events.
FlutterHostingEnvironment
FlutterLifecycleObserver
Widget used to monitor lifecycle event changes
FlutterLifetime
FlutterLifetimeOptions
Options for configuring Flutter at runtime.
Host
A program abstraction.
HostApplicationBuilder
A builder for hosted applications and services which helps manage configuration, logging, lifetime and more.
HostApplicationBuilderSettings
Settings for constructing an HostApplicationBuilder.
HostApplicationLifetime
Allows consumers to be notified of application lifetime events. This interface is not intended to be user-replaceable.
HostBuilder
A program initialization abstraction.
HostBuilderAdapter
HostBuilderContext
Context containing the common services on the Host. Some properties may be null until set by the Host.
HostedService
Defines methods for objects that are managed by the host.
HostEnvironment
Provides information about the hosting environment an application is running in.
HostingEnvironment
HostLifetime
IServiceFactoryAdapter
JsonConfigurationParser
JsonConfigurationProvider
A JSON based ConfigurationProvider.
JsonConfigurationSource
Logger
Represents a type used to perform logging.
LoggerFactory
Represents a type used to configure the logging system and create instances of Logger from the registered LoggerProviders.
LoggerFactoryOptions
The options for a LoggerFactory.
LoggerFilterOptions
The options for a LoggerFilter.
LoggerProvider
Represents a type that can create instances of Logger.
LoggingBuilder
An interface for configuring logging providers.
MemoryConfigurationProvider
In-memory implementation of ConfigurationProvider
MemoryConfigurationSource
Represents in-memory data as an ConfigurationSource.
NullLogger
Minimalistic logger that does nothing.
NullLoggerFactory
An LoggerFactory used to create instance of NullLogger that logs nothing.
Options<TOptions>
Used to retrieve configured TOptions instances.
OptionsChangeTokenSource<TOptions>
Used to fetch ChangeToken used for tracking options changes.
OptionsFactory<TOptions>
Used to create TOptions instances.
OptionsMonitor<TOptions>
Used for notifications when TOptions instances change.
OptionsMonitorCache<TOptions>
Used by OptionsMonitor to cache TOptions instances.
OptionsSnapshot<TOptions>
Used to access the value of TOptions for the lifetime of a request.
PostConfigureOptions<TOptions>
Represents something that configures the TOptions type.
Scope
ServiceCollection
Specifies the contract for a collection of service descriptors.
ServiceDescriptor
Describes a service with its service type, implementation, and lifetime.
ServiceFactoryAdapter<TContainerBuilder>
ServiceProvider
Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.
ServiceProviderFactory<TContainerBuilder>
Provides an extension point for creating a container specific builder and an ServiceProvider.
ServiceProviderOptions
Options for configuring various behaviors of the default ServiceProvider implementation.
ServiceScopeFactory
A factory for creating instances of ServiceScope, which is used to create services within a scope.
StaticFilterOptionsMonitor
StreamConfigurationProvider
Stream based configuration provider
StreamConfigurationSource
Stream based ConfigurationSource.
ValidateOptions<TOptions>
Interface used to validate options.
ValidateOptions0<TOptions>
Implementation of ValidateOptions<TOptions>
ValidateOptions1<TOptions, TDep>
ValidateOptions2<TOptions, TDep1, TDep2>
ValidateOptions3<TOptions, TDep1, TDep2, TDep3>
ValidateOptions4<TOptions, TDep1, TDep2, TDep3, TDep4>
ValidateOptions5<TOptions, TDep1, TDep2, TDep3, TDep4, TDep5>
ValidateOptionsResult
Represents the result of an options validation.

Mixins

ConfigurationProviderMixin
Provides configuration key/values for an application.

Extensions

ChainedBuilderExtensions
Extension methods for adding Configuration to an ConfigurationBuilder.
CommandLineConfigurationExtensions
Extension methods for registering CommandLineConfigurationProvider with ConfigurationBuilder.
ConfigurationExtensions
Extension methods for configuration classes.
ConfigurationRootExtensions
Extension methods for ConfigurationRoot.
ConfigurationSectionExtensions
Extension methods for configuration section classes.
ConsoleLoggerFactoryExtensions
Extension methods for the LoggerFactory class.
DebugLoggerFactoryExtensions
Extension methods for the LoggerFactory class.
FilterLoggingBuilderExtensions
Extension methods for setting up logging services in an ServiceCollection.
FlutterHostBuilderExtensions
FlutterHostExtensions
HostEnvironmentEnvExtensions
Extension methods for HostEnvironment.
HostingAbstractionsHostBuilderExtensions
HostingAbstractionsHostExtensions
HostingEnvironmentExtensions
HostingHostBuilderExtensions
InternalConfigurationRootExtensions
Extensions method for ConfigurationRoot.
JsonConfigurationExtensions
Extension methods for adding JsonConfigurationProvider.
LoggerExtensions
LoggerFactoryExtensions
LoggerFactory extension methods for common scenarios.
LoggerFilterOptionsExtensions
LoggingBuilderExtensions
Extension methods for setting up logging services in a LoggingBuilder.
LoggingServiceCollectionExtensions
Extension methods for setting up logging services in a ServiceCollection.
LogLevelExtensions
MemoryConfigurationBuilderExtensions
ConfigurationBuilder extension methods for the MemoryConfigurationProvider.
OptionsBuilderExtensions
OptionsServiceCollectionExtensions
Extension methods for adding options services to the DI container.
ServiceCollectionContainerBuilderExtensions
Extension methods for building a ServiceProvider from a ServiceCollection.
ServiceCollectionDescriptorExtensions
Extension methods for adding and removing services to an ServiceCollection.
ServiceCollectionHostedServiceExtensions
ServiceCollectionServiceExtensions
Extension methods for adding services to a ServiceCollection.
ServiceProviderServiceExtensions
Extension methods for getting services from a ServiceProvider.
ServiceScopeFactoryExtensions
Extension methods for getting services from a ServiceScopeFactory.

Properties

applicationKey String
The configuration key used to set the application name.
read / write
contentRootKey String
The configuration key used to set the content root.
read / write
environmentKey String
The configuration key used to set the environment.
read / write

Functions

configurationKeyComparator(String? x, String? y) int
createApplicationBuilder({HostApplicationBuilderSettings? settings}) HostApplicationBuilder
createDefaultBuilder(Widget app, {ErrorHandler? errorHandler, FlutterErrorHandler? flutterErrorHandler, void services(ServiceCollection)?, void configuration(ConfigurationBuilder)?, void logging(LoggingBuilder)?, void environment(HostingEnvironment)?}) HostBuilder
createHostingEnvironment(Configuration hostConfiguration) HostEnvironment
populateServiceCollection(ServiceCollection services, HostBuilderContext hostBuilderContext, HostEnvironment hostingEnvironment, Configuration appConfiguration, ServiceProvider serviceProviderGetter()) → void
resolveContentRootPath(String? contentRootPath, String basePath) String
resolveHost(ServiceProvider serviceProvider) Host

Enums

LogLevel
ServiceLifetime
Specifies the lifetime of a service in a ServiceCollection.

Typedefs

CategoryLevelFilterAction = bool Function(String? category, LogLevel level)
ConfigureAppConfigurationDelegate = void Function(HostBuilderContext context, ConfigurationBuilder configuration)
ConfigureContainerAdapterDelegate<TContainerBuilder> = void Function(HostBuilderContext hostContext, TContainerBuilder containerBuilder)
ConfigureContainerDelegate<TContainerBuilder> = TContainerBuilder Function(HostBuilderContext context, TContainerBuilder builder)
ConfigureHostConfigurationDelegate = void Function(ConfigurationBuilder configuration)
ConfigureLoggerFactoryOptions = void Function(LoggerFactoryOptions options)
ConfigureLoggingBuilder = void Function(LoggingBuilder builder)
ConfigureOptionsAction1 = void Function(LoggerFilterOptions options)
ConfigureServicesDelegate = void Function(HostBuilderContext context, ServiceCollection services)
ContextResolver = HostBuilderContext? Function()
ErrorHandler = bool Function(Object error, StackTrace stackTrace)
FactoryResolver<TContainerBuilder> = ServiceProviderFactory<TContainerBuilder> Function(HostBuilderContext hostContext)
FilterAction = bool Function(String provider, String category, LogLevel level)
FlutterErrorHandler = void Function(FlutterErrorDetails details)
FlutterOptions = void Function(FlutterLifetimeOptions options)
ImplementationFactory = Object Function(ServiceProvider services)
LevelFilterAction = bool Function(LogLevel level)
LogFormatter<TState> = String Function(TState state, Exception? exception)
Function to create a String message of the state and exception.
ServiceProviderFactoryDelegate<TContainerBuilder> = ServiceProviderFactory<TContainerBuilder> Function(HostBuilderContext? context)
ValidationCallback0<TOptions> = bool Function(TOptions options)
ValidationCallback1<TOptions, TDep> = bool Function(TOptions options, TDep dependency)
ValidationCallback2<TOptions, TDep1, TDep2> = bool Function(TOptions options, TDep1 dependency1, TDep2 dependency2)
ValidationCallback3<TOptions, TDep1, TDep2, TDep3> = bool Function(TOptions options, TDep1 dependency1, TDep2 dependency2, TDep3 dependency3)
ValidationCallback4<TOptions, TDep1, TDep2, TDep3, TDep4> = bool Function(TOptions options, TDep1 dependency1, TDep2 dependency2, TDep3 dependency3, TDep4 dependency4)
ValidationCallback5<TOptions, TDep1, TDep2, TDep3, TDep4, TDep5> = bool Function(TOptions options, TDep1 dependency1, TDep2 dependency2, TDep3 dependency3, TDep4 dependency4, TDep5 dependency5)