Giter Site home page Giter Site logo

trendingtechnology / flutter_inner_drawer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dn-a/flutter_inner_drawer

0.0 2.0 0.0 8.19 MB

Inner Drawer is an easy way to create an internal side section (left/right) where you can insert a list-menu or other.

Home Page: https://pub.dartlang.org/packages/flutter_inner_drawer

License: MIT License

Java 1.74% Swift 0.75% Objective-C 0.07% Dart 97.44%

flutter_inner_drawer's Introduction

flutter_inner_drawer

pub package Donate

Inner Drawer is an easy way to create an internal side section (left/right) where you can insert a list menu or other.

Installing

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

dependencies:
  flutter_inner_drawer: "^0.2.2"

New Version 0.1.5 -> 0.2.0

Animation type

  • static
  • Linear - Linear animation from version 0.2.0 has a different behavior
  • quadratic (Linear of 0.1.5 version)

DEMO

Example

Demo 1 Pic 1

Simple usage

import 'package:flutter_inner_drawer/inner_drawer.dart';
.
.
.

    final GlobalKey<InnerDrawerState> _innerDrawerKey = GlobalKey<InnerDrawerState>();


    @override
    Widget build(BuildContext context)
    {
        return InnerDrawer(
            key: _innerDrawerKey,
            position: InnerDrawerPosition.start, // required
            onTapClose: true, // default false
            swipe: true, // default true
            offset: 0.6, // default 0.4
            colorTransition: Color.red, // default Color.black54
            animationType: InnerDrawerAnimation.linear, // default static
            innerDrawerCallback: (a) => print(a), // return bool
            child: Material(
                child: SafeArea(
                    child: Container(...)
                )
            ),
            //  A Scaffold is generally used but you are free to use other widgets
            // Note: use "automaticallyImplyLeading: false" if you do not personalize "leading" of Bar
            scaffold: Scaffold(
                appBar: AppBar(
                    automaticallyImplyLeading: false
                )
                .
                .
            ) 
            or 
            CupertinoPageScaffold(                
                navigationBar: CupertinoNavigationBar(
                    automaticallyImplyLeading: false
                ),
                .
                .
            ), 
        )
    }
    
    void _open()
    {
       _innerDrawerKey.currentState.open();
    }
    
    void _close()
    {
       _innerDrawerKey.currentState.close();
    }

All parameters

  • child - Inner Widget (required)
  • scaffold - A Scaffold is generally used but you are free to use other widgets (required)
  • position - This controls the direction in which the user should swipe to open and close the InnerDrawer (required)
  • offset - Offset drawer width (default 0.4)
  • onTapClose - bool (default false)
  • swipe - bool (default true)
  • boxShadow - BoxShadow of scaffold opened
  • colorTransition - default Colors.black54
  • animationType - static / linear / quadratic (default static)
  • innerDrawerCallback - Optional callback that is called when a InnerDrawer is opened or closed

Issues

If you encounter problems, open an issue. Pull request are also welcome.

flutter_inner_drawer's People

Contributors

dn-a avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.