Skip to content

v2.0.0#10

Merged
basemosama merged 2 commits into
mainfrom
qa
Apr 16, 2026
Merged

v2.0.0#10
basemosama merged 2 commits into
mainfrom
qa

Conversation

@basemosama

@basemosama basemosama commented Apr 16, 2026

Copy link
Copy Markdown
Member

2.0.0

Breaking Changes

  • Builder signature updated: PlayxRoute and PlayxShellBranch now use PlayxRouteWidgetBuilder which includes an isInitialized parameter:
    // Before (1.x):
    builder: (context, state) => MyPage()
    // After (2.0):
    builder: (context, state, isInitialized) => MyPage()

New Features

  • Shell Builder: Added shellBuilder parameter to PlayxRoute, PlayxShellBranch, and PlayxPageConfig. The shell (AppBar, Drawer, Scaffold) renders immediately during navigation transitions, preventing blank frames. Only the body content waits for the binding's onEnter to complete.
    PlayxRoute(
      path: '/channels',
      shellBuilder: (context, state, isInitialized, child) => Scaffold(
        appBar: AppBar(title: Text('Channels')),
        drawer: MyDrawer(),
        body: child,
      ),
      builder: (context, state, isInitialized) => ChannelsListView(),
      binding: ChannelsBinding(),
    )
  • Non-blocking initialization: Added waitForBinding parameter to PlayxRoute, PlayxShellBranch, and PlayxPageConfig. When set to false, the page renders immediately with isInitialized = false while onEnter runs in the background.
  • Global page configuration via PlayxPageConfig: Added config parameter to PlayxNavigationBuilder to set global defaults for loadingWidget, waitForBinding, and shellBuilder. Individual routes can override any of these settings.
    PlayxNavigationBuilder(
      router: router,
      config: PlayxPageConfig(
        loadingWidget: Center(child: CircularProgressIndicator()),
        waitForBinding: false,
        shellBuilder: (context, state, isInitialized, child) => Scaffold(
          appBar: AppBar(title: Text('My App')),
          body: child,
        ),
      ),
      builder: (context) => MyApp(),
    )
  • New typedefs: PlayxRouteWidgetBuilder and PlayxShellWidgetBuilder for type-safe builder signatures.
  • Initialization transition animation: Added initTransitionDuration parameter to PlayxRoute, PlayxShellBranch, and PlayxPageConfig. When set, an AnimatedSwitcher crossfade smoothly transitions from the loading widget to the page content.

Configuration Resolution

Route-level parameter → Global PlayxPageConfig → Built-in default:

  • loadingWidget: Route > Global > SizedBox.shrink()
  • waitForBinding: Route > Global > true
  • shellBuilder: Route > Global > null
  • initTransitionDuration: Route > Global > null (no animation)

BREAKING CHANGE: PlayxRoute and PlayxShellBranch builder signature
changed from (context, state) to (context, state, isInitialized).

- Add shellBuilder for rendering page chrome immediately during
  transitions, preventing blank frames while onEnter initializes
- Add waitForBinding to control blocking behavior (default: true)
- Add initTransitionDuration for smooth crossfade animation between
  loading and content states via AnimatedSwitcher
- Add PlayxPageConfig for global defaults via PlayxNavigationBuilder
- Config resolution: route-level > global PlayxPageConfig > defaults
- Bump version to 2.0.0
- Upgraded `go_router` dependency from `^17.1.0` to `^17.2.1`.
- Updated example package version to `2.0.0`.
- Refined code formatting in `PlayxPage` and `PlayxNavigationBuilder` for better consistency.
@basemosama basemosama merged commit 4e44024 into main Apr 16, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant