Skip to content

Linter tool support for embedded SDKs. #57367

Closed
@yyoon

Description

@yyoon

In our Flutter code, we use some classes / enums in dart:ui extended by sky_engine.
Linter seems to think these classes are undefined, which is not the case.

Steps to reproduce:

  • Create a new flutter project using flutter create
  • In the created lib/main.dart, Modify the text widget in the sample code to use FontWeight.bold style, which is defined in dart:ui.
child: new Text(
  'Button tapped $_counter time${ _counter == 1 ? '' : 's' }.',
  style: new TextStyle(fontWeight: FontWeight.bold),
),
  • This code runs fine and dartanalyzer doesn't show any errors, but running pub global linter . gives the following warning:
<omitted>/foo/lib/main.dart 33:46 [static warning] Undefined name 'FontWeight'
            style: new TextStyle(fontWeight: FontWeight.bold),
                                             ^^^^^^^^^^
<omitted>/foo/lib/main.dart 10:7 [lint] Document all public members
class FlutterDemo extends StatefulWidget {
      ^^^^^^^^^^^
<omitted>/foo/lib/main.dart 11:3 [lint] Document all public members
  FlutterDemo({Key key}) : super(key: key);
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2 files analyzed, 3 issues found, in 5220 ms.

The last two are valid lint issues, but the first one is false positive.

@dvdwasibi @sethladd

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions