navigator_resizable
4.0.0, released 6 days ago by norelease.dev
A widget that resizes a child Navigator to its current route's intrinsic size.
What it does
NavigatorResizable wraps a Navigator and automatically adjusts its size to match the content of the active route. It works with standard navigation APIs and the Pages API, fixing size lag and assertion issues.
AI-written summary of version 4.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a Navigator that does not occupy the full screen size
- You want the surrounding layout to adapt to route content size
- You use go_router or auto_route and need intrinsic sizing
Skip it when
- Your app relies on the default full‑screen Navigator behavior
- You cannot migrate to material_ui due to widget incompatibilities
Strengths
- Provides intrinsic sizing for nested navigators
- Fixes flicker and assertion bugs on iOS and overlays
- Compatible with common navigation packages
Weaknesses
- Requires migration to material_ui which may cause runtime conflicts
- Only works on Flutter 3.5+
- Limited to resizing; does not add navigation features
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 1
Add navigator_resizable and material_ui to pubspec, migrate existing material imports to material_ui as described in the migration guide.
```dart
import 'package:flutter/material.dart';
import 'package:navigator_resizable/navigator_resizable.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: NavigatorResizable(
child: Navigator(
onGenerateRoute: (settings) => MaterialPageRoute(
builder: (_) => const HomePage(),
),
),
),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) => const Scaffold(body: Center(child: Text('Hello')));
}
```Alternatives
Packages that do the same job and could replace navigator_resizable.
Works with
Packages commonly used together with navigator_resizable: ones it builds on, ones built on it, and its own family.