1dede9eb78
- Removed AppColors class and migrated all references to AppPalette. - Updated VaultAccessScreen, MenuDrawer, NoteCard, SearchAppBar, and other widgets to use AppPalette for color management. - Introduced AppPalette to handle light and dark themes with appropriate color schemes. - Adjusted theme application in AppTheme to utilize AppPalette extensions. - Updated tests to reflect changes in theme structure and color references.
43 lines
950 B
Dart
43 lines
950 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:notas/theme/app_palette.dart';
|
|
|
|
class CategoryStyle {
|
|
CategoryStyle._();
|
|
|
|
static const List<Color> colors = AppPalette.defaultCategoryColors;
|
|
|
|
static List<Color> colorsOf(BuildContext context) {
|
|
final AppPalette? palette = Theme.of(context).extension<AppPalette>();
|
|
if (palette != null) {
|
|
return palette.categoryColors;
|
|
}
|
|
|
|
return AppPalette.defaultCategoryColors;
|
|
}
|
|
|
|
static const List<IconData> icons = <IconData>[
|
|
Icons.label_outline_rounded,
|
|
Icons.work,
|
|
Icons.star,
|
|
Icons.home,
|
|
Icons.school,
|
|
Icons.book,
|
|
Icons.music_note,
|
|
Icons.lightbulb,
|
|
];
|
|
|
|
static IconData iconForCodePoint(int? codePoint) {
|
|
if (codePoint == null) {
|
|
return Icons.folder_outlined;
|
|
}
|
|
|
|
for (final IconData icon in icons) {
|
|
if (icon.codePoint == codePoint) {
|
|
return icon;
|
|
}
|
|
}
|
|
|
|
return Icons.folder_outlined;
|
|
}
|
|
}
|