skip to Main Content

enter image description here

I don’t know why this error is coming up.
I also did import ‘package: flutter/material.dart’.
The default library is undefined
Please help me.
I’ve been doing that for hours.

I don’t know why this error is coming up.
I also did import ‘package: flutter/material.dart’.
The default library is undefined
Please help me.
I’ve been doing that for hours.

2

Answers


  1. Did you imported the material package correctly?

    it’s suspected that you are giving a white space before flutter word in package import.

    import it like this:

    import 'package:flutter/material.dart';
    

    Hope it helps you.

    Login or Signup to reply.
  2. First, try to reload VS Code or other editor you use.
    Second, on the popup window you shown there is a second link Quick Fix… Click on it end execute suffested fix.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search