4

I am using Flutter with VSCODE in a MacOS. Just imported a file MobileHomePage.dart from AdobeXD and the file name is in RED - meaning some error in this file. enter image description here

I followed this tutorial. At 5:33 it shows that I should add the follow packages (adobe_xd: ^0.1.4 and flutter_launcher_icons: "^0.7.3") in pubspec.yaml > dependencies: and dev_dependencies:. And now this is what I have:

dependencies:
  flutter:
    sdk: flutter
  adobe_xd: ^0.1.4
  flutter_launcher_icons: "^0.7.3"

  cupertino_icons: ^0.1.3

dev_dependencies:
  flutter_test:
    sdk: flutter
  adobe_xd: ^0.1.4
  flutter_launcher_icons: "^0.7.3"

Based on the video, at this point the VSCode should solve the problem (turning the color in withe) automatically. It does't happened. I still have the color in Red.

Digging inside the file MobileHomePage.dart I have an error in the import 'package:adobe_xd/pinned.dart';

Target of URI doesn't exist: 'package:adobe_xd/pinned.dart'.
Try creating the file referenced by the URI, or Try using a URI for a file that does exist.darturi_does_not_exist

I've try to locate this lib in the flutter/adobe_xd package and it doesn't exist.

~/Documents/vhosts/flutter/.pub-cache/hosted/pub.dartlang.org/adobe_xd-0.1.4/lib(stable)$ ll
total 48
drwxr-xr-x   7 ialves  27132083   224 29 Aug 11:31 .
drwx------  10 ialves  27132083   320 29 Aug 11:31 ..
-rw-r--r--   1 ialves  27132083   494 13 May 16:15 adobe_xd.dart
-rw-r--r--   1 ialves  27132083  1884 13 May 16:57 blend_mask.dart
-rw-r--r--   1 ialves  27132083  1865 13 May 17:20 gradient_xd_transform.dart
-rw-r--r--   1 ialves  27132083  5685 13 May 17:20 page_link.dart
-rw-r--r--   1 ialves  27132083  1022 13 May 16:15 specific_rect_clip.dart

The import 'package:adobe_xd/blend_mask.dart'; inside the MobileHomePage.dart file is not throwing an error because the lib blend_mask.dart already exists in adobe_xd-0.1.4/lib. But the lib adobe_xd/pinned.dart don't.

Maybe this is the origin of the issue.

I have tried: flutter clean and flutter packages get and restarted the VSCode and it didn't work. The adobe_xd/pinned.dart can't still be located.

I don't know how to solve this issue (install this missing lib in the adobe_xd package ?). Any idea?


Opened issue in GtHub - AdobeXD / xd-to-flutter-plugin.

IgorAlves
  • 5,086
  • 10
  • 52
  • 83

4 Answers4

6

In your pubspec.yaml change the adobe_xd version to this

adobe_xd: ^1.0.0+1

Run flutter pub upgrade and flutter clean and you should be good

ByteMe
  • 1,575
  • 1
  • 12
  • 23
2
  1. Install Pubspec Assist extension from extensions.

  2. Go to pubspec.yaml and hit CTRL+SHIFT+P

  3. Search for pubspec in the opened line and select Pubspec Assist: Add/update Dependencies input line

  4. Enter adobe_xd in the line and it will automatically add the latest version to depencies

Gadiyevich
  • 67
  • 1
  • 7
0

change your sdk version to 2.10.4

environment:
  sdk: ">=2.10.4 <3.0.0"
dependencies:
  flutter:
    sdk: flutter
  adobe_xd: ^1.0.0+1
  flutter_launcher_icons: ^0.8.1
0

I have this config working for me:

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  adobe_xd: ^1.0.0+1
  flutter_launcher_icons: ^0.8.1


  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.0

dev_dependencies:
  flutter_test:
    sdk: flutter