nuvigator 1.2.0-beta.0 copy "nuvigator: ^1.2.0-beta.0" to clipboard
nuvigator: ^1.2.0-beta.0 copied to clipboard

outdated

A powerful routing abstraction over Flutter navigator, providing some new features and an easy way to define routers.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:nuvigator/next.dart';
import 'package:provider/provider.dart';
import 'samples/bloc/samples_bloc.dart';
import 'samples/modules/friend_request/bloc/friend_request_bloc.dart';
import 'samples/router.dart';

void main() => runApp(MyApp());

class TestObserver extends NavigatorObserver {
  @override
  void didPush(Route<dynamic> route, Route<dynamic> previousRoute) {
    print('didPush $route');
  }

  @override
  void didPop(Route<dynamic> route, Route<dynamic> previousRoute) {
    print('didPop $route');
  }

  @override
  void didRemove(Route<dynamic> route, Route<dynamic> previousRoute) {
    print('didRemove $route');
  }

  @override
  void didReplace({Route<dynamic> newRoute, Route<dynamic> oldRoute}) {
    print('didReplace $oldRoute to $newRoute');
  }
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Nuvigator Example',
      theme: ThemeData(
        primarySwatch: Colors.deepPurple,
      ),
      builder: (_, __) => ChangeNotifierProvider<SamplesBloc>.value(
        value: SamplesBloc(),
        child: ChangeNotifierProvider.value(
          value: FriendRequestBloc(10),
          child: Nuvigator(
            router: MainAppRouter(),
          ),
        ),
      ),
    );
  }
}
48
likes
0
pub points
25%
popularity

Publisher

verified publishernubank.dev

A powerful routing abstraction over Flutter navigator, providing some new features and an easy way to define routers.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

analyzer, build, build_config, code_builder, dart_style, flutter, path_to_regexp, recase, source_gen

More

Packages that depend on nuvigator