swipe_up_menu 0.1.3

Swipe Up Menu #

Pub Pull Requests are welcome Pull Requests are welcome Codemagic build status

A Flutter package to create a Swipe Menu who appears when slide on the right side of screen.

Showcase

Basic Usage #

SwipeUpMenu(
    body: <Widget>[
        Scaffold(appBar: AppBar(title: Text("Page 1"), centerTitle:  true), backgroundColor: Colors.blue),
        Scaffold(appBar: AppBar(title: Text("Page 2"), centerTitle:  true), backgroundColor: Colors.yellow),
    ],
    items: <SwipeUpMenuItem>[
        SwipeUpMenuItem(title: Text("Menu 1"), icon: Icon(Icons.home, color: Colors.white), backgroundColor: Colors.blue),
        SwipeUpMenuItem(title: Text("Menu 2"), icon: Icon(Icons.mail, color: Colors.white), backgroundColor: Colors.yellow),
    ],
    startIndex: 0,
    onChange: (index){},
    animationDuration: Duration(milliseconds: 500)
)

Options #

PropertyTypeDescriptionDefault
required bodyListThe list of body of your App-
required itemsListThe list of items to show in menu-
startIndexIntegerThe start index of menus0
onChangeFunctionThe function who return a index when it changenull
animationDurationDurationThe duration of animationDuration(milliseconds:500)

0.1.3 #

  • Fix the scroll when have a page with ListView.

0.1.2 #

  • Set animation duration as parameter.

0.1.1 #

  • Fix assertion in onChange parameter.

0.1.0 #

  • First functional release.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: 'Swipe Up Menu Example',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        debugShowCheckedModeBanner: false,
        home: Home());
  }
}

class Home extends StatefulWidget {
  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {
  @override
  Widget build(BuildContext context) {
    return SwipeUpMenu(
      body: <Widget>[
        Scaffold(
            appBar: AppBar(title: Text("Page 1", style: TextStyle(color: Colors.white)), centerTitle: true),
            backgroundColor: Colors.blue),
        Scaffold(
            appBar: AppBar(title: Text("Page 2", style: TextStyle(color: Colors.white)), centerTitle: true),
            backgroundColor: Colors.yellow),
        Scaffold(
            appBar: AppBar(title: Text("Page 3", style: TextStyle(color: Colors.white)), centerTitle: true),
            backgroundColor: Colors.red),
        Scaffold(
            appBar: AppBar(title: Text("Page 4", style: TextStyle(color: Colors.white)), centerTitle: true),
            backgroundColor: Colors.green),
        Scaffold(
            appBar: AppBar(title: Text("Page 5", style: TextStyle(color: Colors.white)), centerTitle: true),
            backgroundColor: Colors.purple),
      ],
      items: <SwipeUpMenuItem>[
        SwipeUpMenuItem(
            title: Text("Menu 1", style: TextStyle(color: Colors.white)),
            icon: Icon(Icons.home, color: Colors.white),
            backgroundColor: Colors.blue),
        SwipeUpMenuItem(
            title: Text("Menu 2", style: TextStyle(color: Colors.white)),
            icon: Icon(Icons.mail, color: Colors.white),
            backgroundColor: Colors.yellow),
        SwipeUpMenuItem(
            title: Text("Menu 3", style: TextStyle(color: Colors.white)),
            icon: Icon(Icons.phone, color: Colors.white),
            backgroundColor: Colors.red),
        SwipeUpMenuItem(
            title: Text("Menu 4", style: TextStyle(color: Colors.white)),
            icon: Icon(Icons.search, color: Colors.white),
            backgroundColor: Colors.green),
        SwipeUpMenuItem(title: Text("Menu 5", style: TextStyle(color: Colors.white)), backgroundColor: Colors.purple),
      ],
      animationDuration: Duration(milliseconds: 50),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  swipe_up_menu: ^0.1.3

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:swipe_up_menu/swipe_up_menu.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
28
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]
64
Learn more about scoring.

We analyzed this package on Feb 19, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.7

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.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
build_runner any
flutter_test