Rob
Rob

Reputation: 1

Problem when running my first flutter app in android studio

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 {

Upvotes: 0

Views: 766

Answers (1)

pragmateek
pragmateek

Reputation: 935

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.

Upvotes: 0

Related Questions