0

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
  • The code you have shown has obvious typos. The line that you get as a warning is not in your code. Please provide a minimal reproducible example of your problem. Commented Oct 20, 2020 at 8:53
  • mian should be main() of course, and your entry function is empty? Commented Dec 9, 2020 at 23:17

2 Answers 2

1

you need to return runApp

   void main() => runApp(MyApp());
Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.