This repository was archived by the owner on Apr 14, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
chore: add deprecation notice #113
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # Mockingjay — Deprecation Notice & Migration Guide | ||
|
|
||
| > **This package is deprecated and is no longer actively maintained.** | ||
| > The repository remains public and available for the community to fork. | ||
|
|
||
| --- | ||
|
|
||
| ## Why is Mockingjay being deprecated? | ||
|
|
||
| Mockingjay provides mock classes for testing Flutter's **Navigator 1.0** (imperative) APIs. | ||
| The Flutter ecosystem has broadly shifted toward **Navigator 2.0** — the declarative navigation API — | ||
| and packages like [`go_router`](https://pub.dev/packages/go_router) have become the de facto standard | ||
| for navigation in modern Flutter applications. | ||
|
|
||
| Given this shift, maintaining Mockingjay no longer aligns with the current direction of the Flutter | ||
| community. Rather than let it languish with infrequent updates, we are making the deprecation official | ||
| so users can plan accordingly. | ||
|
|
||
| The package will remain available on [pub.dev](https://pub.dev/packages/mockingjay) and the source | ||
| code will stay public and forkable. If there is enough community interest, anyone is welcome to create | ||
| and maintain a community edition. | ||
|
|
||
| --- | ||
|
|
||
| ## What should I do if I'm using Mockingjay? | ||
|
|
||
| You have two paths depending on how your app handles navigation: | ||
|
|
||
| ### Path 1 — Migrate to Navigator 2.0 (recommended) | ||
|
|
||
| If you are building a new app or are willing to update your navigation layer, migrating to | ||
| Navigator 2.0 is the recommended long-term path. | ||
|
|
||
| 1. **Adopt `go_router`** (or another Navigator 2.0-compatible package) for your app's routing. | ||
| See the [go_router documentation](https://pub.dev/packages/go_router) to get started. | ||
|
|
||
| 2. **Update your tests.** With `go_router`, navigation is driven by a `GoRouter` instance. | ||
| In tests, you can provide a custom router with a test-specific configuration rather than | ||
| mocking `Navigator` directly: | ||
|
marcossevilla marked this conversation as resolved.
Outdated
|
||
|
|
||
| ```dart | ||
| final router = GoRouter( | ||
| initialLocation: '/', | ||
| routes: [ | ||
| GoRoute(path: '/', builder: (_, __) => const HomeScreen()), | ||
| GoRoute(path: '/detail', builder: (_, __) => const DetailScreen()), | ||
| ], | ||
| ); | ||
|
|
||
| testWidgets('navigates to detail', (tester) async { | ||
| await tester.pumpWidget(MaterialApp.router(routerConfig: router)); | ||
| // Interact and assert normally | ||
| }); | ||
| ``` | ||
|
|
||
| 3. **Remove the `mockingjay` dependency** from your `pubspec.yaml` once all usages have been replaced. | ||
|
|
||
| --- | ||
|
|
||
| ### Path 2 — Continue using Navigator 1.0 (no migration) | ||
|
|
||
| Navigator 1.0 is still part of Flutter and is not going away. If your project intentionally uses | ||
| the imperative API and you rely on Mockingjay, you have two options: | ||
|
|
||
| - **Fork the repository** and maintain your own copy. The source code is fully public under its | ||
| existing license. | ||
| - **Use `NavigatorObserver` and manual test doubles** as a lightweight alternative, which requires | ||
| no third-party package. | ||
|
|
||
| --- | ||
|
|
||
| ## Timeline | ||
|
|
||
| | Date | Milestone | | ||
| |------|-----------| | ||
| | April 2026 | Package marked as deprecated on pub.dev | | ||
| | Ongoing | No new features or maintenance; critical bug reports may be considered on a best-effort basis | | ||
|
|
||
| --- | ||
|
marcossevilla marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Resources | ||
|
|
||
| - [go_router on pub.dev](https://pub.dev/packages/go_router) | ||
| - [Flutter Navigation & Routing docs](https://docs.flutter.dev/ui/navigation) | ||
| - [Navigator 2.0 overview](https://medium.com/flutter/learning-flutters-new-navigation-and-routing-system-7c9068155ade) | ||
|
|
||
| --- | ||
|
|
||
| Thank you to everyone who used and contributed to Mockingjay over the years. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.