show_drawer 0.0.5

  • Readme
  • Changelog
  • Example
  • Installing
  • new60

show_drawer #

show_drawer plugin for Flutter. Supports iOS, Web, Android and MacOS.

Getting Started #

In your flutter project add the dependency:

dependencies:
  ...
 show_drawer: ^0.0.5

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

Document #

See document in pub.dev

Usage #

import 'package:show_drawer/show_drawer.dart';
    showDrawer(
      context: context,
      builder: (_, __, ___) {
        return // some Widget;
      },
    );
  }

Example #

Example source code in the folder example

image

0.0.4 #

  • add expmple
  • remove child api
  • Add some basic LICENSE, README... files

0.0.3 - #

  • Unstable phase.

example/lib/main.dart

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

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'showDrawer example',
      home: Scaffold(body: Body()),
      // showPerformanceOverlay: true,
    );
  }
}

class OverlayBox extends StatelessWidget {
  final Widget child;
  OverlayBox({this.child});

  @override
  Widget build(Object context) {
    return Container(
      color: Colors.grey[200],
      child: Overlay(
        initialEntries: [
          OverlayEntry(
            builder: (_) => child,
          ),
        ],
      ),
    );
  }
}

class Test extends StatelessWidget {
  final String title;
  Test({this.title});

  generateRaisedButton(
    String title,
    Alignment alignment,
    BuildContext context,
  ) {
    return Expanded(
      child: RaisedButton(
        child: Text(title),
        onPressed: () => showDrawer(
          barrier: true,
          context: context,
          alignment: alignment,
          barrierDismissible: true,
          builder: (_, __, close) => Container(
            width: 300,
            height: 200,
            child: Center(
              child: RaisedButton(
                onPressed: close,
                child: Text('close'),
              ),
            ),
            decoration: BoxDecoration(
              color: Colors.white,
              borderRadius: BorderRadius.all(Radius.circular(20)),
            ),
          ),
        ),
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.all(30),
      child: Center(
        child: Column(
          children: [
            Text(title),
            Row(mainAxisAlignment: MainAxisAlignment.center, children: [
              generateRaisedButton("topLeft", Alignment.topLeft, context),
              generateRaisedButton("topCenter", Alignment.topCenter, context),
              generateRaisedButton("topRight", Alignment.topRight, context),
            ]),
            Row(mainAxisAlignment: MainAxisAlignment.center, children: [
              generateRaisedButton("centerLeft", Alignment.centerLeft, context),
              generateRaisedButton("center", Alignment.center, context),
              generateRaisedButton(
                  "centerRight", Alignment.centerRight, context),
            ]),
            Row(mainAxisAlignment: MainAxisAlignment.center, children: [
              generateRaisedButton("bottomLeft", Alignment.bottomLeft, context),
              generateRaisedButton(
                  "bottomCenter", Alignment.bottomCenter, context),
              generateRaisedButton(
                  "bottomRight", Alignment.bottomRight, context),
            ])
          ],
        ),
      ),
    );
  }
}

class Body extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        children: [
          Expanded(
            child: Test(
              title: "Global",
            ),
          ),
          Expanded(
            child: OverlayBox(
              child: Test(
                title: "Local",
              ),
            ),
          ),
        ],
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  show_drawer: ^0.0.5

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

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

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [show_drawer] that is in a package requiring null.

Health suggestions

Format lib/show_drawer.dart.

Run flutter format to format lib/show_drawer.dart.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
show_overlay ^1.0.5 1.0.5
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test