Skip to content

Commit

Permalink
#356 implemented sidebar in home page
Browse files Browse the repository at this point in the history
  • Loading branch information
kardelenerdal committed Oct 30, 2023
1 parent 31e3753 commit e813280
Show file tree
Hide file tree
Showing 5 changed files with 410 additions and 323 deletions.
10 changes: 7 additions & 3 deletions ludos/mobile/lib/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import 'forgot_password.dart';
import 'main.dart';
import 'helper/colors.dart';
import 'helper/APIService.dart';
import 'package:provider/provider.dart';
import 'userProvider.dart';

class LoginPage extends StatelessWidget {
final TextEditingController emailController = TextEditingController();
Expand Down Expand Up @@ -76,10 +78,12 @@ class LoginPage extends StatelessWidget {
.login(emailController.text, passwordController.text);
print(token);
if (token == 200) {
// If logged-in successfully, go to the Home page
Provider.of<UserProvider>(context, listen: false)
.setLoggedIn(true, emailController.text);

Navigator.of(context).push(MaterialPageRoute(
builder: (context) => (Home()),
));
builder: (context) => Home(),
));
} else {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
Expand Down

0 comments on commit e813280

Please sign in to comment.