'Flutter url_launcher ignores number sign(#) when call

I'm using url_launcher in my app. When I dial numbers that includes a number sign like "*123#" it ignores the number sign and dial just *123



Solution 1:[1]

You should use Uri.encodeComponent to encode # too

onPressed: () {
        String no = Uri.encodeComponent('*123#');
        launch('tel:$no');
      },

Solution 2:[2]

You must use Uri.encodeComponent to encode # your string

onPressed: () {
        String mycode = Uri.encodeComponent('*#06#');
        launch('tel:$mycode');
      },

Because special characters need to be encoded to be able to use by your device

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Muhtar
Solution 2 Mike