String text = "base64encode.tech";
Codec<String, String> stringToBase64 = utf8.fuse(base64);
String encoded = stringToBase64.encode(text);
print('base64: $encoded');
import 'dart:io' as Io;
final bytes = await Io.File(image).readAsBytes();
// or
final bytes = Io.File(image).readAsBytesSync();
String base64Encode(List<int> bytes) => base64.encode(bytes);