duplicate_shown_name
Duplicate shown name.
Description
#The analyzer produces this diagnostic when a name occurs multiple times in
a show
clause. Repeating the name is unnecessary.
Example
#The following code produces this diagnostic because the name min
is shown
more than once:
dart
import 'dart:math' show min, min;
var x = min(2, min(0, 1));
Common fixes
#If the name was mistyped in one or more places, then correct the mistyped names:
dart
import 'dart:math' show max, min;
var x = max(2, min(0, 1));
If the name wasn't mistyped, then remove the unnecessary name from the list:
dart
import 'dart:math' show min;
var x = min(2, min(0, 1));
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。