• Stars
    star
    147
  • Rank 251,347 (Top 5 %)
  • Language
    Dart
  • Created about 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Bunch of examples of Navigator 2.0

Navigator 2.0 examples

Web demo of Router usage.

Navigator 2.0 Pages API example and Router example.

The main point of these examples is to show how to extract basic navigation logic to separate class (e.g. ChangeNotifier). I'm using 2 approaches:

  • Pages API
  • Router widget

Both of them use separate PageManager (or RoutePageManager) to handle navigation stack.

Pages API

Navigator's Pages API is a convenient way to declaratively set navigation stack in your Flutter app. Take a look at the main.dart entry point and please notice custom PageManager class that is handling list of pages provided to Navigator.

Router widget

For more complex and robust needs you may use the Router widget. Simple implementation can be found in main_router.dart entry point. Take a look at the custom TheAppPath class storing typed path information and RoutePageManager handling list of pages provided to the Navigator.

Web address handling

Because the RoutePageManager is notifying the Router about its changes and the currentPath is used as currentConfiguration the address bar in the browser is reflecting the stack changes:

  @override
  TheAppPath get currentConfiguration => pageManager.currentPath;

More

Run on Flutter dev (1.23)

Presentation at Flutter Cracow (Sept. 17th, 2020)

Presentation at DevFest Poland 2020

Presentation at Geekle Cross-Platform Mobile Development Summit 2020

Special thanks to Simon Lightfoot and Andrew Coutts.

See more also in the Stocks app example using Router.

More Repositories

1

animations_samples

Flutter animation showcase
Dart
120
star
2

fitness_tracker

Simple app to track fitness stats
Dart
34
star
3

flutter_i18n_2021

Sample project showing basic setup with new i18n Flutter approach
Dart
28
star
4

flutter-flavors

Flutter with 3 flavors dev, tst and prod for iOS and Android with fastlane support
Dart
26
star
5

flutter_focus_book_manager

Project showcase of Flutter focus and keyboard shortcuts in a desktop app
Dart
21
star
6

wut_thesis

LaTeX unofficial template for diploma thesis at Warsaw University of Technology (2016) / Szablon pracy dyplomowej na Politechnice Warszawskiej w LaTeX-u
TeX
7
star
7

mason_bricks

Collection of personal bricks used in Flutter projects
Dart
6
star
8

flutter_create_solar_system

Flutter Create submission
Dart
5
star
9

i18n_example_flutter

App showing how to efficiently use internationalization in Flutter
Dart
5
star
10

animated_flutter_logo

Animated Flutter logo created with custom painters
Dart
4
star
11

codemagic_manager

Simple library to fetch builds and applications details from Codemagic API
Dart
4
star
12

gedcom-dart

Dart library to parse GEDCOM data
Dart
4
star
13

bottomnavview-xamarin-example

Example showing navigation in MvvmCross with BottomNavigationView in Xamarin.Android
C#
4
star
14

platform_views_camera

Companion repository for the Platform Views blog post and presentation
Swift
4
star
15

bitrise-step-bitrise-abort-if-no-changes

Simple Bitrise step to abort build when no changes occured in specified directories
Shell
3
star
16

dart_utilities

Simple CLI to generate simple changelog
Dart
3
star
17

camera2

Fork of camera plugin for Flutter with flash and autofocus support (forked from https://github.com/gummie4444/flutter-better-camera)
Dart
2
star
18

matrix_rotate_arbitrary_axis

Dart library to generate rotation matrix around arbitrary axis.
Dart
2
star
19

flutter_issue_platform_views

Repository for issue https://github.com/flutter/flutter/issues/109929
Dart
2
star
20

plugins_fixes

Dart
1
star
21

cubesat-standards-handbook

A Survey of International Space Standards with Application for CubeSat Missions
TeX
1
star