Skip to content

Edoardo Vignati

– Always looking for something awesome –

Menu
  • About me
  • Studies
  • Publications
  • Skills
  • Portfolio
  • Projects
  • Career
  • Blog
  • Travels  
Menu

Custom icon in flutter_background_service package

Posted on 06/07/202206/07/2022 by Edoardo

The flutter_background_service package is used to spawn services. These services stay in background doing stuff and they can also communicate with the Flutter app in foreground.

In this post you will not find a guide throughout the usage of this package. Here you can find some notes about how to create the custom icon of the Android status bar.

We assume that the package is already present in the pubspec.yaml file and the example app is working.

First of all you need to create a folder that will contain the icon:

my_flutter_project/android/app/src/main/res/drawable-anydpi-v24/

Second step: create the icon. The icon should be an SVG, so you can use Inkscape to create your vectored and colored icon. Then you have to translate the icon to an XML drawable format. Online you can find many services like this one: https://svg2vector.com/

Once downloaded the XML rename it to ic_bg_service_small.xml and place it into the folder previously created.

You should now be able to build the Flutter app and you will find in the status bar the new icon.

Cheers


Buy Me A Coffee


This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  1. Edoardo on [SOLVED] XMLHttpRequest error in Flutter web is a CORS error06/01/2023
  2. Fabi on [SOLVED] XMLHttpRequest error in Flutter web is a CORS error20/12/2022
  3. Edoardo on How to install hplip on Ubuntu28/11/2022
  4. Alex K on How to install hplip on Ubuntu28/11/2022

© 2023 Edoardo Vignati | Powered by Minimalist Blog WordPress Theme