nano_core library

Nano Core is a lightweight, reactive architecture framework and design system toolkit for Flutter multiplatform applications.

Classes

CustomState<T, Payload>
Custom state holding an arbitrary domain payload alongside optional data.
Disposable
If objects that are registered inside GetIt implements Disposable the onDispose method will be called whenever that Object is unregistered, reset or its enclosing Scope is popped
ErrorState<T>
Error state when an error occurs during execution.
GetIt
Very simple and easy to use service locator You register your object creation factory or an instance of an object with registerFactory, registerSingleton or registerLazySingleton And retrieve the desired object using get or call your locator as function as its a callable class Additionally GetIt offers asynchronous creation functions as well as functions to synchronize the async initialization of multiple Singletons
InitDependency
Data structure used to identify a dependency by type and instanceName
InitialState<T>
Initial state before any action is performed.
LoadedState<T>
Loaded state after an operation finishes and data is ready.
LoadingState<T>
Loading state while an asynchronous operation is in progress.
NanoAdapter<Entity>
A bidirectional contract combining NanoReadAdapter and NanoWriteAdapter.
NanoAnalyticsObserver
Contract defining an observer for application telemetry and analytics events.
NanoAnimatedRoute
A declarative route that uses a custom animation transition when navigated to.
NanoApp
The root application widget for apps using the nano-core framework.
NanoAppInfo
Lightweight utility to resolve application metadata at runtime without third-party dependencies.
NanoAuthInterceptor
An HTTP interceptor that automatically injects Bearer/Authorization tokens into outgoing requests and handles 401 Unauthorized responses.
NanoAuthRepository<Session extends NanoEntity>
An abstract repository for handling user authentication, session persistence, and token lifecycle management.
NanoBiometricOptions
Configuration options passed to NanoBiometrics.authenticate.
NanoBiometricProtectedRoute
A route guard wrapper that enforces biometric authentication for all child routes.
NanoBiometrics
An abstract contract defining cross-platform biometric authentication operations without direct native plugin dependencies.
NanoCache
An abstract contract defining key-value storage and retrieval for cached data.
NanoCommand<Output>
Base abstract class for encapsulated commands extending ValueNotifier holding NanoState.
NanoCommand0<Output>
Command with no arguments executing a parameterless action.
NanoCommand1<Argument, Output>
Command accepting a single argument of type Argument.
NanoCommandBuilder<Output>
A reactive widget builder responding to NanoCommand state changes.
NanoConnectivity
A reactive observable and contract representing application network connectivity.
NanoController<ViewState extends NanoViewState>
An abstract controller managing state NanoState for Flutter UI components.
NanoCorePlugin
Dart plugin entrypoint for Flutter platforms using dartPluginClass.
NanoCrashObserver
Contract defining an observer for crash reporting, fatal errors, and diagnostics breadcrumbs.
NanoCursorPagination
Cursor and token based pagination strategy.
NanoDataStrategy
Strategy for extracting list payloads and pagination metadata from raw HTTP responses.
NanoDebouncer
A utility class that delays invoking a callback until after a specified duration has elapsed since the last time it was invoked.
NanoDefaultInjections
Default dependency injection container for framework-level services.
NanoDetailsRoute<Args>
A specialized declarative route for details and sub-pages.
NanoEntity<ID>
Base class for domain entities with an optional unique identifier.
NanoEnvironment
Utility for querying runtime environment flags, build modes, and compile-time environment variables with automatic production/development detection.
NanoEquatable
Base class providing value-based equality comparison for objects.
NanoErrorPage
The default error and not-found page displayed by NanoRouter.
NanoFailure<Success, Failure>
Represents a failed computation outcome holding error of type Failure.
NanoForm
A reactive container widget that binds a NanoFormController.formKey to a Flutter Form widget for seamless form validation and lifecycle management.
NanoFormController<ViewState extends NanoFormState<FormEntity>, FormEntity extends NanoFormEntity>
A specialized NanoController for form workflows managing an immutable NanoFormState holding a NanoFormEntity with integrated form key validation and lifecycle management.
NanoFormEntity
An abstract base class for immutable form data entities.
NanoFormState<FormEntity extends NanoFormEntity>
An abstract base state representing an immutable view state containing a strongly-typed form entity.
NanoGroupRoute
A route grouping container that prepends a path prefix to all child routes without rendering a standalone page of its own.
NanoHttpClient
An abstract interface defining the standard contract for HTTP clients.
NanoHttpCode
Standard HTTP Status Codes constants for easy reference.
NanoHttpInterceptor
Contract for intercepting and transforming HTTP requests, responses, and errors.
NanoHttpLogInterceptor
An out-of-the-box HTTP interceptor that formats and logs network requests, responses, and errors using NanoLogger.
NanoHttpRequest
Represents an HTTP request payload processed by NanoHttpClient and its interceptors.
NanoHttpResponse<T>
A standardized generic response object for all HTTP requests.
NanoInjections
An abstract class to manage dependency injection scopes using GetIt.
NanoListenableAdapter<ViewState extends NanoViewState>
A generic reactive adapter bridging any Listenable (such as MobX, Signals, ValueNotifier, or ChangeNotifier) into a NanoStateObservable.
NanoLoadingOverlay
Full-screen or container loading overlay widget for page-level state loading or custom views.
NanoLogEntry
Represents a structured log record captured by NanoLogger.
NanoLogFilter
Defines which NanoLogLevel entries are allowed to be emitted by NanoLogger.
NanoLogger
Central structured logger for the nano-core ecosystem.
NanoMemoryCache
An in-memory, thread-safe NanoCache implementation with TTL expiration.
NanoMessageKey
Represents a message (error, warning, success) passed in states. Can be implemented by enums for localized keys or classes.
NanoNavigationEvent
Represents a one-shot reactive navigation event emitted by a controller.
NanoOAuth
Central utility for constructing standardized OAuth 2.0 authorization URLs, token request payloads, and PKCE parameters across any identity provider.
NanoOAuthCallback
Parsed response from an OAuth 2.0 authorization redirect or deep link.
NanoOffsetPagination
Page and limit based pagination strategy (Offset-based).
NanoPaginatedListView<T>
A reactive ListView that automatically binds to a NanoPaginator to handle infinite scrolling, bottom loading indicators, and pull-to-refresh.
NanoPaginatedResult<Entity>
Represents a typed list response along with pagination and domain metadata.
NanoPagination
An abstract contract defining pagination parameters for HTTP requests.
NanoPaginationBar<T>
A reactive pagination navigation control bar that binds to a NanoPaginator with full UI customizability for next/previous buttons, page labels, and dynamic page size selection.
NanoPaginationMeta
Holds extracted pagination metadata from a response payload or headers.
NanoPaginator<T>
A stateful pagination controller that manages page loading, accumulated items, next-page progression, total counts, and loading/error states.
NanoPaths
Standard default paths used across nano-core routing.
NanoPkce
Cryptographically secure OAuth 2.0 PKCE (Proof Key for Code Exchange) generator conforming to RFC 7636.
NanoPoweredBy
A lightweight, customizable branding widget to display developer or organization attribution in drawers, footers, or settings pages.
NanoProtectedRoute
A route guard wrapper that enforces synchronous access permissions for all child routes.
NanoReadAdapter<Entity>
An abstract contract to deserialize JSON maps into domain entities.
NanoRedirectRoute
A route that redirects navigation from path to redirectTo.
NanoRepository<Entity extends NanoEntity<Id>, Id>
An abstract generic repository providing standard CRUD operations with optional caching, pagination, and type-safe query adapters.
NanoResponsiveBuilderLayout
Internal adaptive widget that selects between mobile, desktop, and optional tablet widget builders based on the active screen viewport.
NanoResponsiveFlexConfig
Configuration options for responsive flex layout components (NanoResponsiveLayout.flex).
NanoResponsiveFlexLayout
Internal adaptive flex widget that renders children as a Row on desktop/tablet viewports and as a Column on mobile viewports.
NanoResponsiveLayout
A canonical responsive layout widget for the Nano ecosystem.
NanoResult<Success, Failure>
A functional representation of either a successful outcome with data of type Success or a failure with an error of type Failure.
NanoRoute
Represents a standard declarative route with a widget builder in NanoRouter.
NanoRouteArgs
Holds arguments passed to a route during navigation.
NanoRouteBase
Base abstract class for all declarative routes within NanoRouter.
NanoRouteCode
Represents route status codes in nano-core.
NanoRouteError
Represents an error or access restriction during route resolution.
NanoRouteGuard
An abstract base class for route guards that intercept navigation and enforce access rules before rendering child routes.
NanoRouteObserver
A specialized navigation observer providing high-level callbacks for route lifecycle, screen tracking, and telemetry in nano-core.
NanoRouter
Central declarative router manager for Flutter applications.
NanoScaffold<ViewState extends NanoViewState, MessageKey extends NanoMessageKey>
NanoScaffold is the reactive base page layout structure in nano-core.
NanoScaffoldBuilder<ViewState extends NanoViewState>
The presentation builder widget composing the layout structure for NanoScaffold.
NanoScaffoldHeader<ViewState extends NanoViewState>
A PreferredSizeWidget managing top navigation bar headers in NanoScaffold.
NanoScreenContext
Contextual helper that exposes viewport dimensions, device categories, and responsive value evaluation methods bound to a BuildContext.
NanoSearchRepository<Entity extends NanoEntity<Id>, Id, Query>
A specialized generic repository supporting strongly-typed query and filter parameters.
NanoShell
Helper utility for accessing NanoShellController from the widget tree.
NanoShellContext
Contextual helper that exposes actions and state of the nearest NanoShellScaffold.
NanoShellController<TTab extends Enum, TSubView>
A strongly typed reactive controller for managing tabs and contextual sub-views in a NanoShellScaffold.
NanoShellRoute<TTab extends Enum, TSubView>
A declarative shell route for NanoRouter that manages persistent primary tabs and contextual sub-views.
NanoShellScaffold<TTab extends Enum, TSubView>
A comprehensive, reactive navigation shell scaffold.
NanoShellSubView<TSubView>
Represents a secondary contextual sub-view within a NanoShellScaffold that shares the same persistent shell (e.g. Notifications, Search overlay).
NanoShellTab<TTab extends Enum>
Represents a primary persistent tab within a NanoShellScaffold.
NanoShimmer
A lightweight, GPU-accelerated wave gradient animation widget.
NanoSkeleton
Design system skeleton placeholder widget.
NanoState<T>
Base sealed class representing the state of an operation or UI component.
NanoStateObservable<ViewState extends NanoViewState>
An abstract interface contract representing any state holder or reactive stream that can be observed by NanoScaffold.
NanoStatePage<PageWidget extends StatefulWidget, Controller extends NanoController<NanoViewState>>
A base state class for StatefulWidget views integrating NanoController and NanoInjections.
NanoStorage
An abstract interface defining the standard contract for durable key-value storage persistence without time-to-live expirations.
NanoStreamAdapter<ViewState extends NanoViewState, StreamEvent>
A generic reactive adapter bridging any Stream (such as BLoC, Cubit, RxDart, or WebSocket streams) into a NanoStateObservable.
NanoSuccess<Success, Failure>
Represents a successful computation outcome holding data of type Success.
NanoTelemetry
Central facade and dispatcher for application telemetry, analytics, and crash reporting.
NanoTextField
A Material text field component supporting value synchronization, validation with BuildContext internationalization, auto-validation modes, password visibility toggling, and native Form integration.
NanoThemeContext
Contextual helper that exposes theme data, color scheme, text styles, and theme brightness checks bound to a BuildContext.
NanoToast
Smart multiplatform Toast notification component for Web, Desktop, and Mobile.
NanoValidator
Collection of standard, chainable form field validators with full internationalization (BuildContext) support.
NanoValidatorConstants
Length and structural boundary constants for standard form validations.
NanoValidatorRegex
Pre-compiled regular expressions for high-performance form field validation.
NanoViewState
An abstract base class for structured View/Page state data.
NanoWriteAdapter<Entity>
An abstract contract to serialize domain entities into JSON maps.
ObjectRegistration<T extends Object>
ShadowChangeHandlers
If an object implements the ShadowChangeHandler if will get notified if an Object with the same registration type and name is registered on a higher scope which will shadow it. It also will get notified if the shadowing object is removed from GetIt
SuccessState<T>
Success state after an operation completes successfully with a feedback key.
WarningState<T>
Warning state when an operation completes with non-fatal warnings.
WillSignalReady
If your singleton that you register wants to use the manually signalling of its ready state, it can implement this interface class instead of using the signalsReady parameter of the registration functions (you don't really have to implement much ;-) )

Enums

NanoAutoValidateMode
Defines when form fields trigger and display validation errors.
NanoBiometricType
Represents the biometric modality types supported across platforms.
NanoCachePolicy
Defines how repository requests interact with the caching layer.
NanoConnectivityStatus
Enum representing the network connectivity status of the application.
NanoDeviceType
Enum representing the target platform or device category.
NanoEnvironmentType
Represents standard Flutter compilation and execution modes.
NanoLogLevel
Represents the severity level and category of a log entry in NanoLogger.
NanoNavigationMode
Defines the transition mode for a reactive navigation event in nano_core.
NanoOAuthGrantType
Standard OAuth 2.0 grant types supported across modern identity providers.
NanoPkceMethod
Supported OAuth 2.0 PKCE code challenge methods (RFC 7636).
NanoShimmerDirection
Direction of the shimmer wave animation.
NanoToastType
Enum representing the visual type of a NanoToast.
ObjectRegistrationType
You will see a rather esoteric looking test (const Object() is! T) at several places. It tests if T is a real type and not Object or dynamic. For each registered factory/singleton an ObjectRegistration<T> is created it holds either the instance of a Singleton or/and the creation functions for creating an instance when get is called

Extensions

NanoContextExtensions on BuildContext
Ergonomic contextual extensions on BuildContext providing isolated namespaces for screen responsiveness and visual theming.
NanoDateTimeExtension on DateTime
Ergonomic extension methods on DateTime for universal timestamp conversions and calendar calculations.
NanoEnumIterableExtension on Iterable<T>
Extension on Iterable of Enum for safe, nullable lookup by name.
NanoHttpResponseExtension on NanoHttpResponse
Helper extension to easily evaluate HTTP status codes.
NanoIterableExtension on Iterable<T>
Extension on Iterable for safe querying without external dependencies.
NanoMapExtension on Map<String, dynamic>
Extension on Map for fluent and conditional entry additions.
NanoNavigationExtension on BuildContext
Navigation convenience extensions on BuildContext.
NanoStringExtension on String?
Extension on nullable String for ergonomic parsing without manual checks.

Functions

throwIf(bool condition, Object error) → void
Two handy functions that help me to express my intention clearer and shorter to check for runtime errors
throwIfNot(bool condition, Object error) → void

Typedefs

DisposingFunc<T> = FutureOr Function(T param)
Signature for disposing function because closures like (x){} have a return type of Null we don't use FutureOr<void>
FactoryFunc<T> = T Function()
Signature of the factory function used by non async factories
FactoryFuncAsync<T> = Future<T> Function()
Signature of the factory function used by async factories
FactoryFuncParam<T, P1, P2> = T Function(P1 param1, P2 param2)
For Factories that expect up to two parameters if you need only one use void for the one you don't use
FactoryFuncParamAsync<T, P1, P2> = Future<T> Function(P1 param1, P2 param2)
For async Factories that expect up to two parameters if you need only one use void for the one you don't use
NanoBiometricAuthBuilder = Widget Function(BuildContext context, VoidCallback onAuthenticate, VoidCallback onCancel)
Signature for custom biometric authentication view builder.
NanoBiometricOptionsBuilder = NanoBiometricOptions Function(BuildContext context)
Signature for resolving biometric options via BuildContext.
NanoCoreInjections = NanoDefaultInjections
Convenient type alias for NanoDefaultInjections.
NanoEnv = NanoEnvironment
A concise alias for NanoEnvironment.
NanoLog = NanoLogger
A convenient, concise alias for NanoLogger.
NanoPageFetcher<T> = FutureOr Function(NanoPagination pagination)
Signature for asynchronous page fetching functions returning either a NanoPaginatedResult or a raw List.
NanoResponsiveWidgetBuilder = Widget Function(BuildContext context)
Signature for a responsive widget builder function.
NanoValidatorFunction<Value> = String? Function(Value? value)
Signature for validator functions returning an error message if invalid, or null if valid.
NLog = NanoLogger
An ultra-concise alias for NanoLogger.
ScopeDisposeFunc = FutureOr Function()
Signature for disposing function on scope level

Exceptions / Errors

NanoHttpError
Represents an error or exception during HTTP execution.
WaitingTimeOutException