Skip to content

Commit a892aca

Browse files
committed
feat: integrate playx_navigation v2.0.0 — add PlayxPageConfig support
- Add PlayxPageConfig? config parameter to PlayxNavigationSettings.goRouter for global defaults (loadingWidget, waitForBinding, shellBuilder, initTransitionDuration) - Forward config to PlayxNavigationBuilder in PlayxMaterialApp and PlayxPlatformApp - Bump playx_navigation dependency to ^2.0.0 - Add v2.1.0 changelog entry
1 parent 5aa8425 commit a892aca

7 files changed

Lines changed: 78 additions & 29 deletions

File tree

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
11
# Changelog
22

3+
## 2.1.0
4+
5+
### Dependency Updates
6+
* `playx_navigation: ^2.0.0`
7+
8+
### Navigation Enhancements (`playx_navigation` 2.0.0)
9+
* **Updated `PlayxNavigationSettings.goRouter`** to accept the new `PlayxPageConfig? config` parameter, enabling global defaults for:
10+
* `loadingWidget` — widget shown while a binding's `onEnter` is executing.
11+
* `waitForBinding` — whether routes block their build on `onEnter` completion.
12+
* `shellBuilder` — persistent page chrome (AppBar, Drawer) rendered immediately during transitions.
13+
* `initTransitionDuration` — crossfade animation duration between loading and content states.
14+
* **Updated `PlayxMaterialApp` and `PlayxPlatformApp`** to forward `PlayxPageConfig` to `PlayxNavigationBuilder`, enabling global page configuration when using GoRouter.
15+
* Route-level settings override global `PlayxPageConfig` defaults.
16+
17+
#### Example:
18+
```dart
19+
PlayxMaterialApp(
20+
navigationSettings: PlayxNavigationSettings.goRouter(
21+
goRouter: myRouter,
22+
config: PlayxPageConfig(
23+
loadingWidget: Center(child: CircularProgressIndicator()),
24+
waitForBinding: false,
25+
shellBuilder: (context, state, isInitialized, child) => Scaffold(
26+
appBar: AppBar(title: Text('My App')),
27+
body: child,
28+
),
29+
),
30+
),
31+
);
32+
```
33+
334
## 2.0.0
435

536
### SDK & Dependency Updates

