Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the named parameter 'onpressed' is required #61

Open
Niyanth-guru opened this issue Aug 21, 2022 · 2 comments
Open

the named parameter 'onpressed' is required #61

Niyanth-guru opened this issue Aug 21, 2022 · 2 comments

Comments

@Niyanth-guru
Copy link

Hey, I am trying to just get to know the scaffold widget, while giving the floatactionbutton widget I am getting this error:
The named parameter onPressed is required, but there is no corresponding argument
If I have to just add a onPressed action for the widget, then how is that the method followed in the Youtube video is not getting the same error? Can someone tell me if I have done something wrong?(Screenshot below for reference)

image

@JustRahman
Copy link

U should add onPressed function like:
floatingActionButton: FloatingActionButton(
child: Text("Text"),
backgroundColor: Colors.red,
onPressed: (){
print("Dont push this button");
},
),

@Rizwan201
Copy link

floatingActionButton: FloatingActionButton(
child: Text("Press"),
onPressed: ()=> print("Pressed"),
),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants