Skip to content

Commit

Permalink
fix: add onNavigationNotification to all ShadApp (#271)
Browse files Browse the repository at this point in the history
Co-authored-by: Mo <[email protected]>
  • Loading branch information
mllrr96 and Rag-mo authored Jan 27, 2025
1 parent 636d9cd commit e21b814
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/src/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class ShadApp extends StatefulWidget {
this.onGenerateRoute,
this.onGenerateInitialRoutes,
this.onUnknownRoute,
this.onNavigationNotification,
this.navigatorObservers = const <NavigatorObserver>[],
this.initialRoute,
this.home,
Expand Down Expand Up @@ -78,6 +79,7 @@ class ShadApp extends StatefulWidget {
this.builder,
this.title = '',
this.onGenerateTitle,
this.onNavigationNotification,
this.color,
this.locale,
this.localizationsDelegates,
Expand Down Expand Up @@ -113,6 +115,7 @@ class ShadApp extends StatefulWidget {
this.onGenerateRoute,
this.onGenerateInitialRoutes,
this.onUnknownRoute,
this.onNavigationNotification,
this.navigatorObservers = const <NavigatorObserver>[],
this.initialRoute,
this.home,
Expand Down Expand Up @@ -162,6 +165,7 @@ class ShadApp extends StatefulWidget {
this.builder,
this.title = '',
this.onGenerateTitle,
this.onNavigationNotification,
this.color,
this.locale,
this.localizationsDelegates,
Expand Down Expand Up @@ -197,6 +201,7 @@ class ShadApp extends StatefulWidget {
this.onGenerateRoute,
this.onGenerateInitialRoutes,
this.onUnknownRoute,
this.onNavigationNotification,
this.navigatorObservers = const <NavigatorObserver>[],
this.initialRoute,
this.home,
Expand Down Expand Up @@ -246,6 +251,7 @@ class ShadApp extends StatefulWidget {
this.builder,
this.title = '',
this.onGenerateTitle,
this.onNavigationNotification,
this.color,
this.locale,
this.localizationsDelegates,
Expand Down Expand Up @@ -283,6 +289,7 @@ class ShadApp extends StatefulWidget {
this.themeMode,
}) : actions = null,
backButtonDispatcher = null,
onNavigationNotification = null,
builder = null,
color = null,
cupertinoThemeBuilder = null,
Expand Down Expand Up @@ -397,6 +404,9 @@ class ShadApp extends StatefulWidget {
/// {@macro flutter.widgets.widgetsApp.onUnknownRoute}
final RouteFactory? onUnknownRoute;

/// {@macro flutter.widgets.widgetsApp.onNavigationNotification}
final NotificationListenerCallback<NavigationNotification>? onNavigationNotification;

/// {@macro flutter.widgets.widgetsApp.navigatorObservers}
final List<NavigatorObserver>? navigatorObservers;

Expand Down Expand Up @@ -754,6 +764,7 @@ class _ShadAppState extends State<ShadApp> {
routerDelegate: widget.routerDelegate,
routerConfig: widget.routerConfig,
backButtonDispatcher: widget.backButtonDispatcher,
onNavigationNotification: widget.onNavigationNotification,
builder: _builder,
title: widget.title,
onGenerateTitle: widget.onGenerateTitle,
Expand Down Expand Up @@ -785,6 +796,7 @@ class _ShadAppState extends State<ShadApp> {
onGenerateRoute: widget.onGenerateRoute,
onGenerateInitialRoutes: widget.onGenerateInitialRoutes,
onUnknownRoute: widget.onUnknownRoute,
onNavigationNotification: widget.onNavigationNotification,
builder: _builder,
title: widget.title,
onGenerateTitle: widget.onGenerateTitle,
Expand Down Expand Up @@ -817,6 +829,7 @@ class _ShadAppState extends State<ShadApp> {
routerDelegate: widget.routerDelegate,
routerConfig: widget.routerConfig,
backButtonDispatcher: widget.backButtonDispatcher,
onNavigationNotification: widget.onNavigationNotification,
builder: _builder,
theme: materialTheme(context),
title: widget.title,
Expand Down Expand Up @@ -845,6 +858,7 @@ class _ShadAppState extends State<ShadApp> {
onGenerateRoute: widget.onGenerateRoute,
onGenerateInitialRoutes: widget.onGenerateInitialRoutes,
onUnknownRoute: widget.onUnknownRoute,
onNavigationNotification: widget.onNavigationNotification,
builder: _builder,
theme: materialTheme(context),
title: widget.title,
Expand Down Expand Up @@ -874,6 +888,7 @@ class _ShadAppState extends State<ShadApp> {
routerDelegate: widget.routerDelegate,
routerConfig: widget.routerConfig,
backButtonDispatcher: widget.backButtonDispatcher,
onNavigationNotification: widget.onNavigationNotification,
builder: _builder,
theme: cupertinoTheme(context),
title: widget.title,
Expand Down Expand Up @@ -905,6 +920,7 @@ class _ShadAppState extends State<ShadApp> {
onGenerateRoute: widget.onGenerateRoute,
onGenerateInitialRoutes: widget.onGenerateInitialRoutes,
onUnknownRoute: widget.onUnknownRoute,
onNavigationNotification: widget.onNavigationNotification,
builder: _builder,
theme: cupertinoTheme(context),
title: widget.title,
Expand Down

0 comments on commit e21b814

Please sign in to comment.