feat: Introduce category selection functionality in NoteEditorScreen and related components
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CategoryStyle {
|
||||
CategoryStyle._();
|
||||
|
||||
static const List<Color> colors = <Color>[
|
||||
Colors.amber,
|
||||
Colors.blue,
|
||||
Colors.green,
|
||||
Colors.purple,
|
||||
Colors.red,
|
||||
Colors.teal,
|
||||
Colors.orange,
|
||||
Colors.grey,
|
||||
];
|
||||
|
||||
static const List<IconData> icons = <IconData>[
|
||||
Icons.folder,
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user