Encode and Decode Base64 in Dart

import 'dart:convert';

void main() {
  String credentials = "nilpointer:net";
  Codec stringToBase64 = utf8.fuse(base64);
  String encoded = stringToBase64.encode(credentials);
  print("encoded: ${encoded}");
  String decoded = stringToBase64.decode(encoded);
  print("decoded: ${decoded}");
}
encoded: bmlscG9pbnRlcjpuZXQ=
decoded: nilpointer:net