Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Commit bf95e79

Browse files
authored
add dafrt code blocks (#2521)
1 parent 40b06ed commit bf95e79

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/src/rules/use_build_context_synchronously.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@ When a `BuildContext` is used from a `StatefulWidget`, the `mounted` property
2424
must be checked after an asynchronous gap.
2525
2626
**GOOD:**
27-
```
27+
```dart
2828
void onButtonTapped(BuildContext context) {
2929
Navigator.of(context).pop();
3030
}
3131
```
3232
3333
**BAD:**
34-
```
34+
```dart
3535
void onButtonTapped(BuildContext context) async {
3636
await Future.delayed(const Duration(seconds: 1));
3737
Navigator.of(context).pop();
3838
}
3939
```
4040
4141
**GOOD:**
42-
```
42+
```dart
4343
class _MyWidgetState extends State<MyWidget> {
4444
...
4545

0 commit comments

Comments
 (0)