All Projects → flutterings → flutter_redux_navigation

flutterings / flutter_redux_navigation

Licence: MIT license
Navigation Middleware for Flutter's redux library.

Programming Languages

dart
5743 projects
objective c
16641 projects - #2 most used programming language
java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to flutter redux navigation

godot 2d navmesh generator
Godot plugin that generates a 2D navigation mesh from collsion nodes.
Stars: ✭ 35 (-18.6%)
Mutual labels:  navigation
NavigationRouter
A router implementation designed for complex modular apps, written in Swift
Stars: ✭ 89 (+106.98%)
Mutual labels:  navigation
active admin-subnav
Enhanced sub-navigation for nested ActiveAdmin resources
Stars: ✭ 20 (-53.49%)
Mutual labels:  navigation
pygac
A python package to read and calibrate NOAA and Metop AVHRR GAC and LAC data
Stars: ✭ 14 (-67.44%)
Mutual labels:  navigation
shortcuts-for-chrome
Chrome navigation menu for technical users.
Stars: ✭ 28 (-34.88%)
Mutual labels:  navigation
graphhopper-ios
iOS Port of the GraphHopper road routing engine
Stars: ✭ 67 (+55.81%)
Mutual labels:  navigation
diractions
👨‍💻 Doing Anything, Anywhere, from Here [zsh] 🚏
Stars: ✭ 30 (-30.23%)
Mutual labels:  navigation
navigator
🧿 Build navigation or menu for Laravel and Awes.io. Unlimited complexity and depth, with permissions and sorting support.
Stars: ✭ 47 (+9.3%)
Mutual labels:  navigation
AI
使用深度强化学习解决视觉跟踪和视觉导航问题
Stars: ✭ 16 (-62.79%)
Mutual labels:  navigation
leaflet-layer-tree-plugin
No description or website provided.
Stars: ✭ 31 (-27.91%)
Mutual labels:  navigation
react-native-weather
This project is to explore React Navigation (Drawer, Tab, and Stack Navigators). And explore best practices around styling, design, and collaborating with designers for better UX for building great apps.
Stars: ✭ 51 (+18.6%)
Mutual labels:  navigation
timelens
Timelens command-line client
Stars: ✭ 39 (-9.3%)
Mutual labels:  navigation
shortcut
Quickly make and use shortcuts in your shell for easy navigation
Stars: ✭ 17 (-60.47%)
Mutual labels:  navigation
navdatareader
Navdatareader is a command line tool that uses the atools fs/bgl and fs/writer to store a full flight simulator scenery database into a relational database like Sqlite or MySql.
Stars: ✭ 35 (-18.6%)
Mutual labels:  navigation
fastgtfs
A pure Rust library that provides GTFS parsing, navigation, time table creation, and real-time network simulation.
Stars: ✭ 21 (-51.16%)
Mutual labels:  navigation
jquery-scrollwatch
jQuery plugin for determining active sections on the page based on scrolling
Stars: ✭ 18 (-58.14%)
Mutual labels:  navigation
UT Framework
Various advanced tools built for Unreal Engine 4
Stars: ✭ 45 (+4.65%)
Mutual labels:  navigation
Router-deprecated
🛣 Simple Navigation for iOS - ⚠️ Deprecated
Stars: ✭ 458 (+965.12%)
Mutual labels:  navigation
navigator.lua
Source code analysis & navigation plugin for Neovim. Navigate codes like a breeze🎐. Exploring LSP and 🌲Treesitter symbols a piece of 🍰. Take control like a boss 🦍.
Stars: ✭ 781 (+1716.28%)
Mutual labels:  navigation
SidebarOverlay
Yet another implementation of sidebar menu, but here your menu appears over the top view controller.
Stars: ✭ 66 (+53.49%)
Mutual labels:  navigation

Build Status codecov

Flutter Navigation for redux

Navigation Middleware for Flutter's redux library.

Basic classes that enables page navigation through by utilizing Redux Store middleware facility.

This package is built to work with Redux.dart 4.0.0+.

Redux Middleware

  • NavigationMiddleware<T> - The Middleware that reacts to NavigateToActions.

Examples

Take a look in the examples directory.

How to setup navigation

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

class AppState {
  final String name;
  
  const AppState(this.name);
  
  factory AppState.initial() => AppState(null);
  factory AppState.changeName(String name) => AppState(name);
}

class AppNameChangedAction {
  final String name;

  AppNameChangedAction(this.name);
}

AppState _onAppNameChanged(AppState state, AppNameChangedAction action) =>
    state.changeName(action.name);

final appReducer = combineReducers<AppState>([
  TypedReducer<AppState, AppNameChangedAction>(_onAppNameChanged),
]);


final store = new Store<AppState>(combineReducers<AppState>([appReducer]),
    initialState: AppState.initial(),
    middleware: [
      NavigationMiddleware<AppState>(),
    ]);

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return StoreProvider<AppState>(
        store: store,
        child: MaterialApp(
          title: 'My App',
          navigatorKey: NavigatorHolder.navigatorKey,
        )
    );
  }
}

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

How to navigate

Let's say you wish to navigate from a LoginPage to some dashboard page, you only need to dispatch a NavigateToAction.replace action with the appropriate path, which is registered to the dashboard page.

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

class LoginPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => LoginPageState();
}

class LoginPageState extends State<LoginPage> {
  @override
  Widget build(BuildContext context) {
    return StoreConnector<AppState, AuthBloc>(
      converter: (store) {
        return store;
      },
      builder: (BuildContext context, Store<AppState> store) {
        return Scaffold(body: Builder(
          builder: (BuildContext context) {
            return Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                RaisedButton(
                onPressed: () {
                  store.dispatch(NavigateToAction.replace('/dashboard'));
                },
                child: Text('Login'),
              )
              ],
            );
          },
        ));
      },
    );
  }
}

How to use pre and post navigation hooks

Let's use the same example as before, but now let's assume that you want to start a loader whilst navigating to the dashboard and stop it once you have navigated.

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

class LoginPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => LoginPageState();
}

class LoginPageState extends State<LoginPage> {
  @override
  Widget build(BuildContext context) {
    return StoreConnector<AppState, AuthBloc>(
      converter: (store) {
        return store;
      },
      builder: (BuildContext context, Store<AppState> store) {
        return Scaffold(body: Builder(
          builder: (BuildContext context) {
            return Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                RaisedButton(
                onPressed: () {
                  store.dispatch(
                    NavigateToAction.replace(
                      '/dashboard',
                      preNavigation: () => store.dispatch(StartLoadingAction()),
                      postNavigation: () => store.dispatch(StopLoadingAction()),
                    ),
                  );
                },
                child: Text('Login'),
              )
              ],
            );
          },
        ));
      },
    );
  }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].