xxxxxxxxxx
Will take couple minutes but will work:
flutter clean
flutter pub get
flutter pub cache repair
dart pub cache repair
Restart IDE (VS Code / Adnroid Studio)
xxxxxxxxxx
Try running "flutter pub get" in your terminal
xxxxxxxxxx
you need to import material package,
like this at the top of your code
import:'package:flutter/material.dart';