i got problem when i dont know to make each buildrow go to each page?this is for buildDrawer can you help me with this?
builDrawer fuction this for profile screen.dart
_buildDrawer() {
return ClipPath(
clipper: OvalRightBorderClipper(),
child: Drawer(
Container(
height: 90,
alignment: Alignment.center,
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient:
LinearGradient(colors: [Colors.pink, Colors.red])),
child: CircleAvatar(
radius: 40,
backgroundImage: NetworkImage(profile),
),
),
SizedBox(height: 5.0),
Text(
"Mohd Amin bin Yaakob",
style: TextStyle(color: Colors.white, fontSize: 18.0),
),
Text(
"Pegawai",
style: TextStyle(color: active, fontSize: 16.0),
),
SizedBox(height: 30.0),
_buildRow(Icons.home, "Home"),
_buildDivider(),
_buildRow(Icons.person_pin, "Your profile"),
_buildDivider(),
_buildRow(Icons.settings, "Settings"),
_buildDivider(),
_buildRow(Icons.email, "Contact us"),
_buildDivider(),
_buildRow(Icons.info_outline, "Help"),
_buildDivider(),
],
),
),
),
),
),
);
}
How to make Functional Navigator each buildRow
2
Answers
You need to make rows with clickable widgets like listtile.
Try this inside your _buildRow()
You can remove the container as well and try contentPadding in ListTile
Its explained in the drawer documentation https://docs.flutter.dev/cookbook/design/drawer
You can require an
onTap
function in your_buildRow
method. Also wrap youContainer
inside anInkWell
widget and this function inonTap
property.Following is the revised code:
When calling the above function, provide the
onTap
callback like this: