Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dart - Mark as Deprecated Documentation

I changed something in my implementations and I want to mark some classes deprecated, so that they will use the new implementations instead.

How can I mark a class as deprecated in dart? For now I only document it as deprecated without actually marking the class or crossing it out.

/// Throws a BadRequestException - 400
class BadRequestException implements Exception {}
/// Throws a NotFoundException - 404
class NotFoundException implements Exception {}
/// Throws a ConflictException - 409
class ConflictException implements Exception {}
/// [DEPRECATED]
/// Don't use this anymore, this is deprecated.
class AlreadyExistsException implements Exception {}
like image 457
Zolicious Avatar asked Nov 19 '25 19:11

Zolicious


1 Answers

Found it. Deprecated Classes

@Deprecated('Use [ConflictException]')
class AlreadyExistsException implements Exception {}
like image 178
Zolicious Avatar answered Nov 21 '25 08:11

Zolicious



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!