Analyzer not working in VS Code? Or is it?


Do I need to do something to get the analyzer to work in Visual Studio Code when an @required parameter is omitted from a Dart function?


import 'package:meta/meta.dart';

void sayHello({@required String to, bool inEnglish}){

  if(inEnglish == null || inEnglish){
    print("Hello, $to");
  } else {
    print("Bonjour, $to");

 sayHello(inEnglish: true); // output: Hello, null, no complaints about **to** missing


Yes, you need to install the Dart SDK and the Dart Code extension in Visual Studio Code to get the analyzer to work. The analyzer will then give you a warning that the to parameter is missing when you call the sayHello function without providing a value for to.