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: 0.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 */
                  );

Libraries

Dart

dart:ui
Built-in types and core primitives for a Flutter application. [...]

Core

dart:async
Support for asynchronous programming, with classes such as Future and Stream. [...]
dart:collection
Classes and utilities that supplement the collection support in dart:core. [...]
dart:convert
Encoders and decoders for converting between different data representations, including JSON and UTF-8. [...]
dart:core
Built-in types, collections, and other core functionality for every Dart program. [...]
dart:developer
Interact with developer tools such as the debugger and inspector. [...]
dart:math
Mathematical constants and functions, plus a random number generator. [...]
dart:typed_data
Lists that efficiently handle fixed sized data (for example, unsigned 8 byte integers) and SIMD numeric types. [...]

VM

dart:io
File, socket, HTTP, and other I/O support for non-web applications. [...]
dart:isolate
Concurrent programming using isolates: independent workers that are similar to threads but don't share memory, communicating only via messages. [...]