-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Labels
a.tut.tutorialRelates to the Tutorial section of docs.flutter.devRelates to the Tutorial section of docs.flutter.deve0-minutesEffort: < 60 minEffort: < 60 minp2-mediumNecessary but not urgent concern. Resolve when possible.Necessary but not urgent concern. Resolve when possible.
Description
Steps to reproduce
In the ListenableBuilder tutorial, the final ArticlePage class references nextArticleCallback, which is not defined. The earlier code defines onPressed, so this causes a compile error.
Additionally, wrapping ArticleWidget in Flexible inside SingleChildScrollView results in an unbounded constraints error. Removing Flexible resolves the issue.
(See the attached image.)
Expected results
The tutorial code should compile successfully when copied exactly as shown.
Actual results
Error: The getter 'nextArticleCallback' isn't defined for the type 'ArticlePage'.
RenderFlex children have non-zero flex but incoming height constraints are unbounded.
Code sample
Code sample
class ArticlePage extends StatelessWidget {
const ArticlePage({
super.key,
required this.summary,
required this.onPressed,
});
final Summary summary;
final VoidCallback onPressed;
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Column(
children: [
Flexible(
child: ArticleWidget(
summary: summary,
),
),
ElevatedButton(
onPressed: nextArticleCallback,
child: Text('Next random article'),
),
],
),
);
}
}
Screenshots or Video
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
Not applicable.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
a.tut.tutorialRelates to the Tutorial section of docs.flutter.devRelates to the Tutorial section of docs.flutter.deve0-minutesEffort: < 60 minEffort: < 60 minp2-mediumNecessary but not urgent concern. Resolve when possible.Necessary but not urgent concern. Resolve when possible.
