feat(frontend): simulate authenticated user sessions
This commit is contained in:
@@ -2,6 +2,7 @@ import "package:flutter/material.dart";
|
||||
import "package:google_fonts/google_fonts.dart";
|
||||
|
||||
import "../demo_identity.dart";
|
||||
import "../services/auth_service.dart";
|
||||
import "../services/responsable_service.dart";
|
||||
import "../theme/ensup_colors.dart";
|
||||
import "../utils/file_download.dart";
|
||||
@@ -44,6 +45,11 @@ class _ResponsableScreenState extends State<ResponsableScreen> {
|
||||
setState(() => _future = _charger());
|
||||
}
|
||||
|
||||
void _quitter() {
|
||||
AuthService.clearSession();
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
|
||||
Future<void> _changerStatut(Map<String, dynamic> anomalie) async {
|
||||
final prochain = _prochainStatut(anomalie["statut"] as String?);
|
||||
if (prochain == null || _transitionEnCours) {
|
||||
@@ -124,10 +130,7 @@ class _ResponsableScreenState extends State<ResponsableScreen> {
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
_ResponsableTopBar(
|
||||
onExit: () => Navigator.of(context).pop(),
|
||||
onRefresh: _rafraichir,
|
||||
),
|
||||
_ResponsableTopBar(onExit: _quitter, onRefresh: _rafraichir),
|
||||
Expanded(
|
||||
child: FutureBuilder<_ResponsableData>(
|
||||
future: _future,
|
||||
@@ -249,7 +252,7 @@ class _ResponsableScreenState extends State<ResponsableScreen> {
|
||||
anomaliesActives: anomaliesActives,
|
||||
notificationsNonLues: notificationsNonLues,
|
||||
onChanged: (index) => setState(() => _onglet = index),
|
||||
onExit: () => Navigator.of(context).pop(),
|
||||
onExit: _quitter,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
|
||||
Reference in New Issue
Block a user