menu_swipe_helpers 0.4.1

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

menu_swipe_helpers

Build Status pub package

Helpers to create applications with menu swipe.

screenshot

Show menu_swipe example.

Getting Started

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

For help on editing package code, view the documentation.

[0.4.1] - 23/04/2018

  • hide bottom space

[0.4.0] - 23/04/2018

BREAKING CHANGE

  • remove redux - rewrite a lot (see example)

[0.3.1] - 18/04/2018

  • add params to createDrawerStore
  • add middleware to update first page on change drawer

[0.3.0] - 17/04/2018

BREAKING CHANGE

  • dart 2 strong types

[0.2.3] - 22/03/2018

BREAKING CHANGE

  • change DrawerDefinition constructor

[0.2.2] - 22/03/2018

  • change DrawerDefinition to a class
  • deprecated BaseDrawerDefinition
  • refactoring code

[0.2.1] - 21/03/2018

  • add createDrawerStore
  • add BaseDrawerDefinition

[0.2.1] - 21/03/2018

  • add createDrawerStore
  • add BaseDrawerDefinition

[0.2.0] - 03/03/2018

BREAKING CHANGE

  • Replace scoped_model with flutter_redux !

[0.1.1] - 26/02/2018

  • add Travis
  • update README

[0.1.0] - 26/02/2018

  • Improve package description
  • add LICENCE

[0.0.4] - 24/02/2018

  • add tests

[0.0.3] - 23/02/2018

  • change example link

[0.0.2] - 23/02/2018

  • Fix dependencies
  • add example

[0.0.1] - 23/02/2018

  • initial release

example/lib/main.dart

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

const String _kAsset0 = 'avatars/yann.jpg';
const String _kGalleryAssetsPackage = 'flutter_plugins_assets';

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new DrawerProvider(
        drawer: _drawerBuilder,
        child: new FirstPage(
          title: "First Page",
        ),
      ),
    );
  }
}

class FirstPage extends StatefulWidget {
  final String title;

  FirstPage({this.title});

  @override
  _FirstPage createState() => new _FirstPage();
}

class _FirstPage extends State<FirstPage> with DrawerStateMixin {
  List<Widget> buildActions() => [
        new IconButton(
            icon: new Icon(Icons.chevron_right),
            onPressed: () => Navigator.of(context).push(
                new MaterialPageRoute<Null>(
                    builder: (BuildContext context) => new SecondPage()))),
      ];

  @override
  Widget buildBody() {
    var _style = Theme.of(context).textTheme.subhead;
    return new Container(
        decoration: new BoxDecoration(color: Colors.green),
        child: new Center(
          child: new Column(
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
              new Padding(
                padding: const EdgeInsets.all(32.0),
                child: new Text('''
Very basic page, go to the other pages to see more
              ''', style: _style, softWrap: true),
              ),
            ],
          ),
        ));
  }

  @override
  String get title => widget.title;
}

class SecondPage extends StatefulWidget {
  @override
  _SecondPage createState() => new _SecondPage();
}

class _SecondPage extends State<SecondPage> with DrawerStateMixin {
  @override
  Widget buildBody() {
    var _style = Theme.of(context).textTheme.subhead;
    return new Container(
        decoration: new BoxDecoration(color: Colors.red),
        child: new Center(
          child: new Column(
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
              new Text("Demo", style: _style),
              new Padding(
                padding: const EdgeInsets.all(32.0),
                child: new Text('''
Action in app bar
Persistent Footer Button
Floating button
              ''', style: _style, softWrap: true),
              ),
            ],
          ),
        ));
  }

  @override
  List<Widget> buildPersistentFooterButtons() {
    return [
      new ButtonBar(
        alignment: MainAxisAlignment.center,
        mainAxisSize: MainAxisSize.min,
        children: <Widget>[
          new FlatButton(
              onPressed: () => {
                    //TODO not implemented
                  },
              child: new Row(
                children: <Widget>[
                  new Text("BUTTON"),
                ],
              )),
        ],
      )
    ];
  }

  @override
  Widget buildFloatingButton() {
    return new FloatingActionButton(
        child: new Icon(Icons.add),
        onPressed: () => {
              //TODO not implemented
            });
  }

  @override
  String get title => "Second Page";

  @override
  bool get hideDrawer => true;
}

class ThirdPage extends StatefulWidget {
  @override
  _ThirdPage createState() => new _ThirdPage();
}

class _ThirdPage extends State<ThirdPage> {
  final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();

  bool _first = true;

  void updateDrawer() {
    DrawerProvider.changeDrawer(
        context, _first ? _drawerBuilder2 : _drawerBuilder);
    _first = !_first;
  }

