alembic 1.0.0
alembic: ^1.0.0 copied to clipboard
Declarative Navigator 2.0 navigation for Flutter. The navigation state is a list of pages, guarded by pure rules and owned by one controller.
1.0.0 #
- Breaking: requires Flutter 3.47.0 and Dart 3.13, up from Flutter 3.35.0 and Dart 3.9
- Breaking:
AlembicSheetPageis at most 640 wide and centered, as in Material 3, instead of spanning the width on tablets, desktop and in landscape. Its child gets a loose width, so a child that does not fill it, e.g. aColumnwithoutCrossAxisAlignment.stretch, is centered at its own width, on phones too. Wrap it inSizedBox(width: double.infinity)to keep it full width - Breaking: a guard that throws now cancels the change instead of being skipped, so a broken rule, e.g. an auth
guard, never lets through what it was there to stop. The error is still reported to
FlutterError. A guard that throws on the initial state makes the constructor throw itsArgumentError - The default key of a page asserts in debug mode that every argument has a
toString()of its own: two values printed asInstance of 'User'gave one key, and the pages silently became one screen. Overridekeyfor such pages AlembicPagetakescanPopandonPopInvokedand passes them toPage- Fixed: the Alembic kept an entry for every page removed through the controller, for as long as it was mounted
- Fixed: the route of
AlembicDialogPageadded a status listener to its animation on every build - The tests and the example import
material_uiandcupertino_uiinstead ofpackage:flutter/material.dartandpackage:flutter/cupertino.dart. Material and Cupertino were decoupled from the Flutter SDK, and the copies in the SDK are frozen and scheduled for removal (flutter/flutter#184093, flutter/flutter#172942) - CI tests the minimum Flutter (3.47.0) and the latest stable
0.6.1 #
- The README installs the package from pub.dev (
alembic: ^0.6.1) and shows the import
0.6.0 #
- Breaking: the package is renamed from
elixirtoalembic, becauseelixiris taken on pub.dev. Importpackage:alembic/alembic.dart; everyElixir*type becomesAlembic*, andcontext.elixir/context.maybeElixirbecomecontext.alembic/context.maybeAlembic. See "Migrating from elixir 0.5" in the README
0.5.0 #
A new architecture: one controller owns the navigation state, guards are pure rules, and the Elixir widget is a thin
adapter. See "Migrating from 0.4" in the README.
- Breaking:
ElixirControllerreplacesValueNotifier<ElixirNavigationState>,Elixir.controlledandElixir(pages:);Elixirnow takescontrolleronly.context.elixirreturns the controller - Breaking: guards move to the controller and become
ElixirGuardobjects withcall(from, to); they no longer receive aBuildContext.revalidatemoves to the controller as well - Breaking:
ElixirObserverandElixirObserver$NavigatorImplare removed, andlistenersbecomeslistener: every change bubbles up the tree as anElixirNotification, andlistener(anElixirListener) hears the changes of its Elixir and of the nested ones, likelistenersdid - Breaking:
onBackButtonPressedisFuture<bool> Function(NavigatorState navigator); by default the back button callsnavigator.maybePop(), so dialogs andPopScopeare respected and the root page lets the app close - Breaking:
ElixirPageextendsPage<Object?>, takes noname, has optionaltags, compares by identity, and its default key isname?a=1&bbuilt from the argument values instead of their identity hash - Breaking:
reset()takes no argument and returns to the initial state;popUntilstops at the topmost page with the alias;Elixir.stateOf,Elixir.navigatorOfandElixirControllerExtensionare removed - Breaking: the navigator no longer uses the
elixir_navigatorrestoration scope by default; passrestorationScopeId - Breaking:
CupertinoBackGestureDetectorandCupertinoBackGestureControllermoved out of the package into the example (example/lib/src/common/cupertino_back/); copy them into an app that needs the swipe on a custom route - Added
pushForResult,pop(result)andremove(page, result);Navigator.pop(context, result)completespushForResulttoo - Added
ElixirDialogPageandElixirSheetPage(widgets-only, page-based),ElixirPage.modalTag,RootGuard,ModalGuard,ElixirPageRoute,Elixir.stackOf,removeTag,removeandcontext.maybeElixir ElixirSheetPageports Flutter'sModalBottomSheetRoute: full width, the full height by default (isScrollControlledis true; false caps it at 9/16, as in Flutter),useSafeArea, its timing and curves, fling to close, and closing aDraggableScrollableSheetat its minimum extent- Added
Elixir.treeView, the tree of every Elixir for debug logs, andElixir.treeLine, the same on one line for analytics - A visible nested Elixir that can pop blocks the route hosting it, so the swipe-back of that route no longer closes it over an open dialog or sheet, or with pages stacked inside it
- Changes are deduplicated by key (the last page wins), queued when requested during a change, isolated from failing guards, and notified after the frame when committed during a build
- A page the user closed but a guard kept is shown again; the root Elixir reports
canHandlePopfor the whole tree, newest nested Elixir first - MIT license, real pubspec metadata,
flutter: ">=3.35.0", CI, and tests for every behavior above
0.4.0 #
- Breaking:
ElixirPage.createRouteno longer defaults toMaterialPageRoute; every page (or a shared base page class) must implement it - The package now imports only
package:flutter/widgets.dart, so it no longer depends on Material and works with Cupertino or custom routes - Example: light/dark theme toggle and Cupertino page transitions through
ThemeData.pageTransitionsTheme
0.3.0 #
- Breaking:
ElixirStateObserverreplaced byElixirObserver.context.elixir.observernow returns one observer created by the root Elixir and shared with every nested Elixir; listeners are(elixir, previous, next)callbacks instead ofVoidCallback - Breaking: Removed navigation history (
history,setHistory,ElixirHistoryEntry,maxHistoryLength) - Added
ElixirListenertypedef andlistenersparameter onElixir, called for that Elixir and every Elixir nested inside it - Added optional
name(ElixirAlias?) parameter onElixirandElixirState.nameto tell Elixirs apart, e.g. in listeners - System back button now goes to the innermost active nested Elixir first; a nested Elixir with a single page, or whose
onBackButtonPressedreturnshandled: false, passes it to its parent - Nested Elixirs under a covered route or in a hidden
IndexedStacktab are skipped when handling the back button - Added widget tests for nested back button handling and observers
0.2.0 #
- Breaking:
ElixirPagenow requires analiasfield of typeElixirAlias;nameis derived fromalias.alias - Breaking: Minimum SDK constraint raised to
^3.9.1 - Added
ElixirAliasinterface for enum-based route identification - Added
popUntil(ElixirAlias)method toElixirStateandElixirControllerExtension - Added
ElixirControllerExtensiononValueNotifier<ElixirNavigationState>withchange()andpopUntil()for programmatic navigation outside the widget tree - Added
revalidateparameter onElixirwidget to re-run guards when aListenablefires - Added
onBackButtonPressedcallback for custom system back button handling - Added
ElixirStateObserverwith timestamped navigation history (up to 10,000 entries) - Added
CupertinoBackGestureDetectorandCupertinoBackGestureControllerfor iOS-style swipe-back gestures - Added static access helpers:
Elixir.of,Elixir.maybeOf,Elixir.stateOf,Elixir.navigatorOf - Improved
ElixirPagekey generation using name and arguments hash - Improved equality and hashCode implementations in
ElixirPage - Updated
flutter_lintsto^6.0.0 - Added
public_member_api_docslint rule and enhanced documentation across all public APIs
0.0.2 #
- Added Elixir controller extension
0.0.1 #
- Initial configuration