Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dart analyzer is not parsing the dynamic generated files

I checked and the file is OK.

Dart 1.23.0 AngularDart 3.1.0

The error I am getting is:

Target of URI hasn't been generated: 'file.g.dart'

enter image description here

like image 586
Jonathan Avatar asked Jun 04 '17 20:06

Jonathan


3 Answers

It may help to run "Synchronize" -- bound by default to Ctrl-Q.

You can restart the analyzer on the dart analysis tab, in the top left is a button with arrows running in a circle, if you hover over it it says 'Restart Dart Analysis Server'.

Example picture

like image 138
David Morgan Avatar answered Nov 01 '22 12:11

David Morgan


first check this article : https://flutter.dev/docs/development/data-and-backend/json and make sure of all steps : 1- add dependencies in pubspec.yaml 2- flutter pub get 3- flutter pub upgrade 4- flutter pub run build_runner build

after all, consider that:

part 'timeline.g.dart';

most be your file name which classes are in!

if your file name is difference with your class name, you should use your file name.

like image 39
Reza Piri Avatar answered Nov 01 '22 13:11

Reza Piri


Had the same problem. Fixed it following these steps:

$ flutter pub get 
$ flutter pub upgrade
$ flutter pub run build_runner build --delete-conflicting-outputs
like image 2
matiszz Avatar answered Nov 01 '22 11:11

matiszz