Skip to content
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

Merged
merged 13 commits into from
Dec 17, 2024
Merged

[auth] Add Support for Custom Icons #4395

merged 13 commits into from
Dec 17, 2024

Conversation

AmanRajSinghMourya
Copy link
Contributor

Description

This PR introduces a new feature allowing users to select and assign custom icons to their codes.

Comment on lines 219 to 233
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,
});
}
Copy link
Member

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?

@@ -12,6 +13,9 @@ class CodeDisplay {
String note;
final List<String> tags;
int position;
String customIconData;
bool isCustomIcon;
IconType iconType;
Copy link
Member

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

@@ -21,8 +23,12 @@ class CodeDisplay {
this.tags = const [],
this.note = '',
this.position = 0,
this.iconSrc = 'ente',
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes so when add a new code and then go to edit it, there we show 2 icons

  1. ente icon
  2. icon based on issuer name
    so when there is new code added we need to show some icon for 1. so put ente icon as default, took reference from 2FAS
    image

@ua741 ua741 merged commit 9491310 into main Dec 17, 2024
2 checks passed
@ua741 ua741 deleted the custom_icons branch December 17, 2024 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants