feat: pantalla conectar proveedor accesible desde configuración
- Nueva ConectarProveedorPage: bienvenida con botón grande + formulario (URL, usuario, contraseña) que guarda en tabla configuracion - Settings → 'Cambiar proveedor de servicios' navega a esa pantalla - main.dart: flujo directo a LoginPage (sin splash router por ahora) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
c019dcb643
commit
49302dfd23
@@ -7,6 +7,7 @@ import '../theme.dart';
|
||||
import '../db/database_helper.dart';
|
||||
import '../services/sincronizador.dart';
|
||||
import '../services/demo_data_service.dart';
|
||||
import 'conectar_proveedor_page.dart';
|
||||
|
||||
class SettingsPage extends StatefulWidget {
|
||||
const SettingsPage({Key? key}) : super(key: key);
|
||||
@@ -99,6 +100,17 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
onTap: _cargarDemostracion,
|
||||
),
|
||||
|
||||
// ── Proveedor de servicios ────────────────────────────────────────
|
||||
_sectionHeader('PROVEEDOR DE SERVICIOS'),
|
||||
_accionItem(
|
||||
icon: Icons.cloud_outlined,
|
||||
iconColor: AppColors.primary,
|
||||
titulo: 'Cambiar proveedor de servicios',
|
||||
subtitulo: 'Modifica la URL y credenciales del servidor de monitoreo',
|
||||
cargando: false,
|
||||
onTap: _abrirConexionProveedor,
|
||||
),
|
||||
|
||||
const SizedBox(height: 32),
|
||||
],
|
||||
),
|
||||
@@ -293,6 +305,14 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
}
|
||||
}
|
||||
|
||||
// ── Conectar con proveedor ─────────────────────────────────────────────────
|
||||
void _abrirConexionProveedor() {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (_) => const ConectarProveedorPage()),
|
||||
);
|
||||
}
|
||||
|
||||
// ── Helpers de UI ──────────────────────────────────────────────────────────
|
||||
void _snack(String msg, {bool esError = true}) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||
|
||||
Reference in New Issue
Block a user