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/models/category.dart';
|
||||
import 'package:notas/theme/app_colors.dart';
|
||||
import 'package:notas/widgets/category_style.dart';
|
||||
|
||||
class MenuDrawer extends StatelessWidget {
|
||||
@@ -22,10 +23,8 @@ class MenuDrawer extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: const BoxDecoration(
|
||||
color: Color.fromARGB(255, 30, 31, 35),
|
||||
border: Border(
|
||||
right: BorderSide(color: Colors.white12, width: 0.5),
|
||||
),
|
||||
color: AppColors.drawerBackground,
|
||||
border: Border(right: BorderSide(color: AppColors.border, width: 0.5)),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -50,7 +49,7 @@ class MenuDrawer extends StatelessWidget {
|
||||
CategoryStyle.iconForCodePoint(
|
||||
category.iconCodePoint,
|
||||
);
|
||||
|
||||
|
||||
return _MenuItemTile(
|
||||
icon: categoryIcon,
|
||||
label: category.name,
|
||||
@@ -59,8 +58,14 @@ class MenuDrawer extends StatelessWidget {
|
||||
onLongPress: onEditCategory == null
|
||||
? null
|
||||
: () => onEditCategory?.call(category),
|
||||
iconColor: Color(category.colorValue ?? 0xFFFFC107),
|
||||
textColor: Color(category.colorValue ?? 0xFFFFC107),
|
||||
iconColor: Color(
|
||||
category.colorValue ??
|
||||
AppColors.categoryFallback.value,
|
||||
),
|
||||
textColor: Color(
|
||||
category.colorValue ??
|
||||
AppColors.categoryFallback.value,
|
||||
),
|
||||
trailing: IconButton(
|
||||
padding: const EdgeInsets.all(8),
|
||||
constraints: const BoxConstraints(
|
||||
@@ -69,7 +74,7 @@ class MenuDrawer extends StatelessWidget {
|
||||
),
|
||||
icon: const Icon(
|
||||
Icons.more_vert,
|
||||
color: Colors.white70,
|
||||
color: AppColors.textSecondary,
|
||||
size: 20,
|
||||
),
|
||||
onPressed: () => onEditCategory?.call(category),
|
||||
@@ -92,10 +97,10 @@ class MenuDrawer extends StatelessWidget {
|
||||
label: 'Mis notas borradas',
|
||||
selected: selectedItem == 'deleted_notes',
|
||||
onTap: () => onMenuItemTapped?.call('deleted_notes'),
|
||||
iconColor: Colors.redAccent,
|
||||
textColor: Colors.redAccent,
|
||||
iconColor: AppColors.destructiveAccent,
|
||||
textColor: AppColors.destructiveAccent,
|
||||
),
|
||||
const Divider(color: Colors.white12, height: 16),
|
||||
const Divider(color: AppColors.border, height: 16),
|
||||
_MenuItemTile(
|
||||
icon: Icons.settings,
|
||||
label: 'Configuración',
|
||||
@@ -140,9 +145,11 @@ class _MenuItemTileState extends State<_MenuItemTile> {
|
||||
Widget build(BuildContext context) {
|
||||
final bool active = widget.selected || _hovering;
|
||||
final Color backgroundColor = active
|
||||
? Colors.white.withValues(alpha: 0.10)
|
||||
: Colors.transparent;
|
||||
final Color foregroundColor = active ? Colors.white : Colors.white70;
|
||||
? AppColors.hover
|
||||
: AppColors.transparent;
|
||||
final Color foregroundColor = active
|
||||
? AppColors.textPrimary
|
||||
: AppColors.textSecondary;
|
||||
final Widget? trailing = _hovering ? widget.trailing : null;
|
||||
|
||||
return MouseRegion(
|
||||
@@ -155,11 +162,7 @@ class _MenuItemTileState extends State<_MenuItemTile> {
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 180),
|
||||
curve: Curves.easeOutCubic,
|
||||
margin: const EdgeInsets.only(
|
||||
right: 8,
|
||||
top: 2,
|
||||
bottom: 2,
|
||||
),
|
||||
margin: const EdgeInsets.only(right: 8, top: 2, bottom: 2),
|
||||
child: Material(
|
||||
color: backgroundColor,
|
||||
borderRadius: const BorderRadius.only(
|
||||
@@ -169,11 +172,17 @@ class _MenuItemTileState extends State<_MenuItemTile> {
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: ListTile(
|
||||
contentPadding: const EdgeInsets.only(left: 16, right: 8),
|
||||
leading: Icon(widget.icon, color: widget.iconColor ?? foregroundColor),
|
||||
leading: Icon(
|
||||
widget.icon,
|
||||
color: widget.iconColor ?? foregroundColor,
|
||||
),
|
||||
trailing: trailing,
|
||||
title: Text(
|
||||
widget.label,
|
||||
style: TextStyle(color: widget.textColor ?? foregroundColor, fontSize: 14),
|
||||
style: TextStyle(
|
||||
color: widget.textColor ?? foregroundColor,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
onTap: widget.onTap,
|
||||
onLongPress: widget.onLongPress,
|
||||
|
||||
Reference in New Issue
Block a user