Flutter中的参数格式不正确



我正在使用Flutter SDK 1.2.0中的VS代码。在运行我的代码时,我收到一个错误,说参数格式不正确。

这就是错误:

Launching libmain.dart on Android SDK built for x86 in debug mode...
Parameter format not correct -
✓ Built buildappoutputsflutter-apkapp-debug.apk.
Installing buildappoutputsflutter-apkapp.apk...
D/EGL_emulation(11891): eglMakeCurrent: 0xe7c19420: ver 2 0 (tinfo 0xe7ca7180)

目前,它在执行过程中不会给我带来任何问题,但我看到过一些例子,这个错误可能会导致gradle失败和其他一些失败。所以我想现在就解决它,以免将来出现任何问题。

如果有人需要,这是我的代码。这只是一个基本的主页。

import 'package:flutter/material.dart';
main(List<String> args) {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text("OCR"),
),
body: Column(
children: [
Text('Question'),
RaisedButton(
child: Text('Option A'),
onPressed: () {},
),
RaisedButton(
child: Text('Option B'),
onPressed: () {},
),
RaisedButton(
child: Text('Option C'),
onPressed: () {},
),
],
),
));
}
}

删除main((函数中的List<String> args

最新更新