feat(frontend): simulate authenticated user sessions
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import "package:flutter/material.dart";
|
||||
import "package:google_fonts/google_fonts.dart";
|
||||
import "../demo_identity.dart";
|
||||
import "../services/auth_service.dart";
|
||||
import "../theme/ensup_colors.dart";
|
||||
import "../widgets/ensup_top_bar.dart";
|
||||
import "../widgets/identification_option.dart";
|
||||
@@ -13,6 +14,7 @@ class LoginScreen extends StatelessWidget {
|
||||
const LoginScreen({super.key});
|
||||
|
||||
void _identifier(BuildContext context) {
|
||||
AuthService.selectDemoStudent();
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => const HomeScreen(),
|
||||
@@ -21,6 +23,16 @@ class LoginScreen extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
void _identifierResponsable(BuildContext context) {
|
||||
AuthService.selectDemoResponsable();
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => const ResponsableScreen(),
|
||||
settings: const RouteSettings(name: "responsable"),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@@ -162,15 +174,7 @@ class LoginScreen extends StatelessWidget {
|
||||
width: double.infinity,
|
||||
child: OutlinedButton.icon(
|
||||
onPressed: () =>
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (_) =>
|
||||
const ResponsableScreen(),
|
||||
settings: const RouteSettings(
|
||||
name: "responsable",
|
||||
),
|
||||
),
|
||||
),
|
||||
_identifierResponsable(context),
|
||||
icon: const Icon(
|
||||
Icons.person_outline,
|
||||
size: 16,
|
||||
|
||||
Reference in New Issue
Block a user