widget_router 0.0.2 copy "widget_router: ^0.0.2" to clipboard
widget_router: ^0.0.2 copied to clipboard

A Dart and Flutter Package to navigate in Apps that have different Screens depending on the OS

example/main.dart

library widget_router;

import 'package:flutter/material.dart';
import 'package:widget_router/widget_router.dart';

import 'screens/desktop/unknown_screen_mobile.dart';
import 'screens/mobile/unknown_screen_desktop.dart';
import 'screens/shared/homescreen.dart';

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

/// Example App for Widget Router Pacakge
class ExampleApp extends StatelessWidget {
  const ExampleApp({Key? key}) : super(key: key);

  @WidgetRouterSet()
  static const Set<RouteWidget> routes = {
    RouteWidget(
      name: 'Homescreen',
      routeName: '/home',
      doc: 'The Homescreen of this App',
      desktopWidget: Homescreen(),
      mobileWidget: Homescreen(),
    ),
  };

  @override
  Widget build(BuildContext context) {
    RouteWidget.setUnkownScreens(
      mobile: const UnknownScreenMobile(),
      desktop: const UnknownScreenDesktop(),
    );
    return const MaterialApp(
      home: Homescreen(),
    );
  }
}
1
likes
140
points
55
downloads

Publisher

verified publisherjulianschumacher.dev

Weekly Downloads

A Dart and Flutter Package to navigate in Apps that have different Screens depending on the OS

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

analyzer, build, build_config, build_runner, flutter, source_gen

More

Packages that depend on widget_router