String text = "base64encode.tech"; Codec<String, String> stringToBase64 = utf8.fuse(base64); String encoded = stringToBase64.encode(text); print('base64: $encoded');