-
-
Notifications
You must be signed in to change notification settings - Fork 877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[auth] Add Support for Custom Icons #4395
Conversation
auth/lib/ui/utils/icon_utils.dart
Outdated
enum IconType { simpleIcon, customIcon } | ||
|
||
class AllIconData { | ||
final String title; | ||
final IconType type; | ||
final String? color; | ||
final String? slug; | ||
|
||
AllIconData({ | ||
required this.title, | ||
required this.type, | ||
required this.color, | ||
this.slug, | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's define these types under models?
auth/lib/models/code_display.dart
Outdated
@@ -12,6 +13,9 @@ class CodeDisplay { | |||
String note; | |||
final List<String> tags; | |||
int position; | |||
String customIconData; | |||
bool isCustomIcon; | |||
IconType iconType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of defining type, let's just use src
String iconSrc;
String iconID;
isCustomIcon can just be a getter => iconSrc != '' && iconID |=''l
auth/lib/models/code_display.dart
Outdated
@@ -21,8 +23,12 @@ class CodeDisplay { | |||
this.tags = const [], | |||
this.note = '', | |||
this.position = 0, | |||
this.iconSrc = 'ente', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the default value can be empty? Any reason to prefer 'ente' over empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
This PR introduces a new feature allowing users to select and assign custom icons to their codes.