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

Allow to use a font asset on Android #519

Merged
merged 4 commits into from
Aug 14, 2024
Merged

Allow to use a font asset on Android #519

merged 4 commits into from
Aug 14, 2024

Conversation

Abestanis
Copy link
Contributor

@Abestanis Abestanis commented Jul 17, 2024

This adds an optional parameter fontAsset to the showToast method that allows to apply a custom font from the Flutter app assets folder to the text of the toast on Android below API level 30 (Android R) where we have access to the TextView. Credit for the change goes to @nt4f04uNd. We have been using a fork with these changes for the past year.

Usage example:

Fluttertoast.showToast(
  msg: msg,
  fontAsset: 'assets/path/to/some-font.ttf',
);
Normal toast Toast with comic sans font
Fluttertoast.showToast(msg: msg); Fluttertoast.showToast(msg: msg, fontAsset: 'assets/fonts/comic-sans-ms.ttf');
Toast with system font Toast with comic sans font

@ponnamkarthik ponnamkarthik merged commit 7aeb9df into ponnamkarthik:master Aug 14, 2024
@Abestanis
Copy link
Contributor Author

Thanks for the merge and fast release! ❤️

@Abestanis Abestanis deleted the feature/font_flutter_asset branch August 17, 2024 21:17
@nt4f04uNd
Copy link
Contributor

Thanks for the merge and fast release! ❤️

Incredible, congrats! 🎉

I will be honest, I was surprised with this contribution, because I completely forgot I even did this fork.

Thank you for moving this patch to the package itself. These types of last miles are one of my favorite types of contributions I imagine trying to do at some point myself, but rarely have enough will power.

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.

3 participants