monajafi
monajafi

Reputation: 33

VSCode dart code auto completion doesn't work properly for packages

I use VSCode for flutter development everything is good but autocompletion is not working properly for packages.I wonder what is wrong with my IDE settings If I import packages without as keyword the code completion doesn't work but if I import them as something it works for example if I import like following :

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:http/http.dart'

The intellisense doesn't recognize FireStore and http but if I import like:

import 'package:cloud_firestore/cloud_firestore.dart' as fire;
import 'package:http/http.dart' as http;

now when I call fire It shows firestore class and methods and same is for http and every other package

Upvotes: 1

Views: 5184

Answers (1)

Sundaravel M
Sundaravel M

Reputation: 246

Since you're not getting auto-suggestions, please check these guidelines

  • Please ensure, you have included your package in pubspec.yaml
  • Did you executed flutter pub get
  • Usually, we can use Ctrl+Space to get auto-suggestion on VSCode

Upvotes: 2

Related Questions