improving error handling
This commit is contained in:
@@ -15,7 +15,6 @@ class ScaffoldWithNavBar extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ScaffoldWithNavBarState extends State<ScaffoldWithNavBar> {
|
||||
bool _isLoggedIn = false;
|
||||
late String initials;
|
||||
|
||||
@override
|
||||
@@ -29,7 +28,6 @@ class _ScaffoldWithNavBarState extends State<ScaffoldWithNavBar> {
|
||||
|
||||
if (prefs.getString("token") != null) {
|
||||
setState(() {
|
||||
_isLoggedIn = true;
|
||||
initials = prefs.getString("initials")!;
|
||||
});
|
||||
}
|
||||
@@ -56,7 +54,7 @@ class _ScaffoldWithNavBarState extends State<ScaffoldWithNavBar> {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 12.0,
|
||||
horizontal: 8
|
||||
horizontal: 8,
|
||||
),
|
||||
child: Image(
|
||||
image: AssetImage('assets/velocity.png'),
|
||||
@@ -186,7 +184,10 @@ class _ScaffoldWithNavBarState extends State<ScaffoldWithNavBar> {
|
||||
final String location = GoRouterState.of(context).uri.path;
|
||||
if (location.startsWith('/groups')) return 1;
|
||||
if (location.startsWith('/history')) return 2;
|
||||
if (location.startsWith('/more') || location.startsWith('/users') || location.startsWith('/uptime')) return 3;
|
||||
if (location.startsWith('/more') ||
|
||||
location.startsWith('/users') ||
|
||||
location.startsWith('/uptime'))
|
||||
return 3;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user