fix: wrap auth views in AuthLayout and remove duplicate logo from PhoneLoginView
- admin_handlers: wrap PhoneLoginView, LoginView, RegisterView in AuthLayout so the gradient split panel / header renders correctly - phone_login_view: remove standalone logo block (AuthLayout provides it) and remove unused phone_form_provider import Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
bf3c380e8e
commit
1ae5b72ed7
@@ -1,4 +1,5 @@
|
|||||||
import 'package:prosapp_web_app/providers/auth_provider.dart';
|
import 'package:prosapp_web_app/providers/auth_provider.dart';
|
||||||
|
import 'package:prosapp_web_app/ui/layouts/auth/auth_layout.dart';
|
||||||
import 'package:prosapp_web_app/ui/views/dashboard_view.dart';
|
import 'package:prosapp_web_app/ui/views/dashboard_view.dart';
|
||||||
import 'package:prosapp_web_app/ui/views/login_view.dart';
|
import 'package:prosapp_web_app/ui/views/login_view.dart';
|
||||||
import 'package:prosapp_web_app/ui/views/phone_login_view.dart';
|
import 'package:prosapp_web_app/ui/views/phone_login_view.dart';
|
||||||
@@ -9,9 +10,8 @@ import 'package:provider/provider.dart';
|
|||||||
class AdminHandlers {
|
class AdminHandlers {
|
||||||
static Handler phone = Handler(handlerFunc: (context, params) {
|
static Handler phone = Handler(handlerFunc: (context, params) {
|
||||||
final authProvider = Provider.of<AuthProvider>(context!);
|
final authProvider = Provider.of<AuthProvider>(context!);
|
||||||
|
|
||||||
if (authProvider.authStatus == AuthStatus.notAuthenticated) {
|
if (authProvider.authStatus == AuthStatus.notAuthenticated) {
|
||||||
return const PhoneLoginView();
|
return const AuthLayout(child: PhoneLoginView());
|
||||||
} else {
|
} else {
|
||||||
return const DashboardView();
|
return const DashboardView();
|
||||||
}
|
}
|
||||||
@@ -19,9 +19,8 @@ class AdminHandlers {
|
|||||||
|
|
||||||
static Handler login = Handler(handlerFunc: (context, params) {
|
static Handler login = Handler(handlerFunc: (context, params) {
|
||||||
final authProvider = Provider.of<AuthProvider>(context!);
|
final authProvider = Provider.of<AuthProvider>(context!);
|
||||||
|
|
||||||
if (authProvider.authStatus == AuthStatus.notAuthenticated) {
|
if (authProvider.authStatus == AuthStatus.notAuthenticated) {
|
||||||
return const LoginView();
|
return const AuthLayout(child: LoginView());
|
||||||
} else {
|
} else {
|
||||||
return const DashboardView();
|
return const DashboardView();
|
||||||
}
|
}
|
||||||
@@ -29,9 +28,8 @@ class AdminHandlers {
|
|||||||
|
|
||||||
static Handler register = Handler(handlerFunc: (context, params) {
|
static Handler register = Handler(handlerFunc: (context, params) {
|
||||||
final authProvider = Provider.of<AuthProvider>(context!);
|
final authProvider = Provider.of<AuthProvider>(context!);
|
||||||
|
|
||||||
if (authProvider.authStatus == AuthStatus.notAuthenticated) {
|
if (authProvider.authStatus == AuthStatus.notAuthenticated) {
|
||||||
return const RegisterView();
|
return const AuthLayout(child: RegisterView());
|
||||||
} else {
|
} else {
|
||||||
return const DashboardView();
|
return const DashboardView();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:prosapp_web_app/providers/auth_provider.dart';
|
import 'package:prosapp_web_app/providers/auth_provider.dart';
|
||||||
import 'package:prosapp_web_app/providers/phone_form_provider.dart';
|
|
||||||
import 'package:prosapp_web_app/router/router.dart';
|
import 'package:prosapp_web_app/router/router.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
@@ -87,21 +86,6 @@ class _PhoneLoginViewState extends State<PhoneLoginView> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
// Logo
|
|
||||||
Image.asset('assets/images/logo_prosapp.png',
|
|
||||||
width: 160,
|
|
||||||
errorBuilder: (_, __, ___) => const Text(
|
|
||||||
'ProsApp',
|
|
||||||
style: TextStyle(fontSize: 32, fontWeight: FontWeight.bold, color: Color(0xFF42A4EF)),
|
|
||||||
)),
|
|
||||||
const SizedBox(height: 8),
|
|
||||||
const Text(
|
|
||||||
'Conecta con los mejores profesionales',
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(color: Colors.grey, fontSize: 13),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 40),
|
|
||||||
|
|
||||||
if (!_codeSent) _buildPhoneForm() else _buildOtpForm(),
|
if (!_codeSent) _buildPhoneForm() else _buildOtpForm(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user