app_state
A state management solution on top of Router API for larger apps.
0.9.7
469 downloads/mo
#822 most downloaded on pub.dev
alexeyinkin/flutter-app-state
What this package is like to depend on
Last release 4 months ago
04 Apr 2026
Ships unpredictably
gaps range from 9 days to 1.4 years
Nearly every release is documented
notes for 46 of 47 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
47 releases · first in 2022
1 release in the last 12 months
see the full history below
Release timeline
47 releases · Jan 2022 to Apr 2026Releases
latest 47-
0.9.704 Apr 2026Release notes
Open source →- Migrated
Navigatorintegration from the deprecatedonPopPagetoonDidRemovePageandPopScope. - Made
PageStacksRouterDelegatenon-abstract and sufficient. - Deleted the old
MaterialPageStacksRouterDelegateand created a deprecated typedef to use its parentPageStacksRouterDelegate. - Upgraded the
mockitoversion to^5.5.1to support the latest SDK. - Re-created
iosandandroiddirectories in the example app to support the recent Gradle and SDKs. - Deprecated
PPageStatefulBloc. Create your own custom class or mix the Bloc from the bloc package. This solution is opinionated and limited and will not be maintained. - Deprecated
PageStackBackButtonDispatcher.pageStackBlocin favor ofpageStack. - Deprecated
PPageStacksStackEvent.blocin favor ofstack. - Deprecated
PPageStacksStackEvent.pageStackBlocEventin favor ofpageStackEvent. - Renamed the forgotten
CStatelessMaterialPagetoPStatelessMaterialPagein accordance with v0.7.0.
- Migrated
-
0.9.621 Nov 2024 -
0.9.523 Jun 2024Release notes
Open source →- Using
PagePath.uriinstead of.locationto constructRouteInformation. - Deprecated
PagePath.location. - Disallowed
PageStacks.setCurrentStackKeyfor a non-existent stack. - Added pub.dev topics: state-management, navigation, routing, urls, deep-linking.
- Using
-
0.9.408 Jun 2023 -
0.9.316 Feb 2023Release notes
Open source →- Added
PPageStateMixin.pageStack, fill it when a page is added to the stack.
- Added
-
0.9.213 Feb 2023Release notes
Open source →- Added
PageStackNavigator.navigatorKey, passedPageStackRouterDelegate.navigatorKey.
- Added
-
0.9.128 Jan 2023 -
0.9.019 Jan 2023Release notes
Open source →- BREAKING:
restoreRouteInformationinPageStackConfigurationandPageStacksConfigurationare now nullable. They used to return/fornullpaths and that had been showing for an instant in the address bar when starting at a non-/URL.
- BREAKING:
-
0.8.421 Dec 2022 -
0.8.308 Dec 2022Release notes
Open source →- Added
PagePath.uri. - Added
PagePath.getUriAtBase(). - Relaxed mockito version requirement.
- Added
-
0.8.208 Nov 2022 -
0.8.130 Sep 2022 -
0.8.027 Aug 2022 -
0.7.427 Aug 2022Release notes
Open source →- Added
PageStacksBuilderwidget. - Refactored the
5_route_resultexample to useChangeNotifierinstead of bloc. - Incorporated the older separate medium tutorials in the READMEs:
- Fixed image links in
/example/README.md. - Added 'Support: Telegram' shield.
- Added
-
0.7.323 Aug 2022 -
0.7.223 Aug 2022Release notes
Open source →- Fixed linter issues, formatted examples, added the format check to the CI.
- Moved to
app_statesubdirectory.
-
0.7.122 Aug 2022 -
0.7.022 Aug 2022Release notes
Open source →Most of the references to BLoC were removed from the package to allow any implementation for state management: custom BLoC, BLoC or Cubit from the bloc package,
ChangeNotifier, or anything else. Deprecatedtypedefs to the older classes and deprecated aliases to older members were added to soften the change.This is a short-lived major version to migrate from those deprecated API to the new one but to still be able to run your app in the process. Every deprecation in this version is scheduled for removal in v0.8.0.
- BREAKING: While removing references to BLoC, named arguments to some constructors and methods
could not be easily backed by anything backward compatible, and they were hard-renamed:
PageStackPageBlocEvent:- was renamed to
PageStackPageEvent. blocwas changed toPageStateMixin state.pageBlocEventwas renamed topageEvent.
- was renamed to
PageStacksPageStackBlocEvent:- was renamed to
PageStacksStackEvent. blocwas renamed tostack.pageStackBlocEventwas renamed topageStackEvent.
- was renamed to
MaterialPageStacksRouterDelegate.pageStacksBlocwas changed from a named constructor argument to a positional one and renamed topageStacks.PageStackNavigator.blocwas renamed tostack.
- BREAKING:
PageStack.pagesis now anUnmodifiableListViewand not the actual list. - Renamings backed by deprecated
typedefs and member aliases that are thus non-breaking:PageBlocwas changed toPageStateMixinmixin. To continue using custom blocs as in the previous versions, mix it in withwithkeyword instead of extendingPageBloc. The newly deprecatedPageBlocis changed to mix in this mixin.PageBlocEventwas renamed toPageEvent.PageBlocPathChangedEventwas renamed toPagePathChangedEvent.- In
enum PopCause:pageBlocwas renamed topage.pageStackBlocwas renamed topageStack.
PageBlocPopEventwas renamed toPagePopEvent.PageStackBackButtonDispatcher.pageStackBlocwas renamed topageStack.PageStacksBackButtonDispatcher.pageStacksBlocwas renamed topageStacks.PageStackBlocEventwas renamed toPageStackEvent.PageStackRouterDelegate.pageStackBlocwas renamed topageStack.PageStacksBloc:- was renamed to
PageStacks. currentStackBlocwas renamed tocurrentStack.
- was renamed to
PageStacksBlocEventwas renamed toPageStacksEvent.PageStacksRouterDelegate.pageStacksBlocwas renamed topageStacks.CAbstractPage.blocwas changed toPageStateMixin.state.
PageStackEventnow has type parameter<P extends PagePath>.PageStateclass is added as the default class that usesPageStateMixin.- All classes using
Cprefix were changed toPprefix. Deprecatedtypedefs added for backward compatibility. That prefix was historical when the term 'configuration' was used instead of 'path'. The newPstands for 'path'. These classes are meant for apps that have a common superclass underPagePath. All other apps should use the same classes without prefixes.
- BREAKING: While removing references to BLoC, named arguments to some constructors and methods
could not be easily backed by anything backward compatible, and they were hard-renamed:
-
0.6.1014 Aug 2022 -
0.6.913 Aug 2022Release notes
Open source →- Preserves the state on browser refresh button press by using https://pub.dev/packages/flutter_issue_108697_workaround
- Renamed
PageStackBlocNavigatortoPageStackNavigator. A deprecatedtypedefwas added for backward compatibility.
-
0.6.810 Aug 2022Release notes
Open source →- Added
PageStackRouterDelegate.observers,PageStackRouterDelegate.transitionDelegate.
- Added
-
0.6.710 Aug 2022Release notes
Open source →- Added
PageStackBlocNavigator.observers,PageStackBlocNavigator.transitionDelegate.
- Added
-
0.6.608 Aug 2022 -
0.6.508 Aug 2022Release notes
Open source →- Added
PageStackBloc.popUntilBottom(), it uses the newPopCause.pageStackBloc. PageBlocPopEventis now always created with the correctRtype. Before it had beenconst PageBlocPopEvent<Null>for pops without data.- Improved test coverage.
- Fix formatting.
- Add comparison to auto_route and go_router to README.
- Added
-
0.6.406 Aug 2022Release notes
Open source →- Added
PageStackBloc.replaceWithto declaratively navigate to a given path with two options:- Replacing the stack unconditionally with
mode: PageStackMatchMode.none. - Preserving the states of pages that exist in both the old and the new stack with
mode: PageStackMatchMode.keyOrNullPathNoGap.
- Replacing the stack unconditionally with
- Added
modeargument toPageStackBloc.setConfigurationto choose the match mode the same way as inreplaceWith. - Added
PageBlocCloseEvent.causeto tell between the back button close, the bloc's own intention to close, and a kick-out as a result of stack diff. BlocMaterialPageis now non-abstract.- Fixed issue when page stack was allowed to be emptied and stayed defunct afterwards Issue 3. The emptying operation is now reverted.
- Removed code duplication by handling all page removals in
PageStackBloc.handleRemoved(). - Expand tests.
- Added
-
0.6.302 Aug 2022Release notes
Open source →- Renamed
PageBlocCloseEventtoPageBlocPopEventto align withdidPopNextmethod. - A deprecated
typedefwas created for backwards compatibility.
- Renamed
-
0.6.231 Jul 2022Release notes
Open source →- Renamed
PageConfigurationtoPagePath. Atypedeffor backwards compatibility is added. Methods, getters, and arguments with pages' 'configuration' in its name were changed to use 'path', deprecated copies of the old ones were added for backwards compatibility. ThePageConfiguration's name was a permanent source of confusion. Each doc had to start with a note thatPageConfigurationcorresponds to a URL, and it was not easy to memorize. This change will simplify the learning of this package. It has also stripped 9-13 characters from identifiers.Pathis inspired by the original article announcing Router API (as well asapp_statename itself was).Configurationearlier was inspired byRouterdocs where it means the configuration of the whole app (earlier versions ofapp_statewere designed to allow storing only the top page's state, and so 'configuration' was extended to pages as well). 'Configuration' is still used inPageStackConfigurationandPageStacksConfigurationclass names that do represent the whole app's state, and that is correct. - Deprecated
PagePath.restoreRouteInformation. It used to allow overridingstateand was confusing because it was not used in serializing for browser history (super.stateis).
- Renamed
-
0.6.130 Jul 2022 -
0.6.030 Jul 2022Release notes
Open source →- BREAKING: All classes that had a type parameter
<C extends PageConfiguration>no longer have it. The idea of this type parameter is to have a subclass that is a superclass to all of your configurations. An example is when you store a language slug there, and it must be automatically present in all your configurations. These cases are rare, and most of the time<PageConfiguration...only clutters the code when you must provide some other typed parameters likePageBloctype or the return value. All such classes were renamed in a pattern ofPageBloc<C, R> -> CPageBloc<C, R>. Thentypedefs were added liketypedef PageBloc<R> = CPageBloc<PageConfiguration, R>. If you need the common subclass ofPageConfiguration, just addCbefore all such typed parent classes to get it back. Otherwise just remove<PageConfiguration>from your code. - BREAKING: When
PageStackBloccompares pages tonullPageConfiguration, it ignores the page keys and never disposes such pages. This is to allow non-web apps without anyPageConfigurationclasses. Otherwise the pages were always kicked out when comparing tonullPageConfiguration. No practical use cases were affected. PageConfigurationclasses are now optional for all non-web apps and web apps that do not care for URLs.PageConfigurationis now non-abstract and has/as the defaultlocation.PageConfigurationobjects no longer need to parseRouteInformation.statein theirtryParse. To benefit from this, stop overridingparseRouteInformationin your parser and override one of the new methods instead:parsePageConfiguration,PageStackRouteInformationParser.parsePageStackConfiguration,PageStacksRouteInformationParser.parsePageStacksConfiguration. These methods are only called when failed to extract state fromRouteInformation, i.e. when the URL is typed in, and so no non-URL state information is present.PageStackConfiguration.getTopPageConfiguration()is now nullable and returns null if none of the pages in the stack havePageConfiguration.PageStackRouteInformationParserandPageStacksRouteInformationParsercan now be used without subclassing in all non-web apps and web apps that do not care for URLs. By return they parsenullPageConfigurationobjects.PageStackRouteInformationParserandPageStacksRouteInformationParserin theirrestoreRouteInformationnow return all their stack/stacks states to store in browser history and not only that of the topPageConfiguration.- Added
constconstructors toPageStackRouteInformationParserandPageStacksRouteInformationParser. PageStackRouteInformationParserandPageStacksRouteInformationParsernow haveparsePageConfigurationto only parse the singlePageConfiguration. This way the superclasses calldefaultStackConfigurationanddefaultStacksConfigurationso you don't have to. They are the recommended replacements to respectiveparseRouteInformationmethods. They are called only when failed to recover fromRouteInformation.state. To use them, stop overridingparseRouteInformation.PageStackRouteInformationParsernow hasparsePageStackConfiguration, andPageStacksRouteInformationParsernow hasparsePageStacksConfiguration. They are the alternative replacements to respectiveparseRouteInformationmethods in case you need additional logic to recover the stack state that cannot be derived from yourPageConfigurationalone. They are called only when failed to recoverRouteInformation.state. To use them, stop overridingparseRouteInformation.
- BREAKING: All classes that had a type parameter
-
0.5.129 Jul 2022Release notes
Open source →- Added
PageConfiguration.location. - Added
PageConfiguration.defaultStackConfigurations.
- Added
-
0.5.027 Jul 2022Release notes
Open source →- BREAKING: Pages, Blocs an
PageBlocCloseEventhave a newRtype parameter for the return result. The actual result is ofR?withnullif closing without data. - BREAKING:
PageBlocCloseEventhas a new requireddataproperty of typeR. It is encouraged to use it instead of subclassingPageBlocCloseEvent. - BREAKING: Page classes no longer have
constconstructors because they haveCompleters now. - Added
PageBloc.pop(data). - Added
PageBloc.didPopNext(page, event). PageStackBloc.pushreturns aFuturethat completes when the page is popped.- Deprecated
PageBloc.onForegroundClosedin favor ofdidPopNext. - Deprecated
PageBloc.closeScreenandPageBloc.closeScreenWithin favor ofpop.
- BREAKING: Pages, Blocs an
-
0.4.019 Jul 2022Release notes
Open source →- BREAKING: Require Flutter 3.
- Re-licensed under MIT No Attribution.
- Using
total_lints, fix linter issues.
-
0.3.513 May 2022 -
0.3.409 May 2022Release notes
Open source →- Call const constructors where possible.
- Applied
dart format. - Added features to
README.md
-
0.3.304 May 2022 -
0.3.203 Apr 2022Release notes
Open source →- Const constructors for
PageBlocCloseEvent,PageBlocConfigurationChangedEvent,PageStackConfiguration. - Link to tutorials.
- Const constructors for
-
0.3.101 Apr 2022 -
0.3.001 Apr 2022Release notes
Open source →- BREAKING: Remove
AppBloc. - Add
PageStacksBloc,PageStacksConfiguration,PageStacksRouteInformationParser,PageStacksRouterDelegate. - Add
PageConfiguration.defaultStackKey,defaultStacksConfiguration.
- BREAKING: Remove
-
0.2.130 Mar 2022 -
0.2.030 Mar 2022Release notes
Open source →- BREAKING:
PageConfigurationis now abstract, addedrestoreRouteInformation(). - Added
PageConfiguration.defaultStackConfiguration. - Added
PageStackConfiguration.getTopPageConfiguration(). - Added
PageStackRouteInformationParser.
- BREAKING:
-
0.1.625 Mar 2022 -
0.1.523 Mar 2022 -
0.1.423 Mar 2022Nothing published for this version
-
0.1.320 Mar 2022 -
0.1.218 Jan 2022Release notes
Open source →- BREAKING: Renamed
AppBlocNormalizedStatetoAppConfiguration. - BREAKING: Renamed
PageStackBlocNormalizedStatetoPageStackConfiguration. - BREAKING: Renamed
ScreenBlocNormalizedStatetoPageConfiguration. - BREAKING: Renamed
Screen...events toPage...events. - BREAKING: Extracted
PageBloc.statesto the newPageStatefulBlocsubclass. PageBlocis not abstract.- Allow to specify duplicate key behavior per push.
- Allow
nullfor page keys. - Added docs.
- BREAKING: Renamed
-
0.1.112 Jan 2022Release notes
Open source →- BREAKING: Removed
ScreenBlocConfigurationChangedEvent.configuration. - Added
AppBloc. - Added
AppBlocNormalizedState,PageStackBlocNormalizedState,ScreenBlocNormalizedState. - Normalize and denormalize state.
- Create pages in
PageStackBloc.
- BREAKING: Removed
-
0.1.006 Jan 2022