Home > Blockchain >  How to link to another methods in dart comments
How to link to another methods in dart comments

Time:03-14

I was documenting my code and I wanted to link another method in the same file

I want to refer to that method in a comment so anyone reading my comment can directly jump to that method where my comment refers

Method where I am documenting and I want to link to a method named toggleFavorite in the same file

// To avoid code duplication in [toggleFavorite] method
  void _toogleFav(newStatus) {
    isFavorite = newStatus;
    notifyListeners();
  }

This is what my toggleFavorite returns in case you need it

Future<void> toggleFavorite() async {

What I want

Exactly I want this word in my comment [toggleFavorite] to work as a link when I press this I get redirected to this method wherever it is created or used

CodePudding user response:

Use triple /// and [] around the method

  /// To avoid code duplication in [toggleFavorite] method
  void _toogleFav(newStatus) {
    isFavorite = newStatus;
    notifyListeners();
  }
  • Related