Skip to content

refactor(deps): remove unnecessary Iconsax and http, use Material Ico…#239

Merged
payam-zahedi merged 4 commits into
payam-zahedi:mainfrom
MostafaSensei106:refactor/cleanup-toastification
Apr 19, 2026
Merged

refactor(deps): remove unnecessary Iconsax and http, use Material Ico…#239
payam-zahedi merged 4 commits into
payam-zahedi:mainfrom
MostafaSensei106:refactor/cleanup-toastification

Conversation

@MostafaSensei106

Copy link
Copy Markdown

refactor(deps): remove unused Iconsax and http, use Material Icons

This PR removes unnecessary dependencies and improves the overall efficiency and maintainability of the package by relying on Flutter's built-in resources.

Closes #229


Changes

  • Removed unused Iconsax dependency
  • Removed unused http dependency
  • Replaced Iconsax icons with Flutter Material Icons for built-in toast types
  • Updated default icons for:
    • info
    • success
    • warning
    • error
image
  • Updated tests to reflect the new icon set

  • Reduce application bundle size (APK/AAB)

  • Eliminate unnecessary dependencies

  • Improve build performance and dependency management

  • Ensure consistency by using Flutter's built-in Material Icons

  • Simplify long-term maintenance


Breaking Changes

No breaking changes intended.
The update only affects default icons (UI detail) and does not modify the public API.


Testing

  • Updated existing tests to match new icon values
  • All tests pass successfully

Impact

  • Smaller package size
  • Cleaner dependency tree
  • More maintainable and predictable behavior

Notes

Using built-in Material Icons avoids adding external packages for minimal usage, making the library lighter and more efficient for consumers.

@payam-zahedi

Copy link
Copy Markdown
Owner

@MostafaSensei106

I think a better approach would be to keep the app’s visual appearance unchanged while removing the dependency on the Iconsax package.

To do that, I gathered only the icons we actually use and added them as a .ttf file directly in the assets. This way, we maintain the same design while reducing the overall package size.

I updated this PR so you can review it and let me know what do you think?

@codecov

codecov Bot commented Apr 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 74.43%. Comparing base (f439581) to head (8faf7a9).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
lib/src/built_in/theme/toastification_icons.dart 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #239      +/-   ##
==========================================
- Coverage   74.51%   74.43%   -0.09%     
==========================================
  Files          31       32       +1     
  Lines         926      927       +1     
==========================================
  Hits          690      690              
- Misses        236      237       +1     
Flag Coverage Δ
flutter 74.43% <0.00%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MostafaSensei106

Copy link
Copy Markdown
Author

@payam-zahedi
I checked the new file size and it's only 2.77 KB, which is very small and totally acceptable.

Even in most cases, i think developers tend to use different icon packs or replace the default icons anyway, so this approach won’t negatively impact them. On the contrary, it’s a great optimization and won’t noticeably increase the app size.

Embedding only the required icons as a .ttf asset is efficient and keeps the package lightweight while maintaining the same UI consistency.

I’ve reviewed the updated PR, and the direction looks solid to me 👍

@MostafaSensei106

MostafaSensei106 commented Apr 18, 2026

Copy link
Copy Markdown
Author

@payam-zahedi
But I have a concern regarding licensing. Since these icons originate from the Iconsax package, bundling them as a .ttf inside the project could be considered redistribution.

Do we know if the Iconsax license explicitly allows this kind of usage (modification and redistribution)? Just want to make sure we're on the safe side, especially if this package is intended to be public.

If the licensing terms are unclear, it might be safer to consider an open-source icon set instead.

Overall, great approach just worth double-checking the legal side before merging ...

I double-checked the licensing, and since Iconsax is released under the BSD 3-Clause License, this approach is actually valid.

Bundling required icons as a .ttf and redistributing them is allowed, as long as we comply with the license terms (retaining the copyright notice and including the license in the project).

@payam-zahedi

Copy link
Copy Markdown
Owner

@MostafaSensei106

That actually is a really valid point. Thanks for checking the license. I'll double-check it as well and come back to you.

@payam-zahedi
payam-zahedi merged commit 670035c into payam-zahedi:main Apr 19, 2026
2 checks passed
@payam-zahedi

Copy link
Copy Markdown
Owner

Thanks again, @MostafaSensei106 for your contribution.
Nice work, and I'm looking forward to your future contributions.

I added a section in the README.md file for iconsax icons

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.

Unnecessary iconsax_flutter dependency is increasing app size

2 participants