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’, . . … ); } }
2
Answers
Stateless Widget does not have title and other parameters, those parameters belongs to MaterialApp widget
https://api.flutter.dev/flutter/material/MaterialApp-class.html
You have to return
MaterialApp
inside the build method of MyApp class.And then MaterialApp have property
title
,debugShowCheckedModeBanner
, androutes
.