Skip to content

Commit

Permalink
Remove unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
raapperez committed Sep 10, 2024
1 parent 82e8e5d commit 3b13b5b
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions lib/src/nuvigator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@ enum DeepLinkPushMethod {
PopAndPush,
}

NuvigatorState? _tryToFindNuvigatorForRouter<T extends INuRouter>(
NuvigatorState? nuvigatorState) {
if (nuvigatorState == null) return null;
if (nuvigatorState.router is T) return nuvigatorState;
if (nuvigatorState != nuvigatorState.parent &&
nuvigatorState.parent != null) {
return _tryToFindNuvigatorForRouter<T>(nuvigatorState.parent!);
}
return null;
}

class NuvigatorStateTracker extends NavigatorObserver {
final List<Route?> stack = [];

Expand Down Expand Up @@ -561,11 +550,6 @@ class Nuvigator<T extends INuRouter?> extends StatelessWidget {
final Map<String, dynamic>? initialArguments;
final ShouldRebuildFn? shouldRebuild;

static NuvigatorState? ofRouter<T extends INuRouter>(BuildContext context) {
final closestNuvigator = context.findAncestorStateOfType<NuvigatorState>();
return _tryToFindNuvigatorForRouter<T>(closestNuvigator);
}

/// Maybe fetches a [NuvigatorState] from the current BuildContext.
static NuvigatorState<T>? maybeOf<T extends INuRouter>(
BuildContext context, {
Expand Down

0 comments on commit 3b13b5b

Please sign in to comment.