[flutter_tools] modify Skeleton template to use ListenableBuilder instead of AnimatedBuilder (#128810)

Replaces AnimatedBuilder for ListenableBuilder in the skeleton template

Fixes https://github.com/flutter/flutter/issues/128801

No tests needed
This commit is contained in:
fabiancrx 2023-07-06 11:14:51 -04:00 committed by GitHub
parent bc49cd1bca
commit 2f7614a818
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,10 +20,10 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
// Glue the SettingsController to the MaterialApp. // Glue the SettingsController to the MaterialApp.
// //
// The AnimatedBuilder Widget listens to the SettingsController for changes. // The ListenableBuilder Widget listens to the SettingsController for changes.
// Whenever the user updates their settings, the MaterialApp is rebuilt. // Whenever the user updates their settings, the MaterialApp is rebuilt.
return AnimatedBuilder( return ListenableBuilder(
animation: settingsController, listenable: settingsController,
builder: (BuildContext context, Widget? child) { builder: (BuildContext context, Widget? child) {
return MaterialApp( return MaterialApp(
// Providing a restorationScopeId allows the Navigator built by the // Providing a restorationScopeId allows the Navigator built by the