flutter_hidden_drawer 0.1.6
flutter_hidden_drawer: ^0.1.6 copied to clipboard

Beautiful custom hidden drawer. Please press star in my repo if you like it. Thank you.

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(
          create: (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"),
      ),
    );
  }
}
9
likes
100
pub points
49%
popularity

Beautiful custom hidden drawer. Please press star in my repo if you like it. Thank you.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

robbyrahmana79@gmail.com

License

MIT (LICENSE)

Dependencies

flutter, provider

More

Packages that depend on flutter_hidden_drawer