Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

flutter encode

import 'dart:convert';
// Base64
// ======
String credentials = "username:password";
Codec<String, String> stringToBase64 = utf8.fuse(base64);
String encoded = stringToBase64.encode(credentials); // dXNlcm5hbWU6cGFzc3dvcmQ=
String decoded = stringToBase64.decode(encoded);  // username:password

// Note that this is equivalent to:
String encoded = base64.encode(utf8.encode(credentials)); // dXNlcm5hbWU6cGFzc3dvcmQ=
String decoded = utf8.decode(base64.decode(encoded));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #flutter #encode
ADD COMMENT
Topic
Name
7+6 =