Omar Shamali

Decode URL/URI from string in Flutter Dart via extending String

Author: Omar Shamali
Last Modification:
Writing Date:

you can decode a url from string by using this method:

String str="";

Or better to have it like a method from String type class, you can place it in any file in the project:

extension StringExtensions on String {
  String decode() {
    return  Uri.decodeFull(this);

then the usage will be for decoding as follows:

String str="";

result of decoded string (originally encoded URI as string):