hidden_drawer_menu 1.0.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 92

pub package

Hidden Drawer Menu #

Hidden Drawer Menu is a library for adding a beautiful drawer mode menu feature with perspective animation.

You can use a pre-defined menu or make a fully customized menu.

Usage of the hidden_drawer_menu widget on an android device

Use with default menu #

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  List<ScreenHiddenDrawer> itens = new List();

  @override
  void initState() {
    itens.add(new ScreenHiddenDrawer(
        new ItemHiddenMenu(
          name: "Screen 1",
          colorTextUnSelected: Colors.white.withOpacity(0.5),
          colorLineSelected: Colors.teal,
        ),
        FirstSreen()));

    itens.add(new ScreenHiddenDrawer(
        new ItemHiddenMenu(
          name: "Screen 2",
          colorTextUnSelected: Colors.white.withOpacity(0.5),
          colorLineSelected: Colors.orange,
        ),
        SecondSreen()));

    super.initState();
  }

  @override
  Widget build(BuildContext context) {

    return HiddenDrawerMenu(
      backgroundColorMenu: Colors.blueGrey,
      backgroundColorAppBar: Colors.cyan,
      screens: itens,
    );
    
  }
}

Use with full customization menu #

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: SimpleHiddenDrawer(
        whithAutoTittleName: true,
        menu: Menu(),
        screenSelectedBuilder: (position) {
          switch(position){
            case 0 : return Screen1(); break;
            case 1 : return Screen2(); break;
            case 2 : return Screen3(); break;
          }
        },
      ),
    );
  }
}

class Menu extends StatefulWidget {
  @override
  _SecondSreenState createState() => _MenuState();
}

class _MenuState extends State<SecondSreen> {
  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.maxFinite,
      height: double.maxFinite,
      color: Colors.cyan,
      padding: const EdgeInsets.all(8.0),
      child: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            RaisedButton(
              onPressed: () {
                SimpleHiddenDrawerProvider.of(context)
                    .setSelectedMenuPosition(0);
              },
              child: Text("Menu 1"),
            ),
            RaisedButton(
                onPressed: () {
                  SimpleHiddenDrawerProvider.of(context)
                      .setSelectedMenuPosition(1);
                },
                child: Text("Menu 2"))
          ],
        ),
      ),
    );
  }
}

Actions #

This actions is only accessible by the children of HiddenDrawerMenu or SimpleHiddenDrawer.

Select item menu #

SimpleHiddenDrawerProvider.of(context).setSelectedMenuPosition(0);

Toggle menu (if opened will close, if closed will open) #

SimpleHiddenDrawerProvider.of(context).toggle();

Listern position selected in menu #

SimpleHiddenDrawerProvider.of(context).getPositionSelectedListern().listen((position){
  print(position);
});

If you want to use only the widget responsible for the animation, it is now available as AnimatedDrawerContent #

Example usage AnimatedDrawerContent

HiddenDrawerController controller = HiddenDrawerController(vsync: this);

return AnimatedDrawerContent(
  controller: controller,
  whithPaddingTop: false, (optional) default = false // Add padding top in de gesture equals Heigth of the AppBar
  whithShadow: false,(optional) default = false
  isDraggable: true,(optional) default = true
  child: Screen(),
);

You can control actions by controller such as:

controller.toggle() // Open or Close
controller.open()
controller.close()
controller.move(percent) // moves to a specific position from 0 to 1 (0 = fully enclosed, 1 = fully opened)

Available settings #

  • change BackgroundColor
  • set DecorationImage backgroud
  • enable Shadow above itens

Itens Menu #

  • change colorText when selected
  • change colorText when unselected
  • change color lineleft selected

AppBar #

  • change menu icon
  • change elavation
  • change BackgroundColor
  • set AutoTittleName
  • set actions
  • set widget in tittleAppBar

Content #

  • change BackgroundColor
  • enable dragable
  • change curve animation

[0.0.1] - TODO: Add release date.

  • TODO: Start first version Hidden Drawer.

[0.0.2] - TODO: Add release date.

  • TODO: Update readme

