flutter_hidden_drawer 0.1.4

flutter_hidden_drawer #

Tooltip function built in for flutter. Please press star in my repo if you like it. Thank you.

Screenshots #

example

Usage #

  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider(
          builder: (context) => DrawerMenuState(),
        ),
      ],
      child: HiddenDrawer(
        child: <Your child, can change with the scaffold>,
        drawer: <Drawer child, consider user HiddenDrawerMenu>,
      ),
    );
  }

Example #

Please find example in here: Example

0.1.4 - 25/10/2019 #

  • Handle drawer open for popState
  • Add custom configuration for HiddenDrawerIcon

0.1.3 - 22/09/2019 #

  • Add custom configuration for HiddenDrawer({drawerWidth, drawerHeaderHeight, drawerBlurRadius})

0.1.2 - 21/09/2019 #

  • Change to global provider

0.1.1 - 21/09/2019 #

  • Change required parameter from HiddenDrawerMenu to Widget
  • Add menuColor, menuActiveColor and drawerDecoration to HiddenDrawerMenu

0.1.0 - 20/09/2019 #

  • Add HiddenDrawerMenu for the drawer that accept list of DrawerMenu
  • Add provider to listen the drawer menu state
  • Update environtment version to >=2.3.0 <3.0.0

0.0.1 - 19/09/2019 #

  • Initial release hidden drawer

example/lib/main.dart

import 'package:example/second_screen.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hidden_drawer/flutter_hidden_drawer.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider(
          builder: (context) => DrawerMenuState(),
        ),
      ],
      child: MaterialApp(
        title: 'Flutter Hidden Drawer',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: MyHomePage(title: 'Flutter Hidden Drawer'),
      ),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return HiddenDrawer(
      drawerWidth: MediaQuery.of(context).size.width * .4,
      child: Scaffold(
        appBar: AppBar(
          leading: HiddenDrawerIcon(
            mainIcon: Icon(Icons.art_track),
          ),
          title: Text(widget.title),
        ),
        body: Center(
          child: Column(
            children: <Widget>[
              Text(
                'First Screen',
              ),
              RaisedButton(
                child: Text("Go to next screen"),
                onPressed: () {
                  Navigator.of(context)
                      .push(MaterialPageRoute(builder: (_) => SecondScreen()));
                },
              )
            ],
          ),
        ),
      ),
      drawer: HiddenDrawerMenu(
        menu: <DrawerMenu>[
          DrawerMenu(
              child: Padding(
                padding: const EdgeInsets.all(16.0),
                child: Text("Menu 1"),
              ),
              onPressed: () {
                print("Menu 1");
              }),
          DrawerMenu(
              child: Padding(
                padding: const EdgeInsets.all(16.0),
                child: Text("Menu 2"),
              ),
              onPressed: () {
                print("Menu 2");
              }),
        ],
        header: Text("Header"),
        footer: Text("Footer"),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_hidden_drawer: ^0.1.4

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

We analyzed this package on Feb 13, 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

Health suggestions

Fix lib/src/widgets/hidden_drawer.dart. (-1 points)

Analysis of lib/src/widgets/hidden_drawer.dart reported 2 hints:

line 34 col 17: 'ancestorStateOfType' is deprecated and shouldn't be used. Use findAncestorStateOfType instead. This feature was deprecated after v1.12.1..

line 34 col 43: 'TypeMatcher' is deprecated and shouldn't be used. TypeMatcher has been deprecated because it is no longer used in framework(only in deprecated methods). This feature was deprecated after v1.12.1..

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (provider).

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
flutter 0.0.0
provider ^3.1.0 3.2.0 4.0.4
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
flutter_test