Skip to content
This repository was archived by the owner on Apr 14, 2026. It is now read-only.

Commit f7aa748

Browse files
chore: add deprecation notice (#113)
* chore: add deprecation notice * Apply suggestions from code review Co-authored-by: Marcos Sevilla <31174242+marcossevilla@users.noreply.github.com> * Update DEPRECATION.md
1 parent 8259001 commit f7aa748

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

DEPRECATION.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Mockingjay — Deprecation Notice & Migration Guide
2+
3+
> **This package is deprecated and is no longer actively maintained.**
4+
> The repository remains public and available for the community to fork.
5+
6+
---
7+
8+
## Why is Mockingjay being deprecated?
9+
10+
Mockingjay provides mock classes for testing Flutter's **Navigator 1.0** (imperative) APIs.
11+
The Flutter ecosystem has broadly shifted toward **Navigator 2.0** — the declarative navigation API —
12+
and packages like [`go_router`](https://pub.dev/packages/go_router) have become the de facto standard
13+
for navigation in modern Flutter applications.
14+
15+
Given this shift, maintaining Mockingjay no longer aligns with the current direction of the Flutter
16+
community. Rather than let it languish with infrequent updates, we are making the deprecation official
17+
so users can plan accordingly.
18+
19+
The package will remain available on [pub.dev](https://pub.dev/packages/mockingjay) and the source
20+
code will stay public and available to fork. If there is enough community interest, anyone is welcome to create
21+
and maintain a community edition.
22+
23+
---
24+
25+
## What should I do if I'm using Mockingjay?
26+
27+
You have two paths depending on how your app handles navigation:
28+
29+
### Path 1 — Migrate to Navigator 2.0 (recommended)
30+
31+
If you are building a new app or are willing to update your navigation layer, migrating to
32+
Navigator 2.0 is the recommended long-term path.
33+
34+
1. **Adopt `go_router`** (or another Navigator 2.0-compatible package) for your app's routing.
35+
See the [go_router documentation](https://pub.dev/packages/go_router) to get started.
36+
37+
2. **Update your tests.** With `go_router`, navigation is driven by a `GoRouter` instance.
38+
In tests, you can provide a mock router with a test-specific configuration and inject it as a `Provider` so you can access it through `BuildContext`:
39+
40+
```dart
41+
final router = GoRouter(
42+
initialLocation: '/',
43+
routes: [
44+
GoRoute(path: '/', builder: (_, __) => const HomeScreen()),
45+
GoRoute(path: '/detail', builder: (_, __) => const DetailScreen()),
46+
],
47+
);
48+
49+
testWidgets('navigates to detail', (tester) async {
50+
await tester.pumpWidget(MaterialApp.router(routerConfig: router));
51+
// Interact and assert normally
52+
});
53+
```
54+
55+
3. **Remove the `mockingjay` dependency** from your `pubspec.yaml` once all usages have been replaced.
56+
57+
---
58+
59+
### Path 2 — Continue using Navigator 1.0 (no migration)
60+
61+
Navigator 1.0 is still part of Flutter and is not going away. If your project intentionally uses
62+
the imperative API and you rely on Mockingjay, you have two options:
63+
64+
- **Fork the repository** and maintain your own copy. The source code is fully public under its
65+
existing license.
66+
- **Use `NavigatorObserver` and manual test doubles** as a lightweight alternative, which requires
67+
no third-party package.
68+
69+
---
70+
71+
## Resources
72+
73+
- [go_router on pub.dev](https://pub.dev/packages/go_router)
74+
- [Flutter Navigation & Routing docs](https://docs.flutter.dev/ui/navigation)
75+
- [Navigator 2.0 overview](https://medium.com/flutter/learning-flutters-new-navigation-and-routing-system-7c9068155ade)
76+
77+
---
78+
79+
Thank you to everyone who used and contributed to Mockingjay over the years.

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ Developed with 💙 by [Very Good Ventures][very_good_ventures_link] 🦄
1313

1414
---
1515

16+
> ⚠️ **This package is deprecated and no longer actively maintained.**
17+
>
18+
> The Flutter ecosystem has shifted toward Navigator 2.0 and declarative routing solutions such as [`go_router`][go_router_link]. Mockingjay, which targets Navigator 1.0 APIs, no longer aligns with the direction of the ecosystem.
19+
>
20+
> The repository remains public and available to fork. For full migration guidance, see [DEPRECATION.md](DEPRECATION.md).
21+
22+
---
23+
1624
A package that makes it easy to mock, test and verify navigation calls in Flutter. It works in tandem with [`mocktail`][mocktail], allowing you to mock a navigator the same way you would any other object, making it easier to test navigation behavior independently from the UI it's supposed to render.
1725

1826
## Usage
@@ -112,6 +120,7 @@ void main() {
112120
[license_link]: https://opensource.org/licenses/MIT
113121
[logo_black]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_black.png#gh-light-mode-only
114122
[logo_white]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_white.png#gh-dark-mode-only
123+
[go_router_link]: https://pub.dev/packages/go_router
115124
[mocktail]: https://pub.dev/packages/mocktail
116125
[pub_badge]: https://img.shields.io/pub/v/mockingjay.svg
117126
[pub_link]: https://pub.dartlang.org/packages/mockingjay

0 commit comments

Comments
 (0)