getDynamicNavbarItems method

  1. @protected
List<Widget> getDynamicNavbarItems(
  1. BuildContext context
)

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 [];
  }
}