8000 Modify API to more closely mirror Flutter's Icon/IconData classes · Issue #3 · i-Naji/emojis · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Modify API to more closely mirror Flutter's Icon/IconData classes #3

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 8000 service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
craiglabenz opened this issue Sep 6, 2020 · 7 comments
Open

Comments

@craiglabenz
Copy link
craiglabenz commented Sep 6, 2020

I want to suggest that some of the core classes in this library be slightly restructured to more closely mimic Flutter's Icon and IconData classes.

For example, the current API looks like this:

Emoji womanBlond = Emoji.byChar(Emojis.womanBlondHair);
print(womanBlond)
// 👧

The proposed API would look like:

Emoji womanBlond = Emoji(Emojis.womanBlondHair);

This library would then have 3 core classes:

/// Houses majority of the API that developers touch. All of your existing methods would stay here
/// plus new ones like `emojize` and `demojize`.
class Emoji {}

/// Empty class but for its many constants representing all of the emojis. This would be most similar
/// to your existing `_emojis` list.
class Emojis {
  ...
  static const womanBlondHair = EmojiData('\u{1F471}\u{200D}\u{2640}\u{FE0F}', shortName: 'blond-haired_woman', emojiGroup: EmojiGroup.peopleBody, emojiSubGroup: EmojiSubGroup.person, keywords: [...])
  ...
}

/// Class to hold instance data for a specific emoji. Thousands of these would exist to populate
/// the `Emojis` container class.
class EmojiData {
  final String code;
  final String shortName;
  final EmojiGroup emojiGroup;
  final EmojiSubGroup emojiSubGroup;
  final List<String> keywords;
}

If this seems reasonable, I would be happy to put together a PR. I have lots of emoji functionality I would love to contribute to your library, but wanted to float my ideas for a refactor before diving right in and making changes.

Thanks again for creating emojis -- you have a lot of very cool functionality here!

@i-Naji
Copy link
Owner
i-Naji commented Sep 7, 2020

Awesome, please open a PR

@craiglabenz
Copy link
Author

Sounds good!

Another question -- where did you source your list of keywords for each emoji? You have a lot of keywords.

@i-Naji
Copy link
Owner
i-Naji commented Sep 9, 2020

emojipedia, emojicodes, uemoji, onemoji ... every where ;)

@craiglabenz
Copy link
Author

I've been working on a source generator and just noticed that you seem to have one gitignored. Are you possibly able to share that logic?

@i-Naji
Copy link
Owner
i-Naji commented Sep 9, 2020

yes, I can share it with you after my voyage which will end in 4, 5 days.

i-Naji added a commit that referenced this issue Sep 15, 2020
@krjw-eyev
Copy link

Is this still worked on?

@i-Naji
Copy link
Owner
i-Naji commented Nov 19, 2021

Is this still worked on?

2022 🦾, Emoji v14 maybe 🤷‍♂️

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

No branches or pull requests

3 participants
0