riverpod icon indicating copy to clipboard operation
riverpod copied to clipboard

Warn if ref.watch is used in a showDialog/showModal without a Consumer

Open rrousselGit opened this issue 1 year ago • 2 comments

Bad:

Button(
  onPressed: () {
    showDialog(builder: (_) => ref.watch(...),
  },
)

Good:

Button(
  onPressed: () {
    showDialog(builder: (_) =>Consumer(builder: (_, ref, __) => ref.watch(...) ),
  },
)

rrousselGit avatar Mar 17 '23 13:03 rrousselGit