嘿,我在返回MaterialApp()时遇到了2个[not_required_arguments]问题1,而在Scaffold(

时间:2019-01-18 06:52:36

标签: visual-studio dart flutter

我在Visual Studio Code上有2个[not_required_arguments],在return MaterialApp(上有Flutter问题1,在Scaffold(上有另一个问题。任何人都可以帮忙吗?

我已经尝试过搜索,但是没有找到真正有助于解决问题的东西。

import 'package:flutter/material.dart';

    void main() => runApp(MyApp(

    ));

    class MyApp extends StatefulWidget {

      @override
      State<StatefulWidget> createState() => MyAppState();
    }

    class MyAppState extends State<MyApp> {

      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          theme: ThemeData(
            // Define the default Brightness and Colors
            brightness: Brightness.dark,
            primaryColor: Colors.lightBlue[800],
            accentColor: Colors.cyan[600],
          )
        , home: SafeArea(
             child: Scaffold(
               drawer: new Drawer(
                 child: new ListView(

                 ) ,
               ),
                body: new Center(
                  child: new Column(
                    children: <Widget>[],
              ))),
            )
        );
      }
    }

这是两个问题的完整消息:

{
  "resource": "/Users/camillebasbous/first_app/lib/main.dart",
  "owner": "dart",
  "code": "not_enough_required_arguments",
  "severity": 8,
  "message": "1 required argument(s) expected, but 0 found.",
  "source": "dart",
  "startLineNumber": 19,
  "startColumn": 23,
  "endLineNumber": 19,
  "endColumn": 508,
  "tags": []
}

0 个答案:

没有答案