أبو الجهود
أبو الجهود

Reputation: 1

How can Error in flutter stateless widget?

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', . . ... ); } }

Upvotes: 0

Views: 119

Answers (2)

Mohammad Bilal Akbar
Mohammad Bilal Akbar

Reputation: 170

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

Upvotes: 0

Luis Rodas
Luis Rodas

Reputation: 1

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

Upvotes: 0

Related Questions