0

I have a problem in flutter in main.dart page in Stateless widget inside return MyApp( the title: , home: , debugShowCheckedModeBanner: and routes they give me an error "The named parameter 'title /any of them' isn't defined. Try correcting the name to an existing nameed parameter with the name'

class MyApp extends Statelesswidget { @override Widget buil(BuildContext context) { return MyApp( title : 'page', . . ... ); } }

1
  • post your full code Commented Mar 2, 2024 at 11:33

2 Answers 2

0

Stateless Widget does not have title and other parameters, those parameters belongs to MaterialApp widget https://api.flutter.dev/flutter/material/MaterialApp-class.html

Sign up to request clarification or add additional context in comments.

2 Comments

Thank tou very much
It is often necessary to place code for greater understanding
0

You have to return MaterialApp inside the build method of MyApp class. And then MaterialApp have property title, debugShowCheckedModeBanner, and routes.

enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.