NUIMiniProgramFile constructor
NUIMiniProgramFile({})
Implementation
NUIMiniProgramFile({required this.filename, String? bytesString, required this.extensions, Uint8List? bytes}){
assert(bytesString != null || bytes != null, "Either bytesString or bytes must be provided");
// If the bytes is provided, convert the bytes from [Uint8List] into base64 to before message transfer
if(bytes != null) {
try {
this.bytesString = base64.encode(bytes);
print("Set bytes for NUIMiniProgramFile");
} catch (e) {
print("[NUIMiniProgramMessage] Failed to base64 encode bytes to bytes string with error: $e");
}
}
else if(bytesString != null){
this.bytesString = bytesString;
}
}