Flutter Drawer Tile
Piece of content for all items in a navigation drawer
Used for creating every route link in the Drawer.
Example:
DrawerTile(
icon: Icons.home,
onTap: () {
if (currentPage != "Home")
Navigator.pushReplacementNamed(context, '/home');
},
iconColor: MaterialColors.primary,
title: "Home",
isSelected: currentPage == "Home" ? true : false
)
Parameters
You can always hover with your mouse on any object and see its types and parameters.
| Parameter | Type | Default | Description |
|---|---|---|---|
| title | String | Title of the tile. | |
| icon | IconData | Icon used on the left side of the title. | |
| onTap | Function | onTap function which is called when the user taps the tile. | |
| isSelected | bool | false | This helps by showing an active color for the main route. |
| iconColor | Color | MaterialColors.text | Colors for the icon. |