getDynamicNavbarItems method
Implementation
@protected
List<Widget> getDynamicNavbarItems(BuildContext context) {
// Based on Login Staus
if (HTTPClient.isAuthenticated())
{
return [
ListTile(
leading: const Icon(Icons.logout),
title: const Text('Logout'),
onTap: () {
HTTPClient('/authenticate').logout(
(response) {
Navigator.pushNamed(
context,
'/',
arguments: {"_animation": FadeToBlackTransition.transitionsBuilder, "_animation_duration": 800}
);
},
(response) {
Navigator.pushNamed(
context,
'/',
arguments: {"_animation": FadeToBlackTransition.transitionsBuilder, "_animation_duration": 800}
);
},
);
},
),
];
} else {
return [];
}
}