Dùng callback redirect để kiểm tra state auth trước khi build route.
Ví dụ: nếu user chưa đăng nhập và cố truy cập route được bảo vệ, redirect về /login. Kết hợp với Riverpod để redirect tự động phản ứng khi auth state thay đổi. Cách này xử lý tất cả route tập trung, không cần kiểm tra auth trong từng widget.
Use the redirect callback to check auth state before building routes.
- If the user isn't logged in and tries to access a protected route, redirect them to the login screen.
- This approach handles all routes centrally without auth checks scattered across widgets.