你好,我是 Flutter 新手,我已经使用 android studio 4.2.1 设置了 flutter,一切都很好。当我尝试运行它时;它显示以下错误,我看到太多问题,但这对我没有帮助 flutter doctor run 没有发现问题 她是医生结果
这是我的环境变量
任何人都可以指导我如何运行扑动。我正在用铬合金吃午餐
线程“main”中的异常 java.util.zip.ZipException:在 java.base/java.util 的 java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1567) 处找不到 zip END 标头.zip.ZipFile$Source.findEND(ZipFile.java:1462) 位于 java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1469) 位于 java.base/java.util.zip.ZipFile $Source.(ZipFile.java:1274) 在 java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1237) 在 java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile .java:727) 在 java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:844) 在 java.base/java.util.zip.ZipFile.(ZipFile.java:247) 在 java .base/java.util.zip.ZipFile.(ZipFile.java:177) 在 java.base/java.util.zip.ZipFile.(ZipFile.java:191) 在 org.gradle.wrapper.Install.unzip(安装.java:214) 在 org.gradle.wrapper.Install.access$600(Install.java:27) 在 org.gradle.wrapper.Install$1.call(Install.java:74) 在 org.gradle.wrapper.Install$1 .call(Install.java:48) 在 org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65) 在 org.gradle.wrapper.Install.createDist(Install.java:48) 在 org.gradle.wrapper。 WrapperExecutor.execute(WrapperExecutor.java:128) 在 org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) 异常:Gradle 任务 assembleDebug 失败,退出代码 1
当我在我的手机号码错误时单击“登录”按钮时,然后打开一个错误对话框,然后当我在对话框上单击“确定”时,我收到此错误。
我收到这条消息
该小部件已被卸载,因此状态不再具有上下文(并且应被视为已失效)
考虑在“dispose”期间取消任何活动的工作,或使用“mounted” getter 来确定状态是否仍处于活动状态。
class _LoginPageState extends State<LoginPage> {
final GlobalKey<FormState> _formKey = GlobalKey();
TextEditingController _mobileController = new TextEditingController();
// TextEditingController _nameController = new TextEditingController();
// TextEditingController _emailController = new TextEditingController();
TextEditingController _passwordController = new TextEditingController();
Map<String, String> _authData = {
'user_name': '',
'user_email': '',
'username': '',
'password': ''
};
Future _submit() async {
print('aa' + _authData['username']);
if (!_formKey.currentState.validate()) {
return;
}
_formKey.currentState.save();
try {
await Provider.of<Auth>(context, listen: false).login(
_authData['user_name'],
_authData['user_email'],
_authData['username'],
_authData['password']);
print('authData_username' + _authData['username']);
print('authData_password' + …Run Code Online (Sandbox Code Playgroud) dart flutter flutter-test flutter-dependencies flutter-layout
我正在使用 permanentFooterButtons,我想删除它的顶部边框。有人知道怎么做吗?
我的代码:
persistentFooterButtons: [
Center(
child: TextButton(
style: ButtonStyle(
),
onPressed: () {
print("press the filter btn");
},
child: Text("Filter")),
)
],
Run Code Online (Sandbox Code Playgroud)
我正在webview 中使用 WebRTC 开发颤振应用程序。在 android 上,它按预期工作,但在 iOS 构建上遇到问题。我已阅读线程Apple Support和SO Thread。
两个线程都声明,在 iOS webview 中不允许使用 WebRTC。我在模拟器/真实设备中测试了我的代码,但没有成功。
所以,我的问题是有人知道如何在 iOS webview 中运行 WebRTC?
这就是我显示 webview 的方式
InAppWebView(
initialUrl: widget.callType == AppConstant.INCOMING ? incomingUrl : outGoingUrl,
initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(
mediaPlaybackRequiresUserGesture: false,
debuggingEnabled: true,
clearCache: true,
javaScriptEnabled: true,
preferredContentMode: UserPreferredContentMode.MOBILE
),
),
onWebViewCreated: (InAppWebViewController controller) {
//web view created
},
androidOnPermissionRequest: (InAppWebViewController controller, String origin, List<String> resources) async {
print('resource list : ${resources.toString()}');
return PermissionRequestResponse(resources: resources, action: PermissionRequestResponseAction.GRANT); …Run Code Online (Sandbox Code Playgroud) 我正在尝试定义一个extension函数GetInterfaceas
extension FindOrPut on GetInterface {
S findOrPut<S>(S dependency,{String? tag}){
if(GetInstance().isRegistered<S>(tag: tag)){
return GetInstance().find<S>(tag: tag);
}
return GetInstance().put<S>(dependency,tag: tag);
}
}
Run Code Online (Sandbox Code Playgroud)
与GETxextension Inst on GetInterface团队开发的相同。但我的代码没有按预期工作。
注意:如果我将扩展功能代码放在将要使用它的同一个文件中;效果很好。但如果我把上面的代码放在单独的文件函数中,在 Get 上找不到。