dart-lang / dartdoc

API documentation tool for Dart.
https://pub.dev/packages/dartdoc
BSD 3-Clause "New" or "Revised" License
473 stars 119 forks source link

Inconsistent handling of deprecated parameters #2395

Open bwilkerson opened 4 years ago

bwilkerson commented 4 years ago

Parameters of constructors that have been marked with the deprecated annotation are displayed as such in the documentation for the class, but deprecated parameters of methods are not.

For an example, see https://api.flutter.dev/flutter/cupertino/CupertinoTextThemeData-class.html. The constructor is documented as

CupertinoTextThemeData({Color primaryColor: CupertinoColors.systemBlue, @Deprecated('This argument no longer does anything. You can remove it. ' 'This feature was deprecated after v1.10.14.') Brightness brightness, TextStyle textStyle, TextStyle actionTextStyle, TextStyle tabLabelTextStyle, TextStyle navTitleTextStyle, TextStyle navLargeTitleTextStyle, TextStyle navActionTextStyle, TextStyle pickerTextStyle, TextStyle dateTimePickerTextStyle})

But lower down on the same page is a method named copyWith that is documented as

copyWith({Color primaryColor, Brightness brightness, TextStyle textStyle, TextStyle actionTextStyle, TextStyle tabLabelTextStyle, TextStyle navTitleTextStyle, TextStyle navLargeTitleTextStyle, TextStyle navActionTextStyle, TextStyle pickerTextStyle, TextStyle dateTimePickerTextStyle}) → CupertinoTextThemeData

If you click through to the method's page (https://api.flutter.dev/flutter/cupertino/CupertinoTextThemeData/copyWith.html), you'll see that the brightness parameter is also deprecated:

CupertinoTextThemeData copyWith (
    {Color primaryColor,
    @Deprecated('This argument no longer does anything. You can remove it. ' 'This feature was deprecated after v1.10.14.') 
    Brightness brightness,
    TextStyle textStyle,
    TextStyle actionTextStyle,
    TextStyle tabLabelTextStyle,
    TextStyle navTitleTextStyle,
    TextStyle navLargeTitleTextStyle,
    TextStyle navActionTextStyle,
    TextStyle pickerTextStyle,
    TextStyle dateTimePickerTextStyle}
)
jcollins-g commented 4 years ago

Yes, this is not good, we should be able to indicate deprecation status in the class's view of copyWith.