16 lines
478 B
Dart
16 lines
478 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:quiz_app/app/routes/app_pages.dart';
|
|
import 'package:quiz_app/data/services/user_storage_service.dart';
|
|
|
|
class AuthMiddleware extends GetMiddleware {
|
|
@override
|
|
RouteSettings? redirect(String? route) {
|
|
final UserStorageService _storageService = Get.find();
|
|
if (!_storageService.isLogged) {
|
|
return const RouteSettings(name: AppRoutes.loginPage);
|
|
}
|
|
return null;
|
|
}
|
|
}
|