Skip to content

Commit b7c9cd8

Browse files
szakariasDanTup
authored andcommitted
Fix doc references to Material and Cupertino in the widgets library and its tests (flutter#193334)
Adds `@docImport 'package:flutter/material.dart'` / `'package:flutter/cupertino.dart'` for doc references that currently resolve only through dartdoc's global lookup. This is an interim fix; these (and the existing) doc imports will need to change once the long-term solution in flutter#181288 is decided. Note: Widget tests are checked for Material and Cupertino imports (`dev/bots/check_tests_cross_imports.dart`), but the check does not cover doc imports. If you'd rather not doc import Material in widget tests, I can put the names in backticks instead. Towards flutter#192870 — enabling the `comment_references` lint.
1 parent 553d550 commit b7c9cd8

12 files changed

Lines changed: 34 additions & 0 deletions

‎packages/flutter/lib/src/widgets/_accessibility_evaluations.dart‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
/// @docImport 'package:flutter/material.dart';
6+
library;
7+
58
import 'dart:async';
69
import 'dart:ui' as ui;
710

‎packages/flutter/lib/src/widgets/binding.dart‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
/// @docImport 'dart:ui';
66
/// @docImport 'package:flutter/animation.dart';
7+
/// @docImport 'package:flutter/cupertino.dart';
78
/// @docImport 'package:flutter/material.dart';
89
/// @docImport 'package:flutter_test/flutter_test.dart';
910
///

‎packages/flutter/lib/src/widgets/date.dart‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
/// @docImport 'package:flutter/cupertino.dart';
6+
/// @docImport 'package:flutter/material.dart';
7+
library;
8+
59
/// Signature for predicating dates for enabled date selections.
610
///
711
/// See [showDatePicker] and [showCupertinoModalPopup],

‎packages/flutter/lib/src/widgets/dialog.dart‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
/// @docImport 'package:flutter/material.dart';
6+
library;
7+
58
import 'basic.dart';
69
import 'debug.dart';
710
import 'framework.dart';

‎packages/flutter/lib/src/widgets/orientation_builder.dart‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
/// @docImport 'package:flutter/material.dart';
6+
///
57
/// @docImport 'app.dart';
68
library;
79

‎packages/flutter/lib/src/widgets/radio_group.dart‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
/// @docImport 'package:flutter/cupertino.dart';
6+
/// @docImport 'package:flutter/material.dart';
7+
///
58
/// @docImport 'raw_radio.dart';
69
library;
710

‎packages/flutter/lib/src/widgets/raw_radio.dart‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
/// @docImport 'package:flutter/cupertino.dart';
6+
/// @docImport 'package:flutter/material.dart';
7+
library;
8+
59
import 'package:flutter/foundation.dart';
610

711
import 'basic.dart';

‎packages/flutter/lib/src/widgets/sliver_clip.dart‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
/// @docImport 'package:flutter/material.dart';
6+
///
57
/// @docImport 'scroll_view.dart';
68
library;
79

‎packages/flutter/test/widgets/autocomplete_test.dart‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
/// @docImport 'package:flutter/material.dart';
6+
library;
7+
58
import 'dart:async';
69

710
import 'package:flutter/foundation.dart';

‎packages/flutter/test/widgets/selectable_region_test.dart‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
/// @docImport 'package:flutter/material.dart';
6+
library;
7+
58
import 'dart:math' as math;
69

710
import 'package:flutter/foundation.dart';

0 commit comments

Comments
 (0)