Skip to main content

alembic 1.0.0 copy "alembic: ^1.0.0" to clipboard
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: AlembicSheetPage is 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. a Column without CrossAxisAlignment.stretch, is centered at its own width, on phones too. Wrap it in SizedBox(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 its ArgumentError
  • The default key of a page asserts in debug mode that every argument has a toString() of its own: two values printed as Instance of 'User' gave one key, and the pages silently became one screen. Override key for such pages
  • AlembicPage takes canPop and onPopInvoked and passes them to Page
  • Fixed: the Alembic kept an entry for every page removed through the controller, for as long as it was mounted
  • Fixed: the route of AlembicDialogPage added a status listener to its animation on every build
  • The tests and the example import material_ui and cupertino_ui instead of package:flutter/material.dart and package: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 elixir to alembic, because elixir is taken on pub.dev. Import package:alembic/alembic.dart; every Elixir* type becomes Alembic*, and context.elixir / context.maybeElixir become context.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: ElixirController replaces ValueNotifier<ElixirNavigationState>, Elixir.controlled and Elixir(pages:); Elixir now takes controller only. context.elixir returns the controller
  • Breaking: guards move to the controller and become ElixirGuard objects with call(from, to); they no longer receive a BuildContext. revalidate moves to the controller as well
  • Breaking: ElixirObserver and ElixirObserver$NavigatorImpl are removed, and listeners becomes listener: every change bubbles up the tree as an ElixirNotification, and listener (an ElixirListener) hears the changes of its Elixir and of the nested ones, like listeners did
  • Breaking: onBackButtonPressed is Future<bool> Function(NavigatorState navigator); by default the back button calls navigator.maybePop(), so dialogs and PopScope are respected and the root page lets the app close
  • Breaking: ElixirPage extends Page<Object?>, takes no name, has optional tags, compares by identity, and its default key is name?a=1&b built from the argument values instead of their identity hash
  • Breaking: reset() takes no argument and returns to the initial state; popUntil stops at the topmost page with the alias; Elixir.stateOf, Elixir.navigatorOf and ElixirControllerExtension are removed
  • Breaking: the navigator no longer uses the elixir_navigator restoration scope by default; pass restorationScopeId
  • Breaking: CupertinoBackGestureDetector and CupertinoBackGestureController moved 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) and remove(page, result); Navigator.pop(context, result) completes pushForResult too
  • Added ElixirDialogPage and ElixirSheetPage (widgets-only, page-based), ElixirPage.modalTag, RootGuard, ModalGuard, ElixirPageRoute, Elixir.stackOf, removeTag, remove and context.maybeElixir
  • ElixirSheetPage ports Flutter's ModalBottomSheetRoute: full width, the full height by default (isScrollControlled is true; false caps it at 9/16, as in Flutter), useSafeArea, its timing and curves, fling to close, and closing a DraggableScrollableSheet at its minimum extent
  • Added Elixir.treeView, the tree of every Elixir for debug logs, and Elixir.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 canHandlePop for 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.createRoute no longer defaults to MaterialPageRoute; 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: ElixirStateObserver replaced by ElixirObserver. context.elixir.observer now returns one observer created by the root Elixir and shared with every nested Elixir; listeners are (elixir, previous, next) callbacks instead of VoidCallback
  • Breaking: Removed navigation history (history, setHistory, ElixirHistoryEntry, maxHistoryLength)
  • Added ElixirListener typedef and listeners parameter on Elixir, called for that Elixir and every Elixir nested inside it
  • Added optional name (ElixirAlias?) parameter on Elixir and ElixirState.name to 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 onBackButtonPressed returns handled: false, passes it to its parent
  • Nested Elixirs under a covered route or in a hidden IndexedStack tab are skipped when handling the back button
  • Added widget tests for nested back button handling and observers

0.2.0 #

  • Breaking: ElixirPage now requires an alias field of type ElixirAlias; name is derived from alias.alias
  • Breaking: Minimum SDK constraint raised to ^3.9.1
  • Added ElixirAlias interface for enum-based route identification
  • Added popUntil(ElixirAlias) method to ElixirState and ElixirControllerExtension
  • Added ElixirControllerExtension on ValueNotifier<ElixirNavigationState> with change() and popUntil() for programmatic navigation outside the widget tree
  • Added revalidate parameter on Elixir widget to re-run guards when a Listenable fires
  • Added onBackButtonPressed callback for custom system back button handling
  • Added ElixirStateObserver with timestamped navigation history (up to 10,000 entries)
  • Added CupertinoBackGestureDetector and CupertinoBackGestureController for iOS-style swipe-back gestures
  • Added static access helpers: Elixir.of, Elixir.maybeOf, Elixir.stateOf, Elixir.navigatorOf
  • Improved ElixirPage key generation using name and arguments hash
  • Improved equality and hashCode implementations in ElixirPage
  • Updated flutter_lints to ^6.0.0
  • Added public_member_api_docs lint rule and enhanced documentation across all public APIs

0.0.2 #

  • Added Elixir controller extension

0.0.1 #

  • Initial configuration
2
likes
160
points
178
downloads

Documentation

API reference

Publisher

verified publisherthemiracle.dev

Weekly Downloads

Declarative Navigator 2.0 navigation for Flutter. The navigation state is a list of pages, guarded by pure rules and owned by one controller.

Repository (GitHub)
View/report issues

Topics

#navigation #navigator #router #declarative #guards

License

MIT (license)

Dependencies

flutter

More

Packages that depend on alembic