-
Notifications
You must be signed in to change notification settings - Fork 102
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
feat(project): setting project icon #328
base: main
Are you sure you want to change the base?
Conversation
What I did was to store the String rawData of the svg format file in hive. I am not sure if it is stored correctly. I saw that what is stored in the project is ProjectRef, not FlutterProject. |
And I don't know if @aguilaair has designed a figma drawing, so I didn't pay attention to the UI design of the change icon. |
This is great!! I'll review ASAP |
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.
I'd really like for the project icon to be a property in the pubspec of the project instead of contained in sidekick. I think it would be a cleaner way of approaching this. What do you think?
For this idea, the first thing that comes to my mind is to add an attribute called project-icon in pubspec, but I don't know whether this attribute is only for sidekick. In addition, it is also worth discussing what format of icons to store in pubspec, whether it is a network image, svg raw data, or other formats. If the official flutter also has this plan, I think it is feasible. If not, I think we should also implement this function from sidekick. |
If you're worried about svg being too big in hive, consider limiting the size, or try optimizing svg tags that won't work with flutter rendering |
I'm not worried about the size of the SVG but I like the idea that the icon is automatically detected on any sidekick install. We don't even need our own property and we can take advantage of another very popular package's property in the yaml: https://pub.dev/packages/flutter_launcher_icons we can just look for |
This operation looks very good, but it is worth considering that not every flutter project uses this package. What should we do if the project does not use this package? Also, after a quick look at this package, I think it needs to use As I understand it, the function of this package is that I can use an icon in my Flutter project to automatically generate icons required by other platforms, rather than providing accessible properties for third parties to use. |
I think the main problem with this solution is that there is no definite property that allows us to get the location of this icon. Not all Flutter projects will use this package, and the default pubspec will not provide this property. |
Maybe we can try this first to see if it works. |
Yes, this is not a default property, and we are indeed misusing it because it is not designed to be interacted by other entities. However, if we have permission to see the project we can access the image. We can always have our own property that is used before that: # Check this first
sidekick:
banner: some/image/path.png
icon: some/image/path.png
# Use this as a fallback
flutter_icons:
image_path: some/image/path.png |
Have you tested whether it works? I still think that adding an attribute for sidekick in the project's pubspec is putting the cart before the horse. When a project that doesn't use sidekick appears, that attribute is redundant. We can't unify this attribute like Flutter does. |
That's like saying that the |
before:
after:
links:
#298
#187