Need help to resolve this issue while running flutter code

523 views Asked by At

This is the error I'm facing while running flutter programs:

lib/main.dart: Warning: Interpreting this as package URI, 'package:flutter_guide_1/main.dart'.

My code:

import 'package:flutter/material.dart';

void mian() {}

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Text('Hello!'),
    );
  }
}
2

There are 2 answers

0
ajay On BEST ANSWER

you need to return runApp

   void main() => runApp(MyApp());
0
SO 80 On

At the top of Android Studio, there is a drop-down menu with targets. It probably says "main.dart". Inside the box, left of the "main.dart", there is a blue symbol. Either it is an "[ (F) main.dart ]" (the Flutter logo) or it is a Dart-arrow fin logo "[ (X) main.dart ]". It should be the "F" version to build properly, so select that.