shamblett / sporran

A PouchDB like browser application in Dart

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flutter can't find dart basic imports

boganiLuca opened this issue · comments

I am trying to start the development of a GUI for a CouchDB client for Flutter (both apps and web), but I'm encountering some difficulties right at the beginning.
Since the web part will probably be the most used, I started from there: facing the first issues, I tried by running your example just to see if it was running fine. The example seemed to be able to create the document and retrieving it while online, but failed to retrieve if while offline.
To clear any doubts regarding the web version, I tried to run it on an Android device, but I got some really unexpected error messages:

/D:/flutter/.pub-cache/hosted/pub.dartlang.org/sporran-6.0.0/lib/sporran.dart:12:8: Error: Not found: 'dart:html'
import 'dart:html';
^
/D:/flutter/.pub-cache/hosted/pub.dartlang.org/sporran-6.0.0/lib/src/lawndart/lawndart.dart:44:8: Error: Not found: 'dart:html'
import 'dart:html';
^
/D:/flutter/.pub-cache/hosted/pub.dartlang.org/sporran-6.0.0/lib/src/lawndart/lawndart.dart:45:8: Error: Not found: 'dart:indexed_db'
import 'dart:indexed_db' as idb;

This is not the full output, but, as you can guess, if the output starts like this, there will be a lot of errors incoming.
I already tried running flutter clean, invalidating Android Studio caches, rebooting, even created a new project from the scratch but the errors are still there. Strangely enough, if I try to run the example for the web, these errors simply are not there.
Am I missing something? I fear that there's something really obvious I'm not noticing...

PS subsequent runs, without first running flutter clean, have these lines before the missing imports, but I guess that are caused by the previous failed build

Invalid depfile: D:\SVN\android\prova.dart_tool\flutter_build\8015527b302cdffb9268bd388581de2d\kernel_snapshot.d
Invalid depfile: D:\SVN\android\prova.dart_tool\flutter_build\8015527b302cdffb9268bd388581de2d\kernel_snapshot.d

Flutter doctor output:

[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Versione 10.0.19043.1110], locale it-IT)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] Connected device (3 available)

Ok, I forgot that Flutter is supported only for web. My bad. I'll open another issue for the other problems.