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
Screenshots / Video demonstration
Logs
Logs
Flutter Doctor output
Doctor output
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
Screenshots or Video
Screenshots / Video demonstration
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
Not applicable.