Created
January 18, 2020 14:00
-
-
Save joramkimata/6f810d3fb5786831b141cfb3ca29eb7d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:hidden_drawer_menu/hidden_drawer/hidden_drawer_menu.dart'; | |
import 'package:hidden_drawer_menu/hidden_drawer/screen_hidden_drawer.dart'; | |
import 'package:hidden_drawer_menu/menu/item_hidden_menu.dart'; | |
import 'package:hiddenmenuapp/FirstSreen.dart'; | |
import 'package:hiddenmenuapp/SecondSreen.dart'; | |
main() => runApp(MyApp()); | |
class MyApp extends StatefulWidget { | |
@override | |
State<StatefulWidget> createState() { | |
return _MyApp(); | |
} | |
} | |
class _MyApp extends State<MyApp> { | |
// 1 Step: Add list of ScreenHiddenDrawer | |
List<ScreenHiddenDrawer> itens = List(); | |
// 2 Step: Add items on init() method | |
@override | |
void initState() { | |
itens.add(new ScreenHiddenDrawer( | |
new ItemHiddenMenu( | |
name: "Screen 1", | |
baseStyle: | |
TextStyle(color: Colors.white.withOpacity(0.8), fontSize: 28.0), | |
colorLineSelected: Colors.teal, | |
), | |
FirstScreen())); | |
itens.add(new ScreenHiddenDrawer( | |
new ItemHiddenMenu( | |
name: "Screen 2", | |
baseStyle: | |
TextStyle(color: Colors.white.withOpacity(0.8), fontSize: 28.0), | |
colorLineSelected: Colors.orange, | |
), | |
SecondScreen())); | |
super.initState(); | |
} | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: HiddenDrawerMenu( | |
initPositionSelected: 0, | |
screens: itens, | |
backgroundColorMenu: Colors.cyan, | |
// typeOpen: TypeOpen.FROM_RIGHT, | |
// enableScaleAnimin: true, | |
// enableCornerAnimin: true, | |
// slidePercent: 80.0, | |
// verticalScalePercent: 80.0, | |
// contentCornerRadius: 10.0, | |
// iconMenuAppBar: Icon(Icons.menu), | |
// backgroundContent: DecorationImage((image: ExactAssetImage('assets/bg_news.jpg'),fit: BoxFit.cover), | |
// whithAutoTittleName: true, | |
// styleAutoTittleName: TextStyle(color: Colors.red), | |
// actionsAppBar: <Widget>[], | |
// backgroundColorContent: Colors.blue, | |
// backgroundColorAppBar: Colors.blue, | |
// elevationAppBar: 4.0, | |
// tittleAppBar: Center(child: Icon(Icons.ac_unit),), | |
// enableShadowItensMenu: true, | |
backgroundMenu: DecorationImage(image: ExactAssetImage('assets/bg.jpg'),fit: BoxFit.cover), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment