【发布时间】:2021-08-19 18:25:54
【问题描述】:
我怎样才能使我自己的颤振小部件/颤振类被弃用(这样当我或其他人将该类用作小部件时,会有一个弃用的注释)?
这是我当前的代码:https://gist.github.com/janhecker/538a8f0610a29e6be6c7fbce1f525d39
【问题讨论】:
标签: flutter widget deprecated
我怎样才能使我自己的颤振小部件/颤振类被弃用(这样当我或其他人将该类用作小部件时,会有一个弃用的注释)?
这是我当前的代码:https://gist.github.com/janhecker/538a8f0610a29e6be6c7fbce1f525d39
【问题讨论】:
标签: flutter widget deprecated
只需将其添加到您的小部件顶部:
@Deprecated('Use this other widget instead')
class MyWidget extends StatelessWidget { ... }
【讨论】: