kt_drawer_menu 0.0.6 kt_drawer_menu: ^0.0.6 copied to clipboard
KTDrawer is a library for flutter to create a beautiful drawer menu with with deep customization capabilities.
KTDrawerMenu #
KTDrawerMenu is a library for flutter to create a beautiful drawer menu with deep customization capabilities.
Installation #
Add
kt_drawer_menu: ^lastest_version
to your pubspec.yaml and run
flutter pub get
in your project's root directory.
Example #
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
brightness: Brightness.light,
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MainPage(),
);
}
}
class MainPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return KTDrawerMenu(
width: 360.0,
radius: 30.0,
scale: 0.6,
shadow: 20.0,
shadowColor: Colors.black12,
drawer: DrawerPage(),
content: HomePage(),
);
}
}
Available settings #
Controller #
This actions is only accessible by the children of KTDrawerMenu.
Get controller
KTDrawerMenu.of(context);
Open drawer
KTDrawerMenu.of(context).openDrawer();
Close drawer
KTDrawerMenu.of(context).closeDrawer();
Toggle drawer
KTDrawerMenu.of(context).toggle();
Drawer #
- Set edge drag width.
- Set width of the drawer widget that which can be displayed.
Content #
- Set scale of content widget when it is opened.
- Set radius of content widget when it is opened.
- Set color opacity above content widget when it is opened.
- Set opacity of color when it is opened.
- Set offset to determine the action auto open/close drawer when the tap is stopped.
Animation #
- Change duration for the open/close animation.
- Listen the animation progress updated when drawer is opening/closing.
- Listen drawer state.