native_page_route 1.0.0 copy "native_page_route: ^1.0.0" to clipboard
native_page_route: ^1.0.0 copied to clipboard

Wraps creation of native page route in simple function. Also provide function with preventing of creation the same route twice. Is fully tested on mobile.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:native_page_route_example/router.dart';

class NavigationService {
  static GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
}

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Native route example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      navigatorKey: NavigationService.navigatorKey,
      initialRoute: RouteKeys.firstScreen,
      onGenerateRoute: AppRouter,
    );
  }
}
4
likes
160
pub points
32%
popularity

Publisher

unverified uploader

Wraps creation of native page route in simple function. Also provide function with preventing of creation the same route twice. Is fully tested on mobile.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on native_page_route