skip to Main Content

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


  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

    Login or Signup to reply.
  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search