residemenu 1.3.7

  • Readme
  • Changelog
  • Example
  • Installing
  • 89

flutter_residemenu #

Residemenu for flutter,android and ios supported

Screenshot #

ios

Usage #

declare in pubspec.yaml


dependencies:
  ...

  residemenu:
    ^1.3.5

build() method to create my ResideMenu Widget,child is your contentView(if you use MaterialApp,mostly Scaffold), about leftScafford,rightScafford,they are used to build your MenuView According to the layout of the public. the more you can see the demo find how to use.If you do not meet your needs, you can use the ResideMenu.custom method.



       initState(){
          _menuController = MenuController(vsync:this,direction:ScrollDirection.Left);
       }

       dispose(){
          _menuController.dispose();
       }

      Widget buildItem(msg) {
        return new Material(
          color: Colors.transparent,
          child: new InkWell(
            child: const ResideMenuItem(
                title: "菜单一", icon: const Icon(Icons.home, color: Colors.grey),right: const Icon(Icons.arrow_forward,color:Colors.grey),),
            onTap: () {
              Scaffold
                  .of(context)
                  .showSnackBar(new SnackBar(content: new Text('你点击了$msg')));
            },
          ),
        );
      }

    new ResideMenu.scafford(

            decoration: new BoxDecoration(
                image: new DecorationImage(
                    image: new AssetImage("images/menu_background.png"),
                    fit: BoxFit.cover)),
            leftScafford: new MenuScaffold(
                                  header: new ConstrainedBox(

                                    constraints: new BoxConstraints(maxHeight: 80.0, maxWidth: 80.0),
                                    child: new CircleAvatar(

                                      backgroundImage: new AssetImage('images/author.jpeg'),
                                      radius: 40.0,
                                    ),
                                  ),
                                  children: <Widget>[
                                    buildItem("菜单一"),
                                    buildItem("菜单二"),
                                    buildItem("菜单三"),
                                    buildItem("菜单四"),
                                    buildItem("菜单五")
                                  ],
                                ),
            rightScafford: ...,
            controller: _menuController,
            child: ...
            )

Table #

Attribute NameAttribute ExplainParameter TypeDefault Valuerequirement
childyour content ViewWidgetnullnecessary
leftView,rightViewthe Menu Content ViewWidgetnulloptional
elevationContent View shadowdouble12.0optional
controllerControl menu behavior, get menu status, monitor menu open, close and other events.MenuControllernulloptional
decorationuse to set bg and color in bottomBoxDecorationnulloptional
onOpenEvent(bool isOpenLeft) => Voidnulloptional
onCloseEvent() => Voidnulloptional
onOffsetChangewhen the child offset change it will callback(0~1)(double offset) => voidnulloptional
enableFadefadeColor cover content Viewbooltrueoptional
enableScaleif you the gpu too high that lead the performance problem,it should be closedbooltrueoptional

LICENSE #

MIT License

Copyright (c) 2018 Jpeng

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

[1.0.0] - 2018-5-10

  • initalRelease

[1.1.0] - 2018-5-11

  • Add ScaleAlpha Effect when open or close

[1.1.5] - 2018-5-18

  • Fix the problem of state loss of the controller
  • Add ResideMenuItem and Scfford to constructor Menu
  • Provide another way to build MenuView

[1.1.8] - 2018-5-21

  • Fix my igore to limit scroll when Direction == LEFT or RIGHT

[1.2.0] - 2018-5-22

  • Fixed when content View clicks some gestureDector can not be closed.
  • Fix itemExtent not used for Scafford

[1.2.5] - 2018-5-30

  • Add enableScale,enableFade option,ScaleAnimation has a proformance problem

[1.3.1] - 2019-6-3

  • Add enable3Drotate
  • Remove bottom menuView and bg after closeMenu(improve performance)
  • Optimizing internal code

[1.3.2] - 2019-6-3

  • Fix direction not working
  • Move direction from ResideMenu to MenuController
  • Fix onClose,onOpen callback

[1.3.3] - 2019-6-4

  • Fix decoration bug which invoke rebuild state

[1.3.5] - 2019-6-5

  • Fix init menuController not reference

[1.3.6]

  • enlarge start dx to trigger open remenu distance(if too small,user vertical gesture will open menu too)

[1.3.7]

  • interrupt close Modal when menu is open,when user press back
  • fix residemenuitem layout

example/README.md

example #

Demo

Getting Started #

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

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


dependencies:
  residemenu: ^1.3.7

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:residemenu/residemenu.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
85
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
89
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.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <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