nano_core 0.9.1
nano_core: ^0.9.1 copied to clipboard
A lightweight reactive architecture framework and design system toolkit for Flutter multiplatform applications.
Changelog #
All notable changes to the nano_core project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.9.1 - 2026-09-05 #
Deprecated #
NanoNavigationExtensionlegacy helpers:context.toTab(...),context.toSubView(...),context.closeSubView(), andcontext.currentTab<T>()are now deprecated in favor ofcontext.shell.*methods with zero breaking changes for existing codebases.
Added #
NanoRouteBase: Abstract base contract for all declarative router definitions (NanoRoute,NanoShellRoute,NanoProtectedRoute,NanoGroupRoute,NanoRedirectRoute). Unifies route handling across the framework, enabling polymorphic route grouping, modular feature route lists, and allowingNanoProtectedRouteto guard both standard routes and full multi-tabNanoShellRoutedefinitions.NanoShellRoute: Declarative shell route forNanoRouterthat decouples routing configuration from UI layouts viabuilder: (context, controller, body) => Widget, enabling clean page wrappers (HomePage), bottom navigation bars, floating action docks, and desktop sidebars without leaking Scaffold parameters into router tables.NanoRoutershells: Dedicated parameter onNanoRouterto register persistent shell routes (List<NanoShellRoute>) alongside standardroutes(List<NanoRouteBase>).NanoShellContext&context.shell: Dedicated, clean BuildContext namespace for shell navigation and state queries (context.shell.selectTab(...),context.shell.openSubView(...),context.shell.closeSubView(),context.shell.isSubViewOpen(),context.shell.currentTab<T>(), andcontext.shell.activeSubView<T>()).- Unregistered Tab & Sub-View Debug Assertions:
NanoShellScaffoldnow asserts with actionable error messages when attempting to navigate to an unregistered tab or sub-view enum, eliminating silent fallbacks to index 0 during development.
0.9.0 - 2026-09-04 #
Added #
NanoShellScaffold,NanoShellTab, andNanoShellSubView: Zero-dependency persistent navigation shell scaffold managing primary tabs with keep-alive (maintainState), optional contextual sub-views (e.g. notifications/search overlays), persistent floating action buttons, drawers, headers, and automatic back-gesture handling (enablePopScope).NanoShellController,NanoShell.of(context), andNanoNavigationExtensionhelpers (context.toTab(...),context.toSubView(...),context.closeSubView(),context.currentTab<T>()): Fluid BuildContext navigation extension to seamlessly switch shell tabs and open/close sub-views without requiringStatefulWidgetor manualsetState.NanoScaffold&NanoScaffoldBuilder:floatingActionButtonLocationparameter to customize the positioning of the floating action button (e.g.FloatingActionButtonLocation.centerFloat).
0.8.0 - 2026-09-04 #
Breaking Changes #
NanoAuthRepository: Removed requiredendpointparameter from the constructor to allow provider-specific and action-specific URLs. RenamedtokenKeyandrefreshTokenKeytotokenStorageKeyandrefreshTokenStorageKey(along withdefaultTokenStorageKey = 'auth.access_token'anddefaultRefreshTokenStorageKey = 'auth.refresh_token') for clear semantic distinction between local storage keys and API payload keys.NanoLogLevel: Removed legacy numericpriorityfield in favor of declarative set-based level filtering viaNanoLogFilter.
Added #
NanoLogFilter: Granular, type-safe log level filtering with built-in presets (.all(),.none(),.onlyErrors(),.errorsAndWarnings(),.onlyHttp(), and.only(...)).NanoLogger.init(...): Centralized initialization method with named parameters forfilter,enabled,showTimestamp,showColors,maxStackTraceLines,customPrinter, andonErrortelemetry hooks.NanoLogger.setFilter(...): Dynamic runtime log filter switcher.NanoLogger.enable()/NanoLogger.disable(): Expressive helpers to activate/deactivate logger output.NanoLogger.mute()/NanoLogger.unmute(): Semantic aliases fordisable()andenable().NanoLogger.reset(): Resets all global logger configurations back to their default state.NanoEnvironment.getDouble(key, {defaultValue}): Strongly-typed compile-time double parser from--dart-definewith fallback.NanoEnv: Ultra-concise typedef alias forNanoEnvironment.NanoPkce: Cryptographically secure OAuth 2.0 PKCE generator conforming to RFC 7636 (codeVerifier,codeChallenge,state,nonce,.generate(),.createChallenge(), and.randomString()).NanoPkceMethod: Supported PKCE code challenge algorithm methods (.s256and.plain).NanoOAuthGrantType: Enumeration of the 5 industry-standard OAuth 2.0 grant types (authorizationCode,refreshToken,password,clientCredentials,deviceCode).NanoOAuthCallback: Safe OAuth redirect and deep link parser with anti-CSRF state validation (.fromUri(),.fromUrl(),isSuccess,isValidState()).NanoOAuth: Central utility to construct standardized authorization URLs and token exchange request payloads across all OAuth grant types with zero external dependencies.
Fixed #
NanoScaffold: Fixed reactive state observation by triggeringsetState(() {})in_onStateChangedwithmountedcheck, ensuring layouts properly rebuild and dismiss loading overlays when the controller emits new states.
0.7.0 - 2026-09-03 #
Breaking Changes #
NanoReadAdapter: Subclasses now implement abstractfromMap(Map<String, dynamic> map)for pure dictionary mapping. The framework provides safe dynamicfromMapOrNull(dynamic map)(returningEntity?) andfromList(dynamic jsonList).NanoWriteAdapter: Subclasses now implement abstracttoMap(Entity entity)for dictionary serialization, with built-intoList(List<Entity>? list).NanoAdapter: Refactored to combineNanoReadAdapter(fromMap) andNanoWriteAdapter(toMap).NanoRepository:getAll(...)now returnsFuture<NanoPaginatedResult<Entity>>instead ofFuture<List<Entity>>. Entities can be accessed viaresult.itemsor direct indexing (result[0],result.length,result.isEmpty).NanoSearchRepository:searchAll(...)now returnsFuture<NanoPaginatedResult<Entity>>instead ofFuture<List<Entity>>.NanoController:initialStateis now arequirednamed parameter (NanoController({required ViewState initialState})), ensuring controllers never operate with uninitialized null states and powering the type-safe nativeviewStategetter. Subclasses should passsuper.initialState = const MyViewState().NanoFormController:initialStateis now arequirednamed parameter (NanoFormController({required super.initialState})), replacing the previousinitialData.SuccessState: Changed constructor from positionalSuccessState(data)to named parametersSuccessState({this.key, this.data})and transitiontoSuccess({key, data}). UseLoadedState(data)for general loaded data without triggering feedback toasts.NanoScaffold:onCustomSuccesscallback signature changed fromvoid Function(String message)?to strongly typedvoid Function(MessageKey? success)?for consistency withonCustomErrorandonCustomWarning.NanoQueryAdapter: Removed in favor ofNanoWriteAdapterwithtoMap(query)to unify all Dart-to-Map / serialization operations.NanoSearchRepository:queryAdapternow accepts aNanoWriteAdapter<Query>callingtoMap(query)for query parameters serialization.NanoViewState: MadeList<Object?> get propsan abstract member, enforcing explicit property declarations across allNanoViewStateimplementations for value equality.NanoRepository: Removed redundantfetchListmethod in favor of the unifiedgetAll(...)method.NanoSearchRepository: Renamedsearch(...)tosearchAll(...)for naming consistency withgetAll(...).
Added #
NanoPaginatedResult: Encapsulates strongly typed entity lists alongside pagination metadata (totalCount,currentPage,totalPages,hasNext,nextCursor, andmeta).NanoDataStrategy: Configurable response extraction strategy supporting un-enveloped raw arrays (.raw()), JSON:API / Laravel envelopes (.data()), Django REST (.results()), Google Cloud APIs (.items()), custom keys (.key('custom')), and custom extractors (.custom(...)).NanoPaginationMeta: Public model for extracted pagination metadata from JSON payloads or HTTP headers.NanoDefaultInjections: AddeddataStrategyparameter for application-wide response strategy configuration.CustomState: AddedCustomState<T, Payload>andtoCustom<Payload>(payload)transition to allow arbitrary domain events, statuses, or semantic state extensions.NanoController: AddedemitCustom<Payload>(payload, {data})helper method for triggering custom domain states and side-effects.NanoController: Added nativeviewStategetter to access current strongly typed view state without requiring local mutable variables.InitialState: Added optionaldataparameter to initialize and preserve initial view state models, along withtoInitial({data})transition.NanoController: Added convenience state emitting methodsemitInitial({data}),emitLoaded(data),emitLoading({data}),emitSuccess({key, data}),emitError({key, data}),emitWarning({key, data}), andemitCustom(payload).NanoScaffold: Addedlistenercallback (void Function(BuildContext, NanoState<ViewState>)) for side-effects such as navigation, dialogs, and analytics.NanoAuthRepository: AddedrefreshSession()method to standardize token renewals using storedrefreshToken.NanoScaffold: AddeddefaultErrorMessageanddefaultWarningMessageparameters for fallback notification messages, and ensured empty messages never display blank toast cards.NanoState: Subclasses now extendNanoEquatablewith value equality ondataandkeypayloads.NanoEntity: Madeidoptional (final ID? id;withconst NanoEntity({this.id});) for enhanced flexibility with nested sub-entities, drafts, and value models.NanoInjections: Added support for asynchronous dependency bindings (FutureOr<void> binds(GetIt i)) with automatic scope and singleton resolution.NanoMapExtension: Added.add(key, value)and.addIf(key, value, {condition, skipEmpty})extensions onMap<String, dynamic>for fluent, conditional, and null/empty-safe map construction.NanoReadAdapter: Interface for read-only deserialization (fromMap) with built-in safe dynamic parser (fromMapOrNull(dynamic map)) and list deserialization (fromList(dynamic jsonList)).NanoWriteAdapter: Interface for write-only serialization (toMap) with built-in list serialization (toList(List<Entity>? list)).NanoAdapter: Refactored to implement bothNanoReadAdapterandNanoWriteAdapterfor bidirectional models.NanoRepository: AcceptsNanoReadAdapterfor read-only endpoints without requiring unusedtoMap, with optionalNanoWriteAdapterfor write operations; automatically unwraps both raw lists and nested data maps ({"data": [...]}).
0.6.0 - 2026-09-02 #
Breaking Changes #
NanoAuthRepository: UsesNanoStorageinstead ofNanoCachefor non-volatile token persistence.NanoController:init(String? id)is now an abstract method requiring explicit implementation across all controllers extendingNanoController.NanoCommand:NanoCommand0.run()is now parameterless andNanoCommand1.run(arg)accepts only the action argument; callbacks (onSuccess,onError) andemitLoadingOnRequestare now configured declaratively at creation time.NanoCommand: Renamedexecute(...)torun(...)for triggering encapsulated actions with automatictoLoadedtransition.NanoState: AddedLoadedState<T>to the sealed class hierarchy (requires handlingLoadedStatein exhaustive pattern matching switch expressions).
Added #
NanoStorage: Standardized contract for durable key-value persistence without TTL expiration.LoadedState<T>andtoLoaded(data)toNanoStatehierarchy for regular data-ready states without triggering feedback toasts.onSuccessandonErroroptional callbacks toNanoController.execute.emitLoadingOnRequestparameter (defaults totrue) toNanoController.executefor customizable loading emissions.- Generic
execute<T>inNanoControllerreturning typed results directly intoonSuccess(T result). NanoController: AddednanoCommand0andnanoCommand1factory methods for creating encapsulated commands with declarative callbacks and automatic lifecycle disposal.- Granular customizable endpoint methods in
NanoRepository(endpointGetAll,endpointGetById,endpointCreate,endpointUpdate,endpointDelete,fetchList) andNanoSearchRepository(endpointSearch). NanoAuthRepository<Session>: Standardized base authentication repository for session restoration, token persistence (saveToken,clearSession,isAuthenticated), and lifecycle management.NanoAuthInterceptor: Out-of-the-box HTTP interceptor for automatic Bearer token injection usingNanoAuthRepositoryas the single source of truth, path exclusion, and automatic 401 handling.NanoInjections: Added callablecall()invocation allowingawait const AppInjections()()and automaticGetIt.allReady()resolution without manual boilerplate.NanoDefaultInjections: AddedstorageandauthRepositoryparameters toinit,register, andbindsfor automatic container registration.NanoEnvironment: Utility with compile-time environment flags (isProduction,isDevelopment,isProfile),--dart-definevariable getters, and automatic execution mode detection.NanoHttpClient: Added constructorinterceptorsparameter for declarative pipeline registration at initialization.
Changed #
NanoScaffold: Success state transitions no longer automatically display default text toasts fromViewStatemodels.
0.5.0 - 2026-09-01 #
Added #
NanoDebouncer: Flexible async execution delay for search inputs, autocomplete, and live filters with nativeNanoTextField(debounceDuration: ...)integration.NanoConnectivity&NanoConnectivityStatus: Zero-dependency cross-platform reactive network monitor supporting Wi-Fi, Cellular (4G/5G), Ethernet, Bluetooth, VPN, and Offline states.connectivityregistration support inNanoDefaultInjections.initandNanoDefaultInjections.register.
Changed #
- Clean Code Generics Refactor: Standardized descriptive and semantic generic type parameters across all classes and adapters (
ViewState,MessageKey,Entity,Id,Query,Success,Failure,FormEntity,Args,Output,PageWidget). - Simplified
NanoScaffoldlayout slots into unified builders (header,drawer,footer,floatingActionButton,builder). - Integrated
NanoConnectivityobservation and customconnectivityBuilderdirectly intoNanoScaffold. - Enforced strict arrow function syntax (
=>) for all single-line methods across the framework.
0.5.0 (2026-09-01) #
- Clean Code Generics Refactor: Standardized descriptive and semantic generic type parameters across all classes and adapters (
ViewState,MessageKey,Entity,Id,Query,Success,Failure,FormEntity,Args,Output,PageWidget). NanoDebouncer: Flexible async execution delay for search inputs, autocomplete, and live filters with nativeNanoTextField(debounceDuration: ...)integration.NanoConnectivity&NanoConnectivityStatus: Zero-dependency cross-platform reactive network monitor supporting Wi-Fi, Cellular (4G/5G), Ethernet, Bluetooth, VPN, and Offline states.- Simplified
NanoScaffoldlayout slots into unified builders (header,drawer,footer,floatingActionButton,builder). - Integrated
NanoConnectivityobservation and customconnectivityBuilderdirectly intoNanoScaffold. - Added
connectivityregistration support toNanoDefaultInjections.initandNanoDefaultInjections.register. - Enforced strict arrow function syntax (
=>) for all single-line methods across the framework.
0.4.0 - 2026-08-31 #
Added #
NanoDefaultInjections: Central default dependency injection container withNanoDefaultInjections.init(i, client: ..., pagination: ..., cache: ...)andregister()helpers for framework-level services.NanoCache,NanoCachePolicy&NanoMemoryCache: Built-in zero-dependency caching layer with configurable policies (cacheFirst,networkFirst,networkOnly,cacheOnly), TTL expiration, and automatic cache invalidation on mutations.NanoResult,NanoSuccess&NanoFailure: Functional result pattern using Dart 3 sealed class hierarchy with compile-time pattern matching,fold,map,mapError, andrunAsyncsafe execution helpers.NanoFormEntity,NanoFormState&NanoFormController: Strongly-typed immutable form state management system withcopyWith,updateFormlifecycle, and reactive state emissions.NanoValidator: Rich collection of chainable form validators (required,email,minLength,maxLength,min,max,pattern,match,cpf,cnpj,custom) with dynamicBuildContextinternationalization (i18n) support.NanoAutoValidateMode: Granular validation trigger modes (onSubmit,onUserInteraction,onFocusLost,always,disabled).NanoTextField: Reactive text field UI component with automatic controller/focus synchronization, password visibility toggle, and localized error rendering.NanoPagination,NanoOffsetPagination&NanoCursorPagination: Universal pluggable pagination contracts for Offset/Page-based and Cursor/Token-based strategies.NanoPaginator: Stateful pagination controller managing page progression, accumulated items, and async page lifecycle.NanoPaginatedListView: Reactive component widget for automatic infinite scrolling, pull-to-refresh, bottom spinner loading, and empty/error state handling.NanoPaginationBar: Reactive component navigation bar with next/previous page triggers, page indicators, and dynamicpageSizeselector.NanoQueryAdapter: Dedicated abstract contract for serializing strongly-typed query and filter models into URL query parameters without forcing unused JSON deserialization.NanoSearchRepository: Specialized generic repository requiring aNanoQueryAdapterto perform type-safe query searches viasearch(Q query).
Changed #
- Integrated
paginationparameter intoNanoRepository.getAllandNanoSearchRepository.search. - Made
clientparameter optional inNanoRepositoryandNanoSearchRepositorywith automatic fallback toGetIt.I<NanoHttpClient>().
0.3.0 - 2026-08-31 #
Added #
NanoRouteObserver: Dedicated navigation observer with granular callbacks (onRouteChange,onRoutePushed,onRoutePopped,onRouteReplaced,onRouteRemoved) for screen analytics, telemetry, and logging.observersproperty onNanoRouterand automated observer forwarding inNanoApp.NanoHttpInterceptor: Extensible contract for intercepting and mutating HTTP requests, responses, and handling errors (JWT injection, refresh tokens, retries).NanoHttpRequestandNanoHttpError: Standardized immutable and equatable models for HTTP requests and structured network errors.NanoHttpLogInterceptor: Ready-to-use HTTP traffic logger for requests, responses, headers, bodies, and exceptions in developer tools.NanoLogger: Central structured logger with severity levels (debug,info,success,warning,error,http), ANSI terminal styling, method tracking, data payloads, and global telemetry hooks (onError,customPrinter).NanoStateObservable: Universal abstract state contract allowingNanoScaffoldto observe any state management approach (BLoC, Cubit, MobX, Signals, or customChangeNotifieradapters).NanoStreamAdapter: Generic adapter bridging anyStream(BLoC, Cubit, RxDart, WebSockets) intoNanoStateObservable.NanoListenableAdapter: Generic adapter bridging anyListenable(MobX, Signals, ValueNotifier, ChangeNotifier) intoNanoStateObservable.
Changed #
- Decoupled
NanoScaffold'scontrollerparameter to accept anyNanoStateObservable<T>. - Implemented
NanoStateObservable<T>onNanoController<T>.
0.2.0 - 2026-08-30 #
Added #
NanoApp: Root application widget that automatically configuresNanoRouter,MaterialApp, themes, and localizations.- Declarative routing architecture with
NanoRouter,NanoRoute,NanoAnimatedRoute,NanoDetailsRoute,NanoGroupRoute,NanoProtectedRoute,NanoRedirectRoute,NanoPaths,NanoRouteArgs,NanoRouteCode, andNanoRouteError. NanoAnimatedRoute: Predefined animated route transitions (fade,slideUp,slideRight,scale) and customtransitionBuildersupport.NanoProtectedRoute: Route guard wrapper with inheritance support protecting nested routes and redirecting unauthorized users.NanoDetailsRoute<T>: Specialized typed detail routes with automated generic argument extraction.NanoGroupRoute: Path-only route grouping without standalone page rendering.NanoGuardedPage&NanoErrorPage: Dedicated widget classes for route guard evaluation and custom 404/error pages.- Navigation extensions on
BuildContext(toNamed,toReplacementNamed,toAndRemoveUntilNamed,back,routeArgs). NanoScaffoldBuilder&NanoScaffoldHeader: Dedicated presentation widget components replacing inline builder helper functions.loadingWidgetproperty onNanoScaffoldandchildonNanoLoadingOverlayfor fully customizable loading states.- Modular
NanoInjectionscomposition support and pattern demonstration in example.
0.1.0 - 2026-08-29 #
Breaking Changes #
NanoController<T>: Now strictly enforcesT extends NanoViewState. Primitive types (String,int, etc.) or arbitrary unbounded types are no longer permitted as state data models.NanoScaffold<T, M>: Builder signature updated fromWidget Function(BuildContext, Widget?)toWidget Function(BuildContext, NanoState<T>)allowing direct reactive state access. Added support for typed message keysM extends NanoMessageKeyand dynamic builders (headerBuilder,footerBuilder,drawerBuilder,floatingActionButtonBuilder).NanoStatePage<W, C>: Generic parameter forNanoInjectionsremoved.injectionsis now an abstract getterNanoInjections get injections;with automatic GetIt scope initialization (initScope) and teardown (dropScope).
Added #
NanoHttpClientinterface defining standardized HTTP client contracts.NanoHttpResponsegeneric response model withNanoHttpResponseExtensionhelpers (isSuccess,isClientError,isServerError).NanoHttpCodestatus code constants.NanoAdapterabstract generic model adapter for JSON serialization and deserialization.NanoEntitybase generic entity with unique identifier and value equality.NanoRepositorybase generic CRUD repository with automated serialization.NanoViewStatebase class enforcing structured, equatable view state models forNanoController.
Removed #
NanoStateContentin favor of the standardizedNanoViewState.
0.0.5 - 2026-08-27 #
Added #
- GitHub repository link to header of
example/lib/main.dart. - Full internationalization (l10n) support in
examplewithflutter_localizationsandintl.
Changed #
NanoMessageKeyrefactored to useString Function(BuildContext) get messageinstead ofString get messageto allow highly decoupled, on-demand localization via Context.NanoStatenow defineskeyas a nullableNanoMessageKey?, removing the need for mandatory wrappers.NanoScaffoldandStateSimulatorCardupdated to callmessage(context)and elegantly fallback when no key is provided.
0.0.4 - 2026-07-28 #
Added #
- Strict linting rules in
analysis_options.yaml(sort_constructors_first,sort_unnamed_constructors_first,lines_longer_than_80_chars,always_declare_return_types,prefer_single_quotes, andunawaited_futures).
Changed #
- Constructors reordered across core classes to satisfy
sort_constructors_first. example/**directory excluded from strict documentation linting while preserving 100% strict Dartdoc enforcement on corelib/package APIs.
0.0.3 - 2026-07-28 #
Added #
- Complete explicit Dartdoc constructor documentation across
NanoController,NanoLoadingOverlay,NanoScaffold,NanoStatePage, andNanoToastto pass pub.dev Pana analysis checks. - Showcase
exampleapp re-architected into clean modular feature layers followingnano-budgetsdesign (app/core/theme,app/pages/showcase/widgets). - Package metadata and
README.mdupdated with active Beta status notice and badges.
Removed #
- Unused
lib/main.dartentrypoint from package core.
0.0.2 - 2026-07-24 #
Added #
NanoToastsmart multiplatform notification component for Web, Desktop, and Mobile.NanoDeviceTypefor robust platform and responsive screen environment detection.warningstate status and helpers (isWarning,toWarning()) inNanoState.onCustomError,onCustomWarning, andonCustomSuccesscallbacks toNanoScaffold.homepageURL (https://nanodevs.com.br) in package metadata.- Comprehensive English Dartdoc documentation for all core APIs.