The argument type 'Future<dynamic>' can't be assigned to the parameter type 'void Function()'
REPLACE THIS:
onPressed: Navigator.push(...)
WITH THIS:
onPressed: () => Navigator.push(...)
The argument type 'Future<dynamic>' can't be assigned to the parameter type 'void Function()'
REPLACE THIS:
onPressed: Navigator.push(...)
WITH THIS:
onPressed: () => Navigator.push(...)
The argument type 'Function' can't be assigned to the parameter type 'void Function()?'.
class DrawerItem extends StatelessWidget {
final String text;
final VoidCallback onPressed;
const DrawerItem({Key key, this.text, this.onPressed}) : super(key: key);
@override
Widget build(BuildContext context) {
return FlatButton(
child: Text(
text,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 18.0,
),
),
onPressed: onPressed,
);
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us