Estava assim:
class _FeatureItem extends StatelessWidget {
final String name;
final IconData icon;
final Function onClick;
_FeatureItem(
this.name,
this.icon, {
@required this.onClick,
}) : assert(icon != null),
assert(onClick != null);
Troquei por esse que você colocou e agora está com mais erros:
error: The named parameter 'name' is required, but there's no corresponding argument. (missing_required_argument at [projetos2] lib\screens\dashboard.dart:23)
error: The named parameter 'icon' is required, but there's no corresponding argument. (missing_required_argument at [projetos2] lib\screens\dashboard.dart:23)
error: Too many positional arguments: 0 expected, but 2 found. (extra_positional_arguments_could_be_named at [projetos2] lib\screens\dashboard.dart:24)
error: The named parameter 'name' is required, but there's no corresponding argument. (missing_required_argument at [projetos2] lib\screens\dashboard.dart:28)
error: The named parameter 'icon' is required, but there's no corresponding argument. (missing_required_argument at [projetos2] lib\screens\dashboard.dart:28)
error: Too many positional arguments: 0 expected, but 2 found. (extra_positional_arguments_could_be_named at [projetos2] lib\screens\dashboard.dart:29)
Os erros são da Dashboard:
class Dashboard extends StatelessWidget {
@override
Widget build(BuildContext context) {
// TODO: implement build
return Scaffold(
appBar: AppBar(
title: Text('Dashboard'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset('images/bytebank_logo.png'),
),
Row(
children: [
_FeatureItem(
'Transfer',
Icons.monetization_on,
onClick: () => _showContactsList(context),
),
_FeatureItem(
'Transaction Feed',
Icons.description,
onClick: () => _showTransactionsList(context),
),
],
),
],
),
);
}