Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Entrypoint doesn't contain a main function Flutter

Tags:

flutter

I got an error Error: Entrypoint doesn't contain a main function Flutter, I tried to restart android studio but it did not work

like image 732
Alfonso Angulo Avatar asked Mar 10 '26 10:03

Alfonso Angulo


1 Answers

Depends on what the program is support to do. There should be a main class that is initiated. As an example:

    import 'package:flutter/material.dart';
    import 'package:english_words/english_words.dart';
    void main() => runApp(MyApp()); // initiate MyApp as  StatelessWidget

    // Main class
    class MyApp extends StatelessWidget {
      // creating main screen and building list of wordpairs
      @override
like image 166
Jeroen Wilmes Avatar answered Mar 12 '26 05:03

Jeroen Wilmes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!