我一直在尝试使用加密来加密字符串以将其发送到Web服务器,但我一直遇到错误。这是我的功能:
void encRypt(String da){
final key = "my32lengthsupersecretnooneknows1";
final encrypter = new Encrypter(new AES(key));
final encrypted = encrypter.encrypt(da);
print(encrypted);
}
Run Code Online (Sandbox Code Playgroud)
这就是我使用函数的方式:encRypt(chatBody.text); chatBody是一个TextEditingController
这是我的调试控制台:
Launching lib/main.dart on GT I9500 in debug mode...
Built build/app/outputs/apk/debug/app-debug.apk.
I/Timeline(19551): Timeline: Activity_idle id: android.os.BinderProxy@34db68a4 time:15254411
E/ (19551): [android_ws] Format: 5, Width: 1080, Height: 1920
E/ (19551): [android_ws] Format: 5, Width: 1080, Height: 1920
D/ViewRootImpl(19551): ViewPostImeInputStage ACTION_DOWN
D/ViewRootImpl(19551): ViewPostImeInputStage ACTION_DOWN
D/ViewRootImpl(19551): ViewPostImeInputStage ACTION_DOWN
E/flutter (19551): [ERROR:flutter/shell/common/shell.cc(181)] Dart Error: Unhandled exception:
E/flutter (19551): Invalid …Run Code Online (Sandbox Code Playgroud)