[0.0.3] - TODO: Add release date.

  • TODO: Update readme

[0.0.4] - TODO: Add release date.

  • TODO: Update readme

[0.0.5] - TODO: Add BloC architecture.

  • TODO: Update readme
  • TODO: Add BloC architecture
  • TODO: Improve performance

[0.1.0] - TODO: Fix bugs.

  • TODO: Remove builder
  • TODO: Remove BlocProvider

[0.2.0] - TODO: ADD Gesture to open and close.

  • TODO: ADD Gesture to open and close
  • TODO: Optimizations in Bloc

[0.5.0] - TODO: ADD SimpleHiddenDrawer.

  • TODO: ADD SimpleHiddenDrawer: This allows great customization of the menu
  • TODO: Optimizations
  • TODO: ADD BlocProvider

[1.0.0] - TODO: ADD SimpleHiddenDrawer.

  • TODO: Removes perspective effect due to problems with ClipRRect
  • TODO: Optimizations
  • TODO: Separate animation component (AnimatedDrawerContent)

[1.0.1] - TODO: ADD SimpleHiddenDrawer.

  • TODO: Added configurable slidePercent
  • TODO: Added verticalScalePercent and contentCornerRadius and styles
  • TODO: Optimizations in animations

example/README.md

Example Usage #

import 'package:flutter/material.dart';
import 'package:hidden_drawer_menu/hidden_drawer/hidden_drawer_menu.dart';
import 'package:hidden_drawer_menu/menu/item_hidden_menu.dart';
import 'package:hidden_drawer_menu/hidden_drawer/screen_hidden_drawer.dart';

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  List<ScreenHiddenDrawer> itens = new List();

  @override
  void initState() {
    itens.add(new ScreenHiddenDrawer(
        new ItemHiddenMenu(
          name: "Screen 1",
          colorLineSelected: Colors.teal,
          baseStyle: TextStyle( color: Colors.white.withOpacity(0.5), fontSize: 25.0 ),
          selectedStyle: TextStyle(color: Colors.teal),
        ),
        Container(
          color: Colors.teal,
          child: Center(
            child: Text("Screen 1",
                style: TextStyle(color: Colors.white, fontSize: 30.0)),
          ),
        )));

    itens.add(new ScreenHiddenDrawer(
        new ItemHiddenMenu(
          name: "Screen 2",
          colorLineSelected: Colors.orange,
          baseStyle: TextStyle( color: Colors.white.withOpacity(0.5), fontSize: 25.0 ),
          selectedStyle: TextStyle(color: Colors.orange),
        ),
        Container(
          color: Colors.orange,
          child: Center(
            child: Text(
              "Screen 2",
              style: TextStyle(color: Colors.white, fontSize: 30.0),
            ),
          ),
        )));

    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return HiddenDrawerMenu(
          initPositionSelected: 0,
          screens: itens,
          backgroundColorMenu: Colors.cyan,
    //    slidePercent: 80.0,
    //    verticalScalePercent: 80.0,
    //    contentCornerRadius: 10.0,
    //    iconMenuAppBar: Icon(Icons.menu),
    //    backgroundContent: DecorationImage((image: ExactAssetImage('assets/bg_news.jpg'),fit: BoxFit.cover),
    //    whithAutoTittleName: true,
    //    styleAutoTittleName: TextStyle(color: Colors.red),
    //    actionsAppBar: <Widget>[],
    //    backgroundColorContent: Colors.blue,
    //    backgroundColorAppBar: Colors.blue,
    //    elevationAppBar: 4.0,
    //    tittleAppBar: Center(child: Icon(Icons.ac_unit),),
    //    enableShadowItensMenu: true,
    //    backgroundMenu: DecorationImage(image: ExactAssetImage('assets/bg_news.jpg'),fit: BoxFit.cover),
        );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  hidden_drawer_menu: ^1.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:hidden_drawer_menu/controllers/hidden_drawer_controller.dart';
import 'package:hidden_drawer_menu/hidden_drawer/hidden_drawer_menu.dart';
import 'package:hidden_drawer_menu/hidden_drawer/screen_hidden_drawer.dart';
import 'package:hidden_drawer_menu/menu/hidden_menu.dart';
import 'package:hidden_drawer_menu/menu/item_hidden_menu.dart';
import 'package:hidden_drawer_menu/simple_hidden_drawer/animated_drawer_content.dart';
import 'package:hidden_drawer_menu/simple_hidden_drawer/bloc/simple_hidden_drawer_bloc.dart';
import 'package:hidden_drawer_menu/simple_hidden_drawer/provider/simple_hidden_drawer_provider.dart';
import 'package:hidden_drawer_menu/simple_hidden_drawer/simple_hidden_drawer.dart';
import 'package:hidden_drawer_menu/simple_hidden_drawer/streams/streams_simple_hidden_menu.dart';
  
Version Uploaded Documentation Archive
1.0.1 Apr 10, 2019 Go to the documentation of hidden_drawer_menu 1.0.1 Download hidden_drawer_menu 1.0.1 archive
1.0.0 Mar 10, 2019 Go to the documentation of hidden_drawer_menu 1.0.0 Download hidden_drawer_menu 1.0.0 archive
0.5.0 Jan 24, 2019 Go to the documentation of hidden_drawer_menu 0.5.0 Download hidden_drawer_menu 0.5.0 archive
0.2.0 Dec 16, 2018 Go to the documentation of hidden_drawer_menu 0.2.0 Download hidden_drawer_menu 0.2.0 archive
0.1.0 Dec 3, 2018 Go to the documentation of hidden_drawer_menu 0.1.0 Download hidden_drawer_menu 0.1.0 archive
0.0.5 Nov 28, 2018 Go to the documentation of hidden_drawer_menu 0.0.5 Download hidden_drawer_menu 0.0.5 archive
0.0.4 Nov 21, 2018 Go to the documentation of hidden_drawer_menu 0.0.4 Download hidden_drawer_menu 0.0.4 archive
0.0.3 Nov 21, 2018 Go to the documentation of hidden_drawer_menu 0.0.3 Download hidden_drawer_menu 0.0.3 archive
0.0.2 Nov 20, 2018 Go to the documentation of hidden_drawer_menu 0.0.2 Download hidden_drawer_menu 0.0.2 archive
0.0.1 Nov 20, 2018 Go to the documentation of hidden_drawer_menu 0.0.1 Download hidden_drawer_menu 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
84
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]
92
Learn more about scoring.

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

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.4.7

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/controllers/hidden_drawer_controller.dart.

