flutter_hidden_drawer 0.1.2 copy "flutter_hidden_drawer: ^0.1.2" to clipboard
flutter_hidden_drawer: ^0.1.2 copied to clipboard

outdated

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

example/lib/main.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 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> {
  int _counter = 0;
  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider(
          builder: (context) => DrawerMenuState(),
        ),
      ],
      child: HiddenDrawer(
        child: Scaffold(
          appBar: AppBar(
            leading: HiddenDrawerIcon(),
            title: Text(widget.title),
          ),
          body: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                Text(
                  'You have pushed the button this many times:',
                ),
                Text(
                  '$_counter',
                  style: Theme.of(context).textTheme.display1,
                ),
              ],
            ),
          ),
          floatingActionButton: FloatingActionButton(
            onPressed: _incrementCounter,
            tooltip: 'Increment',
            child: Icon(Icons.add),
          ),
        ),
        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"),
        ),
      ),
    );
  }
}
10
likes
0
pub points
67%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, provider

More

Packages that depend on flutter_hidden_drawer