Open
Description
error: (error, stackTrace) => Center(
child: Text(
'Error: $error',
style: const TextStyle(color: CupertinoColors.systemRed),
),
),
extract the widget on the Center widget
class A extends StatelessWidget {
const A({
super.key,
});
@override
Widget build(BuildContext context) {
return Center(
child: Text(
'Error: $error',
style: const TextStyle(color: CupertinoColors.systemRed),
),
);
}
}
Undefined name 'error'. Try correcting the name to one that is defined, or defining the name.
expected code:
class FavoriteFoldersErrorWidget extends StatelessWidget {
final Object error;
const FavoriteFoldersErrorWidget({
required this.error,
super.key,
});
@override
Widget build(BuildContext context) {
return Center(
child: Text(
'Error: $error',
style: const TextStyle(color: CupertinoColors.systemRed),
),
);
}
}