navigate 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 87

demo #


Example source code is here

A new Flutter package for Byutifull navigation

Why develop this package #

A flutter have a package name a fluro. Fluro is a nice package and easy to use but they have some limitation. If i need to pass a parameter in Map, List type variable that not allow me. Fluro allow only string but in real time that's not good.

App development its diff from web development in web development we need to pass only small amount of data like id, slug or etc but in App development we need to pass data between screen is object , array or etc.

Getting Started #

Step 1: install navigate

navigate: 1.0.1

Step 2: Create new folder lib\config
Step 3: Create file in folder lib\config\route.dart

import 'package:flutter/material.dart';
import 'package:navigate/navigate.dart';
import 'package:testpackage/main.dart';



// define your handler here or create new file for handler 

var homeHandler = Handler(
  transactionType: TransactionType.fromRight,
  pageBuilder: (BuildContext context,arg){

      //return your page from here 
      return HomePage(replaceRoute: arg["replaceRoute"],transactionType: arg["transactionType"],);
  }
);

// define your route here 
Map<String,Handler> route = {
    "home" : homeHandler
 };

Work of above code is create one route name home . Route have their own handler called homeHandler . You can define TransactionType of slide how come on screen. Its not required if it null then Defualt transaction is work.

Step 4: Register your route
It's a final step of intigration. Now you need to register your routes with package in first page of your class constructor my landing page of app is LandingPage()

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

/* your route file */ 
import 'package:testpackage/config/route.dart';

class LandingPage extends StatelessWidget {

  LandingPage(){
   // start registration of routes 
     Navigate.registerRoutes(
      routes: route,
      defualtTransactionType: TransactionType.fromRight // if not provide in handler or manually in argument of navigation
    );
    //end  registration of routes 
  }
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text("Navigate Demo"),),
      body: Center(
            child:Text("welcome")
        ),
      ),
    );
  }
}  

Now you navigate from anywhere in app

Navigate.navigate(context,
                  "home", /* route name */
                  transactionType: transactionType, /* Override handler transaction type (optional) */
                  replaceRoute: replaceRoute, // replace route after navigate or not 
                  arg: {"transactionType":transactionType,"replaceRoute":replaceRoute} // argument data receiver in handler page builder function */
                  );

#example 2 https://github.com/ravipatel147/navigate/tree/master/example_with_threepage

<<<<<<< HEAD

  • TODO: Remove console log from the code.
  • TODO: Optimize code with support to previous version. #

[0.0.1] - TODO: Add release date.

  • TODO: Describe initial release.

f20518249ad941f940a2b70f577c307918cb44ad

example/README.md

How to run #

Clone or download code. After go in to the project directopry and run flutter run

Result #

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  navigate: ^1.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:navigate/navigate.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
75
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
87
Learn more about scoring.

We analyzed this package on Dec 5, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/navigate.dart.

Run flutter format to format lib/navigate.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.24.3 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test