  @override
  Widget build(BuildContext context) {
    var _style = Theme.of(context).textTheme.subhead;

    return new Scaffold(
      key: _scaffoldKey,
      drawer: DrawerProvider.drawerOf(context),
      body: new Center(
        child: new Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            new InkWell(
              child: new Text(
                '''
Page from scatch 
TAP to open the drawer
              ''',
                style: _style,
                softWrap: true,
              ),
              onTap: () {
                _scaffoldKey.currentState.openDrawer();
              },
            ),
            new RaisedButton(
                child: new Row(
                  children: <Widget>[
                    new Text("Change menu swipe"),
                  ],
                ),
                onPressed: () {
                  updateDrawer();
                })
          ],
        ),
      ),
    );
  }
}

Widget _userAccountDrawer(BuildContext context) => new UserAccountsDrawerHeader(
      accountName: new Text("Yann-Cyril Pelud"),
      accountEmail: new Text("yann@fidelisa.com"),
      currentAccountPicture: new CircleAvatar(
        backgroundImage: new AssetImage(
          _kAsset0,
          package: _kGalleryAssetsPackage,
        ),
      ),
      margin: EdgeInsets.zero,
    );

var _firstPage = new DrawerDefinition(
    title: "First page",
    iconData: Icons.home,
    widgetBuilder: (BuildContext context) =>
        new FirstPage(title: "First Page"));

var _secondPage = new DrawerDefinition(
    title: "Second page",
    iconData: Icons.store,
    widgetBuilder: (BuildContext context) => new SecondPage(),
    hideDrawer: true);

var _thirdPage = new DrawerDefinition(
    title: "Third page",
    iconData: Icons.email,
    widgetBuilder: (BuildContext context) => new ThirdPage());

var _fourthPage = new DrawerDefinition(
    title: "Fourth page",
    iconData: Icons.home,
    widgetBuilder: (BuildContext context) =>
        new FirstPage(title: "Fourth Page"));

var _drawerBuilder = new DrawerHelper(
  drawerContents: [_firstPage, _secondPage, _thirdPage],
  userAccountsDrawerHeader: _userAccountDrawer,
);

var _drawerBuilder2 = new DrawerHelper(
    drawerContents: [_firstPage, _secondPage, _thirdPage, _fourthPage],
    userAccountsDrawerHeader: _userAccountDrawer);

Use this package as a library

1. Depend on it

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


dependencies:
  menu_swipe_helpers: "^0.4.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:menu_swipe_helpers/menu_swipe_helpers.dart';
  
Version Uploaded Documentation Archive
0.4.1 May 17, 2018 Go to the documentation of menu_swipe_helpers 0.4.1 Download menu_swipe_helpers 0.4.1 archive
0.4.0 May 9, 2018 Go to the documentation of menu_swipe_helpers 0.4.0 Download menu_swipe_helpers 0.4.0 archive
0.2.3 Mar 22, 2018 Go to the documentation of menu_swipe_helpers 0.2.3 Download menu_swipe_helpers 0.2.3 archive
0.2.2 Mar 22, 2018 Go to the documentation of menu_swipe_helpers 0.2.2 Download menu_swipe_helpers 0.2.2 archive
0.2.1 Mar 21, 2018 Go to the documentation of menu_swipe_helpers 0.2.1 Download menu_swipe_helpers 0.2.1 archive
0.2.0 Mar 4, 2018 Go to the documentation of menu_swipe_helpers 0.2.0 Download menu_swipe_helpers 0.2.0 archive
0.1.1 Feb 26, 2018 Go to the documentation of menu_swipe_helpers 0.1.1 Download menu_swipe_helpers 0.1.1 archive
0.1.0 Feb 26, 2018 Go to the documentation of menu_swipe_helpers 0.1.0 Download menu_swipe_helpers 0.1.0 archive
0.0.4 Feb 24, 2018 Go to the documentation of menu_swipe_helpers 0.0.4 Download menu_swipe_helpers 0.0.4 archive
0.0.3 Feb 23, 2018 Go to the documentation of menu_swipe_helpers 0.0.3 Download menu_swipe_helpers 0.0.3 archive

All 12 versions...

Analysis

We analyzed this package on May 22, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.54.0
  • pana: 0.11.1
  • Flutter: 0.4.4

Scores

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

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Suggestions

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <2.1.0
flutter 0.0.0
Transitive dependencies
collection 1.14.6 1.14.9
meta 1.1.5
sky_engine 0.0.99
typed_data 1.1.5
vector_math 2.0.6 2.0.7
Dev dependencies
flutter_test
test >=0.12.0 <=0.13.0