Fix formatting
This commit is contained in:
parent
4018983b51
commit
c1fa40e492
@ -4,7 +4,6 @@ import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'variables.dart';
|
||||
|
||||
|
||||
class SideMenu extends StatefulWidget {
|
||||
final Widget body;
|
||||
final int selectedIndex;
|
||||
@ -29,17 +28,15 @@ class _SideMenuState extends State<SideMenu> {
|
||||
|
||||
prefs.remove('token');
|
||||
prefs.remove('id');
|
||||
|
||||
setState(() {
|
||||
loggedIn = false;
|
||||
user = null;
|
||||
});
|
||||
|
||||
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Successfully logged out')));
|
||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('Successfully logged out')));
|
||||
Navigator.pushReplacementNamed(context, '/login');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,13 +44,11 @@ class _SideMenuState extends State<SideMenu> {
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
|
||||
api
|
||||
.isLoggedIn(context).then((value) {
|
||||
api.isLoggedIn(context).then((value) {
|
||||
setState(() {
|
||||
loggedIn = value; // Update the second variable here
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
@ -80,19 +75,16 @@ Widget build(BuildContext context) {
|
||||
DrawerHeader(
|
||||
child: Column(
|
||||
children: [
|
||||
const Image(
|
||||
image: AssetImage('assets/logo.png'),
|
||||
height: 100,
|
||||
),
|
||||
const Image(image: AssetImage('assets/logo.png'), height: 100),
|
||||
Text(
|
||||
'SkanTravels',
|
||||
style: GoogleFonts.jacquesFrancois(
|
||||
fontSize: 20,
|
||||
color: Color(0xFF1862E7),
|
||||
color: const Color(0xFF1862E7),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: const Text('Home'),
|
||||
@ -130,7 +122,7 @@ Widget build(BuildContext context) {
|
||||
leading: const Icon(Icons.logout),
|
||||
selected: false,
|
||||
onTap: _logout,
|
||||
)
|
||||
),
|
||||
]
|
||||
: [
|
||||
ListTile(
|
||||
@ -148,8 +140,9 @@ Widget build(BuildContext context) {
|
||||
onTap: () {
|
||||
Navigator.pushReplacementNamed(context, '/login');
|
||||
},
|
||||
)
|
||||
])
|
||||
),
|
||||
]
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -34,9 +34,9 @@ class _LoginPageState extends State<LoginPage> {
|
||||
prefs.setString('token', jsonUser.token);
|
||||
prefs.setString('id', jsonUser.id);
|
||||
|
||||
setState(()
|
||||
{loggedIn == true;});
|
||||
|
||||
setState(() {
|
||||
loggedIn == true;
|
||||
});
|
||||
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('Successfully logged in')));
|
||||
@ -54,10 +54,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
child: Container(
|
||||
constraints: const BoxConstraints(minWidth: 100, maxWidth: 400),
|
||||
child: Column(children: [
|
||||
const Image(
|
||||
image: AssetImage('assets/logo.png'),
|
||||
height: 200,
|
||||
),
|
||||
const Image(image: AssetImage('assets/logo.png'), height: 200),
|
||||
Text(
|
||||
'SkanTravels',
|
||||
style: GoogleFonts.jacquesFrancois(
|
||||
|
Loading…
Reference in New Issue
Block a user