v2.0.1
nuvigator
Flutter 네비게이터 위에 있는 강력한 라우팅 추상화로, 몇 가지 새로운 기능을 제공하고 라우터를 정의하는 쉬운 방법을 제공합니다.
50좋아요 1.9만30일 다운로드140Pub 점수
AndroidiOSWebmacOSWindowsLinux
Flutter Navigator 위의 강력한 라우팅 추상화. 중첩된 Navigator 및 딥링크를 지원
^2.0.2{"sdk":"flutter"}^0.4.0^4.0.0^2.0.1{"sdk":"flutter"}^5.0.8아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
Routing and Navigation package.
Não fala bem inglês? Leia o README_PT
Nuvigator provides a powerful routing abstraction over Flutter's own Navigators. Model complex navigation flows using a mostly declarative and concise approach, without needing to worry about several tricky behaviors that Nuvigator handles for you.
Nuvigator can help you with:
Focus on providing a more flexible, easier and dynamic API for declaring Navigation and Routing
The simplest you can get:
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Nuvigator App',
builder: Nuvigator.routes(
initialRoute: 'home',
screenType: materialScreenType,
routes: [
NuRouteBuilder(path: 'home', builder: (_, __, ___) => HomeScreen()),
NuRouteBuilder(path: 'second', builder: (_, __, ___) => SecondScreen()),
],
),
);
}
}
A more complete example:
import 'package:nuvigator/next.dart'; // import the next file instead of `nuvigator.dart`
import 'package:flutter/material.dart';
// Define a new NuRoute
class MyRoute extends NuRoute {
@override
String get path => 'my-route';
@override
ScreenType get screenType => materialScreenType;
@override
Widget build(BuildContext context, NuRouteSettings settings) {
return MyScreen(
onClick: () => nuvigator.open('next-route'),
);
}
}
// Define your NuRouter
class MyRouter extends NuRouter {
@override
String get initialRoute => 'my-route';
@override
List<NuRoute> get registerRoutes => [
MyRoute(),
];
}
// Render
Widget build(BuildContext context) {
return Nuvigator(
router: MyRouter(),
);
}