example/lib/main.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ void main() async {
2525

2626
final goRouter = GoRouter(
2727
routes: [
28-
PlayxRoute(path: '/', builder: (context, state) => const Home()),
28+
PlayxRoute(
29+
path: '/', builder: (context, state, isInitialized) => const Home()),
2930
],
3031
);
3132

example/pubspec.lock

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ packages:
7777
dependency: transitive
7878
description:
7979
name: characters
80-
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
80+
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
8181
url: "https://pub.dev"
8282
source: hosted
83-
version: "1.4.0"
83+
version: "1.4.1"
8484
clock:
8585
dependency: transitive
8686
description:
@@ -101,10 +101,10 @@ packages:
101101
dependency: transitive
102102
description:
103103
name: connectivity_plus
104-
sha256: b8fe52979ff12432ecf8f0abf6ff70410b1bb734be1c9e4f2f86807ad7166c79
104+
sha256: "62ffa266d9a23b79fb3fcbc206afc00bb979417ba57b1324c546b5aab95ba057"
105105
url: "https://pub.dev"
106106
source: hosted
107-
version: "7.1.0"
107+
version: "7.1.1"
108108
connectivity_plus_platform_interface:
109109
dependency: transitive
110110
description:
@@ -433,10 +433,10 @@ packages:
433433
dependency: transitive
434434
description:
435435
name: go_router
436-
sha256: "7974313e217a7771557add6ff2238acb63f635317c35fa590d348fb238f00896"
436+
sha256: "5540e4a3f416dd4a93458257b908eb88353cbd0fb5b0a3d1bd7d849ba1e88735"
437437
url: "https://pub.dev"
438438
source: hosted
439-
version: "17.1.0"
439+
version: "17.2.1"
440440
http:
441441
dependency: transitive
442442
description:
@@ -537,18 +537,18 @@ packages:
537537
dependency: transitive
538538
description:
539539
name: matcher
540-
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
540+
sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861
541541
url: "https://pub.dev"
542542
source: hosted
543-
version: "0.12.17"
543+
version: "0.12.19"
544544
material_color_utilities:
545545
dependency: transitive
546546
description:
547547
name: material_color_utilities
548-
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
548+
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
549549
url: "https://pub.dev"
550550
source: hosted
551-
version: "0.11.1"
551+
version: "0.13.0"
552552
meta:
553553
dependency: transitive
554554
description:
@@ -691,7 +691,7 @@ packages:
691691
path: ".."
692692
relative: true
693693
source: path
694-
version: "2.0.0"
694+
version: "2.1.0"
695695
playx_core:
696696
dependency: transitive
697697
description:
@@ -712,10 +712,10 @@ packages:
712712
dependency: transitive
713713
description:
714714
name: playx_navigation
715-
sha256: "7acc4491a2fce4007a29fa831e088c63f877d8db8ef470da1750b1a4473bdf8b"
715+
sha256: "31f774a4da59e7264d2647094b35f0640b78f65cfd68fa3f82f19e28bbe22776"
716716
url: "https://pub.dev"
717717
source: hosted
718-
version: "1.0.0"
718+
version: "2.0.0"
719719
playx_network:
720720
dependency: transitive
721721
description:
@@ -776,26 +776,26 @@ packages:
776776
dependency: transitive
777777
description:
778778
name: sentry
779-
sha256: "288aee3d35f252ac0dc3a4b0accbbe7212fa2867604027f2cc5bc65334afd743"
779+
sha256: "9f9a35c2e74ed79e16373268e0c79bc00988412d4b30b63eb369d2fa32e6814e"
780780
url: "https://pub.dev"
781781
source: hosted
782-
version: "9.16.0"
782+
version: "9.17.0"
783783
sentry_dio:
784784
dependency: transitive
785785
description:
786786
name: sentry_dio
787-
sha256: "750afa9a14297908038b91b6322efb3f42d24aa79a21eb09053425e283d6c7ef"
787+
sha256: "905a0f93256ce694a66b00f442ae227b1edc1973e5a326a5328050cb01a7ccae"
788788
url: "https://pub.dev"
789789
source: hosted
790-
version: "9.16.0"
790+
version: "9.17.0"
791791
sentry_flutter:
792792
dependency: transitive
793793
description:
794794
name: sentry_flutter
795-
sha256: f9e87d5895cc437902aa2b081727ee7e46524fe7cc2e1910f535480a3eeb8bed
795+
sha256: "2de3cc0652934dd9d833aef578e8723ccba73dd229016b60533701e5890395d6"
796796
url: "https://pub.dev"
797797
source: hosted
798-
version: "9.16.0"
798+
version: "9.17.0"
799799
shared_preferences:
800800
dependency: transitive
801801
description:
@@ -965,10 +965,10 @@ packages:
965965
dependency: transitive
966966
description:
967967
name: test_api
968-
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
968+
sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a"
969969
url: "https://pub.dev"
970970
source: hosted
971-
version: "0.7.7"
971+
version: "0.7.10"
972972
typed_data:
973973
dependency: transitive
974974
description:

lib/src/models/playx_navigation_settings.dart

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ class PlayxNavigationSettings {
6262
/// Indicates whether to use Router-based navigation or GoRouter.
6363
final bool useRouter;
6464

65+
/// Optional global configuration for all [PlayxPage] instances when
66+
/// using [GoRouter]-based navigation.
67+
///
68+
/// Sets defaults for [PlayxPageConfig.loadingWidget],
69+
/// [PlayxPageConfig.waitForBinding], [PlayxPageConfig.shellBuilder],
70+
/// and [PlayxPageConfig.initTransitionDuration] that individual routes
71+
/// can override.
72+
///
73+
/// Only applicable when using the [PlayxNavigationSettings.goRouter]
74+
/// constructor.
75+
final PlayxPageConfig? config;
76+
6577
/// Creates navigation settings for traditional [Navigator] navigation.
6678
///
6779
/// This constructor sets up various properties related to Navigator-based navigation.
@@ -81,7 +93,8 @@ class PlayxNavigationSettings {
8193
routeInformationParser = null,
8294
routerDelegate = null,
8395
goRouter = null,
84-
backButtonDispatcher = null;
96+
backButtonDispatcher = null,
97+
config = null;
8598

8699
/// Creates navigation settings that use the Router instead of Navigator.
87100
///
@@ -102,7 +115,8 @@ class PlayxNavigationSettings {
102115
goRouter = null,
103116
home = null,
104117
includeSentryNavigationObserver = false,
105-
navigatorObservers = null;
118+
navigatorObservers = null,
119+
config = null;
106120

107121
/// Creates navigation settings that use the GoRouter instead of Navigator.
108122
///
@@ -111,6 +125,7 @@ class PlayxNavigationSettings {
111125
required GoRouter this.goRouter,
112126
this.navigatorKey,
113127
this.builder,
128+
this.config,
114129
}) : useRouter = true,
115130
routes = null,
116131
initialRoute = null,

lib/src/widgets/playx_material_app.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ class PlayxMaterialApp extends StatelessWidget {
185185
? PlayxNavigationBuilder(
186186
builder: (ctx) => materialApp,
187187
router: navigationSettings.goRouter!,
188+
config: navigationSettings.config,
188189
)
189190
: materialApp;
190191
},

lib/src/widgets/playx_platform_app.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ class PlayxPlatformApp extends StatelessWidget {
192192
? PlayxNavigationBuilder(
193193
builder: (ctx) => platformApp,
194194
router: navigationSettings.goRouter!,
195+
config: navigationSettings.config,
195196
)
196197
: platformApp;
197198
},

pubspec.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: playx
22
description: Playx eco system helps with redundant features as it provides many utilities for themes, widgets and more.
3-
version: 2.0.0
3+
version: 2.1.0
44
homepage: https://sourcya.io
55
repository: https://github.com/playx-flutter/playx
66
issue_tracker: https://github.com/playx-flutter/playx/issues
@@ -23,14 +23,14 @@ dependencies:
2323
playx_theme: ^2.0.0
2424
playx_widget: ^0.5.0
2525
playx_network: ^1.0.0
26-
playx_navigation: ^1.0.0
26+
playx_navigation: ^2.0.0
2727
playx_localization: ^0.4.0
2828
queen_validators: ^1.0.1
29-
sentry_flutter: ^9.16.0
29+
sentry_flutter: ^9.17.0
3030
flutter_animate: ^4.5.2
3131
internet_connection_checker_plus: ^2.9.1+2
32-
connectivity_plus: ^7.1.0
33-
get: ^4.7.3
32+
connectivity_plus: ^7.1.1
33+
get: 4.7.3
3434

3535

3636
dev_dependencies:

0 commit comments

Comments
 (0)