Incorrect diagnosis of RepaintBoundary usefulness in Widget inspector DevTool
- Vorherrschende Sprache
- Dart
- Sterne
- 1.7k
- Forks
- 404
- Ø Merge
- 6 T. 17 Std.
- Gemergte PRs (30 T.)
- 18
Beschreibung
### Description
I was watching [this part](https://youtu.be/PONvNV3u1Wg?si=l0AIiVsPY70pzKP4&t=2201) of a talk at by Craig Labenz where he explains about `RepaintBoundary` and gives an example of where not to use it. Later, he explains how to use the Widget inspector DevTool to diagnose whether a `RepaintBoundary` is useful.
I ran the code snippet and the DevTool says it's useful. That has to be a bug, right?
### Code sample
Code sample
```dart
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: Scaffold(body: Center(child: Body())),
);
}
}
class Body extends StatefulWidget {
const Body({super.key});
@override
State createState() => _BodyState();
}
class _BodyState extends State {
Color color = Colors.red;
@override
Widget build(BuildContext context) {
return SizedBox(
width: 200,
height: 200,
child: GestureDetector(
onTap: () => setState(() {
if (color == Colors.red) {
color = Colors.blue;
} else {
color = Colors.red;
}
}),
child: ColoredBox(
color: color,
child: RepaintBoundary(child: ColoredBox(color: color)),
),
),
);
}
}
```
### DevTool screenshot (see highlighted area):
This is after 10 taps on the tappable widget.
Beitragsleitfaden
Rechercherichtung
Beginne damit, das bereitgestellte Dart-Beispiel im Widget inspector DevTool zu reproduzieren, und überprüfe nach zehn Taps das Ergebnis zur Nützlichkeit von RepaintBoundary. Abgeschlossen ist die Aufgabe, wenn festgestellt wurde, ob die gemeldete Diagnose falsch ist, und das beobachtete Verhalten sowie das erwartete Ergebnis dokumentiert sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- dart, flutter
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 30/100