1
votes

i was attempting to make an http request to a server, but when i import the package http the vs code print the next error:

Unable to find modules for some sources, this is usually the result of either a
bad import, a missing dependency in a package (or possibly a dev_dependency
needs to move to a real dependency), or a build failure (if importing a
generated file).

Please check the following imports:

`import 'package:http/http.dart' as http;` from fcfm_pa|lib/src/pages/registro_page.dart at 5:1

someone knows what's happen?

2
The easiest way that I was able to solve this problem was to change from beta channel to master channel. I would suggest anyone facing this issue to do the same. - Raycherr

2 Answers

0
votes

You should update your pubspec.yaml file with the following library declaration:

dependencies:
  http: ^0.12.0+4

and then import the library. After doing so, make sure to do over the terminal:

flutter pub get

and maybe even flutter clean to make sure you have everything correctly. Make a new build and you should be good to go.

0
votes

If you are on beta channel, this is an issue that occurs.

Try flutter channel master and then run the app again, this issue should not appear anymore.