mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2026-03-24 04:46:56 +00:00
[PR #3145] [MERGED] [chore] svg improvements #5598
Labels
No labels
2024
2025
2026
acct mgmt
AI
automation
bug
calendar
ci
CJK
cloud
code-block
collaboration
copy-paste
database
data migration
data sync
deploy
desktop
develop
develop
documentation
duplicate
editor
editor-plugin
emoji
export
files
flutter-only
follow-up
formula
good first issue for devs
good first issue for experienced devs
grid
hacktoberfest
HACKTOBERFEST-ACCEPTED
help wanted
i18n
icons
images
importer
improvements
infra
install
integrations
IR
kanban board
login
look and joy
mentorship
mobile
mobile
needs design
new feature
new feature
non-coding
notes
notifications
onboarding
organization
P0+
permission
platform-linux
platform-mac
platform-windows
plugins
program
pull-request
Q1 25
Q1 26
Q2 24
Q2 25
Q3 24
Q3 25
Q4 24
Q4 25
react
regression
rust
rust
Rust-only
Rust-only
Rust-starter
Rust-starter
self-hosted
shortcuts
side panel
slash-menu
sync v2
table
tablet
task
tauri
templates
tests
themes
translation
v0.5.6
v0.5.8
v0.5.9
v0.6.0
v0.6.1
v0.6.4
v0.6.7
v0.6.8
v0.7.1
v0.7.4
v0.7.4
v0.7.5
v0.7.6
v0.7.7
v0.7.8
v0.8.0
v0.8.4
v0.8.5
v0.8.9
web
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AppFlowy-IO/AppFlowy#5598
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/3145
Author: @a-wallen
Created: 8/8/2023
Status: ✅ Merged
Merged: 8/14/2023
Merged by: @a-wallen
Base:
main← Head:svg_improvements📝 Commits (10+)
c26e9fdchore: remove use of svgWidget()28e6aaarefactor: redundant code in svg1674735feat: add generator to generate flowy_svgs.g.dart979026achore: reference new package in pubspec9886eaechore: remove svg widget from flowy_infra8feb601refactor: update usage in flowy_infra_ui921b3c9refactor: usage in appflowy_flutterf348b2dfix: error with script not runningf9c51d5fix: error with script not running52be2e1fix: use unix style file path📊 Changes
334 files changed (+1627 additions, -768 deletions)
View changed files
📝
frontend/.vscode/tasks.json(+35 -18)📝
frontend/appflowy_flutter/.gitignore(+1 -0)➖
frontend/appflowy_flutter/assets/images/common/archive.svg(+0 -10)➖
frontend/appflowy_flutter/assets/images/common/information.svg(+0 -5)➖
frontend/appflowy_flutter/assets/images/common/open_folder.svg(+0 -3)➖
frontend/appflowy_flutter/assets/images/common/recover.svg(+0 -4)➖
frontend/appflowy_flutter/assets/images/common/settings.svg(+0 -4)➖
frontend/appflowy_flutter/assets/images/editor/Favorite/active.svg(+0 -3)➖
frontend/appflowy_flutter/assets/images/editor/calendar.svg(+0 -7)➖
frontend/appflowy_flutter/assets/images/editor/delete.svg(+0 -6)➖
frontend/appflowy_flutter/assets/images/editor/duplicate.svg(+0 -4)➖
frontend/appflowy_flutter/assets/images/editor/editor_check.svg(+0 -4)➖
frontend/appflowy_flutter/assets/images/editor/insert_emoticon.svg(+0 -6)➖
frontend/appflowy_flutter/assets/images/editor/insert_emoticon_2.svg(+0 -6)➖
frontend/appflowy_flutter/assets/images/editor/link.svg(+0 -4)➖
frontend/appflowy_flutter/assets/images/editor/math.svg(+0 -1)➖
frontend/appflowy_flutter/assets/images/editor/option.svg(+0 -8)➖
frontend/appflowy_flutter/assets/images/file_icon.jpg(+0 -0)➖
frontend/appflowy_flutter/assets/images/file_icon.svg(+0 -4)➖
frontend/appflowy_flutter/assets/images/folder.svg(+0 -5)...and 80 more files
📄 Description
Feature Preview
This is modeled based on Flutter's
Iconwidget andIconData.I don't particularly appreciate having to check the assets folder to figure out the path for an SVG before I use it with the SVG widget. This PR introduces a new package called
flowy_svgthat crawlsassets/imagesfor the SVGs and generates a file calledflowy_svgs.g.dart. It looks something like this:When a contributor wants to use an SVG widget they can find what's available using

FlowySvgs.(the dot will use intellisense to show all available SVGs)We can still use a string for the asset path like so:

I grabbed some code from
easy_localizations, a package we already use. The generated file will be output tolib/generated.I'll create and register a script with all the other generation tasks like
Generate FreezedandGenerate Languagefiles.To do
dart:uiflowy_svg(similar toGenerate Freezed) and register it in tasks.json.PR Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.