Refactor theme colors and styles across the application
- Introduced AppColors class to centralize color definitions for better maintainability and consistency. - Updated various screens (Settings, Vault Access, Note Card, etc.) to use AppColors for styling instead of hardcoded colors. - Enhanced UI elements with improved color contrast and accessibility. - Replaced gradient backgrounds with defined color schemes for a cohesive look. - Refactored button styles and text colors to align with the new theme structure.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:notas/data/api_client.dart';
|
||||
import 'package:notas/theme/app_colors.dart';
|
||||
|
||||
class VaultAccessScreen extends StatefulWidget {
|
||||
const VaultAccessScreen({
|
||||
@@ -11,7 +12,8 @@ class VaultAccessScreen extends StatefulWidget {
|
||||
});
|
||||
|
||||
final bool isBusy;
|
||||
final Future<void> Function(String email, String password) onCreateAccountPressed;
|
||||
final Future<void> Function(String email, String password)
|
||||
onCreateAccountPressed;
|
||||
final Future<void> Function(String email, String password) onSignInPressed;
|
||||
final Future<void> Function() onContinueWithoutAccount;
|
||||
|
||||
@@ -75,17 +77,7 @@ class _VaultAccessScreenState extends State<VaultAccessScreen> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF191A1D),
|
||||
Color(0xFF222326),
|
||||
Color(0xFF101114),
|
||||
],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
),
|
||||
decoration: const BoxDecoration(gradient: AppColors.backdropGradient),
|
||||
child: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -98,12 +90,12 @@ class _VaultAccessScreenState extends State<VaultAccessScreen> {
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(24),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF1D1E20),
|
||||
color: AppColors.surface,
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
border: Border.all(color: Colors.white.withValues(alpha: 0.08)),
|
||||
border: Border.all(color: AppColors.borderMuted),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withValues(alpha: 0.35),
|
||||
color: AppColors.shadow,
|
||||
blurRadius: 30,
|
||||
offset: const Offset(0, 18),
|
||||
),
|
||||
@@ -115,7 +107,7 @@ class _VaultAccessScreenState extends State<VaultAccessScreen> {
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.lock_outline,
|
||||
color: Colors.amber,
|
||||
color: AppColors.accent,
|
||||
size: 44,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
@@ -123,7 +115,7 @@ class _VaultAccessScreenState extends State<VaultAccessScreen> {
|
||||
'Mis Notas',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
color: AppColors.textPrimary,
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
@@ -133,7 +125,7 @@ class _VaultAccessScreenState extends State<VaultAccessScreen> {
|
||||
'Tus notas se guardan cifradas en este dispositivo. La cuenta y la sincronización vendrán después.',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white.withValues(alpha: 0.72),
|
||||
color: AppColors.textSecondary,
|
||||
height: 1.4,
|
||||
),
|
||||
),
|
||||
@@ -141,29 +133,42 @@ class _VaultAccessScreenState extends State<VaultAccessScreen> {
|
||||
_endpointLoading
|
||||
? const SizedBox(
|
||||
height: 48,
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
)
|
||||
: TextField(
|
||||
controller: _endpointController,
|
||||
enabled: !widget.isBusy,
|
||||
keyboardType: TextInputType.url,
|
||||
style: const TextStyle(color: Colors.white),
|
||||
style: const TextStyle(
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
labelText: 'API endpoint',
|
||||
labelStyle: TextStyle(color: Colors.white.withValues(alpha: 0.7)),
|
||||
labelStyle: const TextStyle(
|
||||
color: AppColors.textSecondary,
|
||||
),
|
||||
filled: true,
|
||||
fillColor: Colors.white.withValues(alpha: 0.05),
|
||||
fillColor: AppColors.fill,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
borderSide: BorderSide(color: Colors.white.withValues(alpha: 0.12)),
|
||||
borderSide: const BorderSide(
|
||||
color: AppColors.border,
|
||||
),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
borderSide: BorderSide(color: Colors.white.withValues(alpha: 0.12)),
|
||||
borderSide: const BorderSide(
|
||||
color: AppColors.border,
|
||||
),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
borderSide: const BorderSide(color: Colors.amber, width: 1.2),
|
||||
borderSide: const BorderSide(
|
||||
color: AppColors.accent,
|
||||
width: 1.2,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -172,23 +177,34 @@ class _VaultAccessScreenState extends State<VaultAccessScreen> {
|
||||
controller: _emailController,
|
||||
enabled: !widget.isBusy,
|
||||
keyboardType: TextInputType.text,
|
||||
style: const TextStyle(color: Colors.white),
|
||||
style: const TextStyle(
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Usuario',
|
||||
labelStyle: TextStyle(color: Colors.white.withValues(alpha: 0.7)),
|
||||
labelStyle: const TextStyle(
|
||||
color: AppColors.textSecondary,
|
||||
),
|
||||
filled: true,
|
||||
fillColor: Colors.white.withValues(alpha: 0.05),
|
||||
fillColor: AppColors.fill,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
borderSide: BorderSide(color: Colors.white.withValues(alpha: 0.12)),
|
||||
borderSide: const BorderSide(
|
||||
color: AppColors.border,
|
||||
),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
borderSide: BorderSide(color: Colors.white.withValues(alpha: 0.12)),
|
||||
borderSide: const BorderSide(
|
||||
color: AppColors.border,
|
||||
),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
borderSide: const BorderSide(color: Colors.amber, width: 1.2),
|
||||
borderSide: const BorderSide(
|
||||
color: AppColors.accent,
|
||||
width: 1.2,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -197,37 +213,54 @@ class _VaultAccessScreenState extends State<VaultAccessScreen> {
|
||||
controller: _passwordController,
|
||||
enabled: !widget.isBusy,
|
||||
obscureText: true,
|
||||
style: const TextStyle(color: Colors.white),
|
||||
style: const TextStyle(
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Contraseña',
|
||||
labelStyle: TextStyle(color: Colors.white.withValues(alpha: 0.7)),
|
||||
labelStyle: const TextStyle(
|
||||
color: AppColors.textSecondary,
|
||||
),
|
||||
filled: true,
|
||||
fillColor: Colors.white.withValues(alpha: 0.05),
|
||||
fillColor: AppColors.fill,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
borderSide: BorderSide(color: Colors.white.withValues(alpha: 0.12)),
|
||||
borderSide: const BorderSide(
|
||||
color: AppColors.border,
|
||||
),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
borderSide: BorderSide(color: Colors.white.withValues(alpha: 0.12)),
|
||||
borderSide: const BorderSide(
|
||||
color: AppColors.border,
|
||||
),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
borderSide: const BorderSide(color: Colors.amber, width: 1.2),
|
||||
borderSide: const BorderSide(
|
||||
color: AppColors.accent,
|
||||
width: 1.2,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 22),
|
||||
FilledButton(
|
||||
onPressed: widget.isBusy ? null : _handleCreateAccount,
|
||||
onPressed: widget.isBusy
|
||||
? null
|
||||
: _handleCreateAccount,
|
||||
style: FilledButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(vertical: 14),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 14,
|
||||
),
|
||||
),
|
||||
child: widget.isBusy
|
||||
? const SizedBox(
|
||||
width: 18,
|
||||
height: 18,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
),
|
||||
)
|
||||
: const Text('Crear cuenta'),
|
||||
),
|
||||
@@ -235,15 +268,21 @@ class _VaultAccessScreenState extends State<VaultAccessScreen> {
|
||||
OutlinedButton(
|
||||
onPressed: widget.isBusy ? null : _handleSignIn,
|
||||
style: OutlinedButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(vertical: 14),
|
||||
side: const BorderSide(color: Colors.white24),
|
||||
foregroundColor: Colors.white,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 14,
|
||||
),
|
||||
side: const BorderSide(
|
||||
color: AppColors.textDisabled,
|
||||
),
|
||||
foregroundColor: AppColors.textPrimary,
|
||||
),
|
||||
child: const Text('Iniciar sesión'),
|
||||
),
|
||||
const SizedBox(height: 18),
|
||||
TextButton(
|
||||
onPressed: widget.isBusy ? null : widget.onContinueWithoutAccount,
|
||||
onPressed: widget.isBusy
|
||||
? null
|
||||
: widget.onContinueWithoutAccount,
|
||||
child: const Text('Entrar sin cuenta'),
|
||||
),
|
||||
],
|
||||
@@ -259,4 +298,4 @@ class _VaultAccessScreenState extends State<VaultAccessScreen> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user