Run flutter format to format lib/controllers/hidden_drawer_controller.dart.

Format lib/hidden_drawer/hidden_drawer_menu.dart.

Run flutter format to format lib/hidden_drawer/hidden_drawer_menu.dart.

Format lib/hidden_drawer/screen_hidden_drawer.dart.

Run flutter format to format lib/hidden_drawer/screen_hidden_drawer.dart.

Fix additional 7 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/menu/hidden_menu.dart (Run flutter format to format lib/menu/hidden_menu.dart.)
  • lib/menu/item_hidden_menu.dart (Run flutter format to format lib/menu/item_hidden_menu.dart.)
  • lib/simple_hidden_drawer/animated_drawer_content.dart (Run flutter format to format lib/simple_hidden_drawer/animated_drawer_content.dart.)
  • lib/simple_hidden_drawer/bloc/simple_hidden_drawer_bloc.dart (Run flutter format to format lib/simple_hidden_drawer/bloc/simple_hidden_drawer_bloc.dart.)
  • lib/simple_hidden_drawer/provider/simple_hidden_drawer_provider.dart (Run flutter format to format lib/simple_hidden_drawer/provider/simple_hidden_drawer_provider.dart.)
  • lib/simple_hidden_drawer/simple_hidden_drawer.dart (Run flutter format to format lib/simple_hidden_drawer/simple_hidden_drawer.dart.)
  • lib/simple_hidden_drawer/streams/streams_simple_hidden_menu.dart (Run flutter format to format lib/simple_hidden_drawer/streams/streams_simple_hidden_menu.dart.)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test