0

I am having problems running my first flutter app (I am following this course https://www.udemy.com/course/learn-flutter-dart-to-build-ios-android-apps/). I suspect that there are some issues with my dart configuration, but I can't resolve no matter what I try. Here's my console


Launching lib\main.dart on AOSP on IA Emulator in debug mode... Running Gradle task 'assembleDebug'... lib/main.dart:1:9: Error: Error when reading '/C:/Users/Doge/Desktop/Dev/flutter/packages/flutter/lib/material.dart': The system cannot find the path specified.

import 'package:flutter/material.dart'; ^ lib/main.dart:7:21: Error: Type 'StatelessWidget' not found. class MyApp extends StatelessWidget {

2
  • 2
    may b error is here /C:/. remove first /(shash) from path Commented Dec 18, 2020 at 12:04
  • Please post the full contents of your main.dart file Commented Dec 18, 2020 at 13:46

1 Answer 1

0

StatelessWidget() depends on the 'material' library for it to function.

Type this at the top of your main.dart file

import 'flutter:package/material.dart';

Save and then run it again. This will fix the problem.

Sign up to request clarification or add additional context in comments.

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.