├── debug.json ├── adobe_xd ├── example │ ├── ios │ │ ├── Flutter │ │ │ ├── Debug.xcconfig │ │ │ ├── Release.xcconfig │ │ │ └── AppFrameworkInfo.plist │ │ ├── Runner │ │ │ ├── Runner-Bridging-Header.h │ │ │ ├── Assets.xcassets │ │ │ │ ├── LaunchImage.imageset │ │ │ │ │ ├── LaunchImage.png │ │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ │ ├── README.md │ │ │ │ │ └── Contents.json │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ │ │ └── Contents.json │ │ │ ├── AppDelegate.swift │ │ │ ├── Base.lproj │ │ │ │ ├── Main.storyboard │ │ │ │ └── LaunchScreen.storyboard │ │ │ └── Info.plist │ │ ├── Runner.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── Runner.xcodeproj │ │ │ ├── project.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata │ │ │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ └── .gitignore │ ├── macos │ │ ├── Flutter │ │ │ ├── Flutter-Debug.xcconfig │ │ │ ├── Flutter-Release.xcconfig │ │ │ └── GeneratedPluginRegistrant.swift │ │ ├── .gitignore │ │ ├── Runner │ │ │ ├── Configs │ │ │ │ ├── Debug.xcconfig │ │ │ │ ├── Release.xcconfig │ │ │ │ ├── Warnings.xcconfig │ │ │ │ └── AppInfo.xcconfig │ │ │ ├── Assets.xcassets │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ ├── app_icon_1024.png │ │ │ │ │ ├── app_icon_128.png │ │ │ │ │ ├── app_icon_16.png │ │ │ │ │ ├── app_icon_256.png │ │ │ │ │ ├── app_icon_32.png │ │ │ │ │ ├── app_icon_512.png │ │ │ │ │ ├── app_icon_64.png │ │ │ │ │ └── Contents.json │ │ │ ├── AppDelegate.swift │ │ │ ├── Release.entitlements │ │ │ ├── DebugProfile.entitlements │ │ │ ├── MainFlutterWindow.swift │ │ │ └── Info.plist │ │ ├── Runner.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── Runner.xcodeproj │ │ │ ├── project.xcworkspace │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Campvibes.xd │ ├── web │ │ ├── favicon.png │ │ ├── icons │ │ │ ├── Icon-192.png │ │ │ └── Icon-512.png │ │ ├── manifest.json │ │ └── index.html │ ├── assets │ │ └── images │ │ │ ├── camp.jpg │ │ │ ├── tent.png │ │ │ ├── jacket.png │ │ │ ├── lantern.png │ │ │ ├── trail.png │ │ │ ├── 2.0x │ │ │ ├── tent.png │ │ │ ├── jacket.png │ │ │ ├── lantern.png │ │ │ ├── trail.png │ │ │ └── badlands.jpg │ │ │ ├── 3.0x │ │ │ ├── tent.png │ │ │ ├── jacket.png │ │ │ ├── lantern.png │ │ │ ├── trail.png │ │ │ └── badlands.jpg │ │ │ └── badlands.jpg │ ├── android │ │ ├── gradle.properties │ │ ├── .gitignore │ │ ├── app │ │ │ ├── src │ │ │ │ ├── main │ │ │ │ │ ├── res │ │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── drawable │ │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ │ ├── drawable-v21 │ │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ │ ├── values │ │ │ │ │ │ │ └── styles.xml │ │ │ │ │ │ └── values-night │ │ │ │ │ │ │ └── styles.xml │ │ │ │ │ ├── kotlin │ │ │ │ │ │ └── com │ │ │ │ │ │ │ └── example │ │ │ │ │ │ │ └── example │ │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ ├── debug │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── profile │ │ │ │ │ └── AndroidManifest.xml │ │ │ └── build.gradle │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ └── gradle-wrapper.properties │ │ ├── settings.gradle │ │ └── build.gradle │ ├── .metadata │ ├── lib │ │ ├── xd_colors.dart │ │ ├── main.dart │ │ └── xd_text_styles.dart │ ├── .gitignore │ ├── README.md │ ├── test │ │ └── widget_test.dart │ └── pubspec.yaml ├── .metadata ├── lib │ ├── adobe_xd.dart │ ├── gradient_xd_transform.dart │ └── blend_mask.dart ├── pubspec.yaml ├── LICENSE ├── .gitignore └── CHANGELOG.md ├── test_suite ├── macos │ ├── Flutter │ │ ├── Flutter-Debug.xcconfig │ │ ├── Flutter-Release.xcconfig │ │ └── GeneratedPluginRegistrant.swift │ ├── Runner │ │ ├── Configs │ │ │ ├── Debug.xcconfig │ │ │ ├── Release.xcconfig │ │ │ ├── Warnings.xcconfig │ │ │ └── AppInfo.xcconfig │ │ ├── Assets.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ ├── app_icon_16.png │ │ │ │ ├── app_icon_32.png │ │ │ │ ├── app_icon_64.png │ │ │ │ ├── app_icon_1024.png │ │ │ │ ├── app_icon_128.png │ │ │ │ ├── app_icon_256.png │ │ │ │ ├── app_icon_512.png │ │ │ │ └── Contents.json │ │ ├── AppDelegate.swift │ │ ├── Release.entitlements │ │ ├── DebugProfile.entitlements │ │ ├── MainFlutterWindow.swift │ │ └── Info.plist │ ├── .gitignore │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── Runner.xcodeproj │ │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── tests_suite.xd ├── web │ ├── favicon.png │ ├── icons │ │ ├── Icon-192.png │ │ └── Icon-512.png │ ├── manifest.json │ └── index.html ├── assets │ └── images │ │ ├── one.png │ │ ├── two.png │ │ ├── four.png │ │ ├── home.png │ │ ├── three.png │ │ ├── 2.0x │ │ ├── two.png │ │ ├── four.png │ │ ├── home.png │ │ └── three.png │ │ └── 3.0x │ │ ├── two.png │ │ ├── four.png │ │ ├── home.png │ │ └── three.png ├── .metadata ├── lib │ ├── xd_colors.dart │ ├── xd_center_point.dart │ ├── xd_nav_btn.dart │ ├── xd_small_corner.dart │ ├── xd_edge.dart │ ├── xd_component5.dart │ ├── xd_transition_target.dart │ ├── xd_component163.dart │ ├── xd_nested_component.dart │ ├── main.dart │ ├── xd_nav_row.dart │ ├── xd_btn.dart │ ├── xd_blank.dart │ ├── xd_test_group.dart │ ├── xd_dupe_params_same_type.dart │ ├── xd_component181.dart │ ├── xd_component171.dart │ ├── xd_on_tap_component.dart │ ├── xd_component261.dart │ ├── xd_component251.dart │ ├── xd_page_size.dart │ ├── xd_title_bar.dart │ ├── xd_vertical_layout.dart │ ├── xd_horizontal_layout.dart │ └── xd_layout_box_components.dart ├── .gitignore ├── test │ └── widget_test.dart ├── README.md ├── analysis_options.yaml └── pubspec.yaml ├── src ├── ui │ ├── assets │ │ ├── icon-edit.png │ │ ├── icon-info.png │ │ ├── icon@1x.png │ │ ├── icon@2x.png │ │ ├── icon-error.png │ │ ├── icon-folder.png │ │ ├── bg-transparent.png │ │ └── icon-warning.png │ ├── preview.jsx │ ├── results.jsx │ └── render_preview.js ├── core │ ├── parameter.js │ ├── nodes │ │ ├── path.js │ │ ├── artboard.js │ │ ├── component.js │ │ └── abstractnode.js │ ├── decorators │ │ ├── abstractdecorator.js │ │ ├── comment.js │ │ ├── ontap.js │ │ ├── blur.js │ │ └── blend.js │ ├── constants.js │ ├── proptype.js │ ├── nodetype.js │ └── log.js ├── version.js └── utils │ └── nameutils.js ├── manifest.json ├── .gitignore ├── package.json ├── .github ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── PULL_REQUEST_TEMPLATE.md └── CONTRIBUTING.md ├── LICENSE ├── deploy-script.js ├── BUILDME.md ├── webpack.config.js └── CODE_OF_CONDUCT.md /debug.json: -------------------------------------------------------------------------------- 1 | { 2 | "port": 30003, 3 | "breakOnStart": false 4 | } 5 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /test_suite/macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /test_suite/macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /adobe_xd/example/macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /adobe_xd/example/macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /src/ui/assets/icon-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/src/ui/assets/icon-edit.png -------------------------------------------------------------------------------- /src/ui/assets/icon-info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/src/ui/assets/icon-info.png -------------------------------------------------------------------------------- /src/ui/assets/icon@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/src/ui/assets/icon@1x.png -------------------------------------------------------------------------------- /src/ui/assets/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/src/ui/assets/icon@2x.png -------------------------------------------------------------------------------- /test_suite/tests_suite.xd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/tests_suite.xd -------------------------------------------------------------------------------- /test_suite/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/web/favicon.png -------------------------------------------------------------------------------- /adobe_xd/example/Campvibes.xd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/Campvibes.xd -------------------------------------------------------------------------------- /src/ui/assets/icon-error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/src/ui/assets/icon-error.png -------------------------------------------------------------------------------- /src/ui/assets/icon-folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/src/ui/assets/icon-folder.png -------------------------------------------------------------------------------- /adobe_xd/example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/web/favicon.png -------------------------------------------------------------------------------- /src/ui/assets/bg-transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/src/ui/assets/bg-transparent.png -------------------------------------------------------------------------------- /src/ui/assets/icon-warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/src/ui/assets/icon-warning.png -------------------------------------------------------------------------------- /test_suite/assets/images/one.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/assets/images/one.png -------------------------------------------------------------------------------- /test_suite/assets/images/two.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/assets/images/two.png -------------------------------------------------------------------------------- /test_suite/assets/images/four.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/assets/images/four.png -------------------------------------------------------------------------------- /test_suite/assets/images/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/assets/images/home.png -------------------------------------------------------------------------------- /test_suite/assets/images/three.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/assets/images/three.png -------------------------------------------------------------------------------- /test_suite/macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /test_suite/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/web/icons/Icon-192.png -------------------------------------------------------------------------------- /test_suite/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/web/icons/Icon-512.png -------------------------------------------------------------------------------- /adobe_xd/example/macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/xcuserdata/ 7 | -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /test_suite/assets/images/2.0x/two.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/assets/images/2.0x/two.png -------------------------------------------------------------------------------- /test_suite/assets/images/3.0x/two.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/assets/images/3.0x/two.png -------------------------------------------------------------------------------- /test_suite/macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /adobe_xd/example/assets/images/camp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/assets/images/camp.jpg -------------------------------------------------------------------------------- /adobe_xd/example/assets/images/tent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/assets/images/tent.png -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /adobe_xd/example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /adobe_xd/example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /test_suite/assets/images/2.0x/four.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/assets/images/2.0x/four.png -------------------------------------------------------------------------------- /test_suite/assets/images/2.0x/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/assets/images/2.0x/home.png -------------------------------------------------------------------------------- /test_suite/assets/images/2.0x/three.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/assets/images/2.0x/three.png -------------------------------------------------------------------------------- /test_suite/assets/images/3.0x/four.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/assets/images/3.0x/four.png -------------------------------------------------------------------------------- /test_suite/assets/images/3.0x/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/assets/images/3.0x/home.png -------------------------------------------------------------------------------- /test_suite/assets/images/3.0x/three.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/assets/images/3.0x/three.png -------------------------------------------------------------------------------- /adobe_xd/example/assets/images/jacket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/assets/images/jacket.png -------------------------------------------------------------------------------- /adobe_xd/example/assets/images/lantern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/assets/images/lantern.png -------------------------------------------------------------------------------- /adobe_xd/example/assets/images/trail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/assets/images/trail.png -------------------------------------------------------------------------------- /test_suite/macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /adobe_xd/example/assets/images/2.0x/tent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/assets/images/2.0x/tent.png -------------------------------------------------------------------------------- /adobe_xd/example/assets/images/3.0x/tent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/assets/images/3.0x/tent.png -------------------------------------------------------------------------------- /adobe_xd/example/assets/images/badlands.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/assets/images/badlands.jpg -------------------------------------------------------------------------------- /adobe_xd/example/assets/images/2.0x/jacket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/assets/images/2.0x/jacket.png -------------------------------------------------------------------------------- /adobe_xd/example/assets/images/2.0x/lantern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/assets/images/2.0x/lantern.png -------------------------------------------------------------------------------- /adobe_xd/example/assets/images/2.0x/trail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/assets/images/2.0x/trail.png -------------------------------------------------------------------------------- /adobe_xd/example/assets/images/3.0x/jacket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/assets/images/3.0x/jacket.png -------------------------------------------------------------------------------- /adobe_xd/example/assets/images/3.0x/lantern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/assets/images/3.0x/lantern.png -------------------------------------------------------------------------------- /adobe_xd/example/assets/images/3.0x/trail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/assets/images/3.0x/trail.png -------------------------------------------------------------------------------- /adobe_xd/example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /adobe_xd/example/assets/images/2.0x/badlands.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/assets/images/2.0x/badlands.jpg -------------------------------------------------------------------------------- /adobe_xd/example/assets/images/3.0x/badlands.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/assets/images/3.0x/badlands.jpg -------------------------------------------------------------------------------- /adobe_xd/example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /adobe_xd/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /adobe_xd/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /adobe_xd/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /adobe_xd/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /adobe_xd/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /test_suite/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /test_suite/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /test_suite/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /test_suite/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /test_suite/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /test_suite/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /test_suite/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/test_suite/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /adobe_xd/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdobeXD/xd-to-flutter-plugin/HEAD/adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /test_suite/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /test_suite/macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | 9 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 10 | } 11 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /adobe_xd/example/macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | 9 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 10 | } 11 | -------------------------------------------------------------------------------- /test_suite/macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test_suite/macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /adobe_xd/example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test_suite/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test_suite/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test_suite/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: f30b7f4db93ee747cd727df747941a28ead25ff5 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /adobe_xd/example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: a849daf2836d653ef80e01f428531b3f787671cb 8 | channel: dev 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /adobe_xd/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 27321ebbad34b0a3fafe99fac037102196d655ff 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /adobe_xd/example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /adobe_xd/example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /test_suite/lib/xd_colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class XDColors { 4 | static const Color supported = const Color(0xff008d00); 5 | static const Color error = const Color(0xff981a1a); 6 | static const Color unsupported = const Color(0xffc37f00); 7 | static const Color supportedAlt = const Color(0xff62078d); 8 | static const Color neutral = const Color(0xff707070); 9 | } 10 | -------------------------------------------------------------------------------- /test_suite/macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test_suite/macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "6eaf77ea", 3 | "name": "XD to Flutter", 4 | "version": "4.0.0", 5 | "icons": [ 6 | { 7 | "width": 24, 8 | "height": 24, 9 | "path": "images/icon@1x.png" 10 | }, 11 | { 12 | "width": 48, 13 | "height": 48, 14 | "path": "images/icon@2x.png" 15 | } 16 | ], 17 | "host": { 18 | "app": "XD", 19 | "minVersion": "25.0" 20 | }, 21 | "uiEntryPoints": [ 22 | { 23 | "type": "panel", 24 | "label": "XD to Flutter", 25 | "panelId": "flutterPanel" 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /adobe_xd/example/lib/xd_colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class XDColors { 4 | static const Color theme = const Color(0xff254f6e); 5 | static const Color highlight = const Color(0xff00a9de); 6 | static const Color white = const Color(0xffffffff); 7 | static const Color grey0 = const Color(0xffd5d5d5); 8 | static const Color grey1 = const Color(0xff808080); 9 | static const Color grey2 = const Color(0xff333333); 10 | 11 | static const List grey = const [grey0, grey1, grey2]; 12 | } 13 | -------------------------------------------------------------------------------- /adobe_xd/example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /adobe_xd/example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /adobe_xd/lib/adobe_xd.dart: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | export 'page_link.dart'; 13 | export 'gradient_xd_transform.dart'; 14 | export 'blend_mask.dart'; 15 | export 'pinned.dart'; 16 | -------------------------------------------------------------------------------- /test_suite/lib/xd_center_point.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:adobe_xd/pinned.dart'; 3 | 4 | class XDCenterPoint extends StatelessWidget { 5 | XDCenterPoint({ 6 | Key? key, 7 | }) : super(key: key); 8 | @override 9 | Widget build(BuildContext context) { 10 | return Stack( 11 | children: [ 12 | Pinned.fromPins( 13 | Pin(startFraction: 0.0, endFraction: 0.0), 14 | Pin(startFraction: 0.0, endFraction: 0.0), 15 | child: Container( 16 | color: const Color(0xff008d00), 17 | ), 18 | ), 19 | ], 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/core/parameter.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | class Parameter { 13 | constructor(name, type=null, value=null) { 14 | this.name = name; 15 | this.type = type; // the Dart type 16 | this.value = value; // always the string value or null 17 | } 18 | } 19 | exports.Parameter = Parameter; 20 | -------------------------------------------------------------------------------- /test_suite/macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated files 2 | xd-flutter-plugin-src/build/ 3 | 4 | # Logs 5 | logs 6 | *.log 7 | npm-debug.log* 8 | yarn-debug.log* 9 | yarn-error.log* 10 | lerna-debug.log* 11 | 12 | # Dependency directories 13 | node_modules/ 14 | 15 | # Optional npm cache directory 16 | .npm 17 | 18 | 19 | # Optional REPL history 20 | .node_repl_history 21 | 22 | # Output of 'npm pack' 23 | *.tgz 24 | 25 | # Yarn Integrity file 26 | .yarn-integrity 27 | 28 | # parcel-bundler cache (https://parceljs.org/) 29 | .cache 30 | 31 | # Stores VSCode versions used for testing VSCode extensions 32 | .vscode-test 33 | 34 | 35 | .DS_Store 36 | .history 37 | /build 38 | .vscode 39 | _!_* 40 | XDtoFlutter_v*.xdx 41 | -------------------------------------------------------------------------------- /adobe_xd/example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /test_suite/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test_suite", 3 | "short_name": "test_suite", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = example 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2021 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /test_suite/macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = test_suite 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.testSuite 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /adobe_xd/example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | include ':app' 6 | 7 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 8 | def properties = new Properties() 9 | 10 | assert localPropertiesFile.exists() 11 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 12 | 13 | def flutterSdkPath = properties.getProperty("flutter.sdk") 14 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 15 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 16 | -------------------------------------------------------------------------------- /adobe_xd/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: adobe_xd 2 | description: Generate code for building apps with Flutter based on your designs in Adobe XD with the “XD to Flutter” plugin. This package contains helper widgets used by the plugin. 3 | repository: https://github.com/AdobeXD/xd-to-flutter-plugin/tree/master/adobe_xd 4 | homepage: https://adobe.com/go/xd_to_flutter 5 | 6 | version: 2.0.1 7 | 8 | environment: 9 | sdk: '>=2.12.0 <3.0.0' 10 | flutter: '>=1.6.7' 11 | 12 | dependencies: 13 | collection: ^1.15.0 14 | flutter: 15 | sdk: 'flutter' 16 | flutter_svg: ^1.0.3 17 | 18 | dev_dependencies: 19 | flutter_test: 20 | sdk: flutter 21 | 22 | flutter: 23 | uses-material-design: true 24 | 25 | -------------------------------------------------------------------------------- /adobe_xd/example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /adobe_xd/example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'home.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | void main() { 5 | runApp(MyApp()); 6 | } 7 | 8 | class MyApp extends StatelessWidget { 9 | @override 10 | Widget build(BuildContext context) { 11 | return MaterialApp( 12 | title: 'XD to Flutter example', 13 | theme: ThemeData( 14 | visualDensity: VisualDensity.adaptivePlatformDensity, 15 | ), 16 | 17 | 18 | // Home is an artboard exported from Adobe XD 19 | home: Home( 20 | // This assigns a handler to a "Tap Callback Name" that was defined 21 | // on the "Latest Adventures" card in the XD file: 22 | onTapAdventure: () => print("You tapped the Latest Adventure."), 23 | ), 24 | 25 | 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /test_suite/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "xd-flutter-plugin", 3 | "version": "1.0.0", 4 | "main": "main.js", 5 | "scripts": { 6 | "build": "webpack", 7 | "deploy": "node deploy-script" 8 | }, 9 | "devDependencies": { 10 | "archiver": "^3.1.1", 11 | "circular-dependency-plugin": "^5.2.0", 12 | "ncp": "^2.0.0", 13 | "nodemon": "^1.18.7", 14 | "webpack": "^4.41.5", 15 | "webpack-cli": "^3.1.0" 16 | }, 17 | "dependencies": { 18 | "babel-core": "^6.26.3", 19 | "babel-loader": "^7.1.5", 20 | "babel-plugin-transform-react-jsx": "^6.24.1", 21 | "css-loader": "^3.4.2", 22 | "file-loader": "^5.0.2", 23 | "preact": "^10.2.1", 24 | "style-loader": "^1.1.2", 25 | "stylus": "^0.54.7", 26 | "stylus-loader": "^3.0.2" 27 | }, 28 | "author": "gskinner.com", 29 | "license": "MIT" 30 | } 31 | -------------------------------------------------------------------------------- /test_suite/lib/xd_nav_btn.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class XDNavBtn extends StatelessWidget { 4 | XDNavBtn({ 5 | Key? key, 6 | }) : super(key: key); 7 | @override 8 | Widget build(BuildContext context) { 9 | return Stack( 10 | children: [ 11 | Container( 12 | decoration: BoxDecoration( 13 | color: const Color(0xffffffff), 14 | borderRadius: BorderRadius.circular(8.0), 15 | border: Border.all(width: 1.0, color: const Color(0xfff0f0f0)), 16 | boxShadow: [ 17 | BoxShadow( 18 | color: const Color(0x0f000000), 19 | offset: Offset(0, 1), 20 | blurRadius: 3, 21 | ), 22 | ], 23 | ), 24 | ), 25 | ], 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | _We love to hear your ideas, but we need your help. Please take a few minutes to fill out the information below, and provide a concise, descriptive title._ 11 | 12 | **Is your feature request related to a problem? Please describe.** 13 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 14 | 15 | **Describe the solution you'd like** 16 | A clear and concise description of what you want to happen. 17 | 18 | **Describe alternatives you've considered** 19 | A clear and concise description of any alternative solutions or features you've considered. 20 | 21 | **Additional context** 22 | Add any other context or screenshots about the feature request here. 23 | -------------------------------------------------------------------------------- /test_suite/lib/xd_small_corner.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:adobe_xd/pinned.dart'; 3 | 4 | class XDSmallCorner extends StatelessWidget { 5 | XDSmallCorner({ 6 | Key? key, 7 | }) : super(key: key); 8 | @override 9 | Widget build(BuildContext context) { 10 | return Stack( 11 | children: [ 12 | Pinned.fromPins( 13 | Pin(startFraction: 0.0, endFraction: 0.0), 14 | Pin(startFraction: 0.5, endFraction: 0.0), 15 | child: Container( 16 | color: const Color(0xff0097c4), 17 | ), 18 | ), 19 | Pinned.fromPins( 20 | Pin(startFraction: 0.5, endFraction: 0.0), 21 | Pin(startFraction: 0.0, endFraction: 0.0), 22 | child: Container( 23 | color: const Color(0xff00c4ff), 24 | ), 25 | ), 26 | ], 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test_suite/lib/xd_edge.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:adobe_xd/pinned.dart'; 3 | 4 | class XDEdge extends StatelessWidget { 5 | XDEdge({ 6 | Key? key, 7 | }) : super(key: key); 8 | @override 9 | Widget build(BuildContext context) { 10 | return Stack( 11 | children: [ 12 | Pinned.fromPins( 13 | Pin(startFraction: 0.0, endFraction: 0.0), 14 | Pin(startFraction: 0.0, endFraction: 0.0), 15 | child: Container( 16 | decoration: BoxDecoration( 17 | gradient: LinearGradient( 18 | begin: Alignment(0.0, -1.0), 19 | end: Alignment(0.0, 1.0), 20 | colors: [const Color(0xffec55ff), const Color(0xff640071)], 21 | stops: [0.0, 1.0], 22 | ), 23 | ), 24 | ), 25 | ), 26 | ], 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /adobe_xd/example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Exceptions to above rules. 44 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 45 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/core/nodes/path.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | const xd = require("scenegraph"); 13 | 14 | const { AbstractNode } = require("./abstractnode"); 15 | 16 | class Path extends AbstractNode { 17 | static create(xdNode, ctx) { 18 | if (xdNode instanceof xd.Path || xdNode instanceof xd.Polygon || xdNode instanceof xd.Line || xdNode instanceof xd.BooleanGroup) { 19 | return new Path(xdNode, ctx); 20 | } 21 | } 22 | 23 | serialize(ctx) { 24 | // Path objects are converted to Shapes in combineShapes 25 | throw("Path.serialize() called."); 26 | } 27 | } 28 | exports.Path = Path; 29 | 30 | -------------------------------------------------------------------------------- /test_suite/lib/xd_component5.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_svg/flutter_svg.dart'; 3 | 4 | class XDComponent5 extends StatelessWidget { 5 | XDComponent5({ 6 | Key? key, 7 | }) : super(key: key); 8 | @override 9 | Widget build(BuildContext context) { 10 | return Stack( 11 | children: [ 12 | SizedBox.expand( 13 | child: SvgPicture.string( 14 | _svg_ecce7l, 15 | allowDrawingOutsideViewBox: true, 16 | fit: BoxFit.fill, 17 | )), 18 | ], 19 | ); 20 | } 21 | } 22 | 23 | const String _svg_ecce7l = 24 | ''; 25 | -------------------------------------------------------------------------------- /adobe_xd/example/README.md: -------------------------------------------------------------------------------- 1 | # XD to Flutter example 2 | 3 | ## Flutter Channel 4 | This example was created with the `dev` channel of Flutter, in order to support desktop. Building with another channel may cause issues on some target platforms. 5 | 6 | 7 | ## About 8 | This is a simple example for the "XD to Flutter" plugin for Adobe XD. 9 | 10 | The `Campvibes.xd` file has already been exported for convenience. All files in `assets/images/` and `lib/` (except `main.dart`) were generated by the plugin. 11 | 12 | The file demonstrates responsive layout with images, text, shadows, background blurs, gradients, vector art, components, repeat grids, stacks, padding, background elements, and prototype links. 13 | 14 | ## Fonts 15 | Note that the font entries in the yaml are incomplete, and will generate warnings. This is to avoid distributing font files with this example. 16 | 17 | ## Images 18 | The exported images may differ slightly (in size and dimensions). To avoid bloating the repo size, they are not committed unless there is a substantial change. -------------------------------------------------------------------------------- /adobe_xd/example/lib/xd_text_styles.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class XDTextStyles { 4 | static const TextStyle title = const TextStyle( 5 | fontFamily: 'Helvetica', 6 | fontSize: 30, 7 | color: const Color(0xffffffff), 8 | fontWeight: FontWeight.w700, 9 | ); 10 | static const TextStyle body = const TextStyle( 11 | fontFamily: 'Georgia', 12 | fontSize: 16, 13 | color: const Color(0xff333333), 14 | ); 15 | static const TextStyle value = const TextStyle( 16 | fontFamily: 'Helvetica', 17 | fontSize: 20, 18 | color: const Color(0xff00a9de), 19 | ); 20 | static const TextStyle label = const TextStyle( 21 | fontFamily: 'Helvetica', 22 | fontSize: 11, 23 | color: const Color(0xffa2a2a2), 24 | letterSpacing: 0.22, 25 | ); 26 | static const TextStyle strong = const TextStyle( 27 | fontFamily: 'Helvetica', 28 | fontSize: 16, 29 | color: const Color(0xfffbf7ff), 30 | letterSpacing: 0.64, 31 | fontWeight: FontWeight.w700, 32 | ); 33 | } 34 | -------------------------------------------------------------------------------- /adobe_xd/example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /src/core/decorators/abstractdecorator.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | // Decorates an AbstractNode, typically by wrapping the widget. 13 | class AbstractDecorator { 14 | // AbstractDecorators should also have a static `create(node, ctx)` method 15 | // that returns an instance if appropriate. 16 | 17 | constructor(node, ctx, cosmetic=false) { 18 | this.node = node; 19 | this.cosmetic = cosmetic; 20 | } 21 | 22 | get xdNode() { 23 | return this.node && this.node.xdNode; 24 | } 25 | 26 | serialize(nodeStr, ctx) { 27 | return this._serialize(nodeStr, ctx); 28 | } 29 | 30 | _serialize(nodeStr, ctx) { 31 | return nodeStr; 32 | } 33 | } 34 | exports.AbstractDecorator = AbstractDecorator; 35 | -------------------------------------------------------------------------------- /test_suite/lib/xd_transition_target.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import './xd_btn.dart'; 3 | import 'package:adobe_xd/page_link.dart'; 4 | 5 | class XDTransitionTarget extends StatelessWidget { 6 | XDTransitionTarget({ 7 | Key? key, 8 | }) : super(key: key); 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | backgroundColor: const Color(0xff008d00), 13 | body: Stack( 14 | children: [ 15 | Center( 16 | child: SizedBox( 17 | width: 128.0, 18 | height: 32.0, 19 | child: 20 | // Adobe XD layer: 'Btn' (component) 21 | PageLink( 22 | links: [ 23 | PageLinkInfo(), 24 | ], 25 | child: XDBtn( 26 | label: 'Go Back', 27 | labelColor: const Color(0xff008d00), 28 | ), 29 | ), 30 | ), 31 | ), 32 | ], 33 | ), 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/core/decorators/comment.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | const $ = require("../../utils/utils"); 13 | const { AbstractDecorator } = require("./abstractdecorator"); 14 | const nodetype = require("../nodetype"); 15 | 16 | class Comment extends AbstractDecorator { 17 | static create(node, ctx) { 18 | if (Comment.enabled && !node.xdNode.hasDefaultName) { 19 | return new Comment(node, ctx, true); 20 | } 21 | } 22 | 23 | _serialize(nodeStr, ctx) { 24 | let xdNode = this.node.xdNode; 25 | let name = $.shorten(xdNode.name, 20), type = nodetype.getXDLabel(xdNode); 26 | return `\n // Adobe XD layer: '${name}' (${type})\n${nodeStr}`; 27 | } 28 | } 29 | Comment.enabled = true; 30 | 31 | exports.Comment = Comment; -------------------------------------------------------------------------------- /adobe_xd/example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /test_suite/lib/xd_component163.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class XDComponent163 extends StatelessWidget { 4 | XDComponent163({ 5 | Key? key, 6 | }) : super(key: key); 7 | @override 8 | Widget build(BuildContext context) { 9 | return Stack( 10 | children: [ 11 | Container( 12 | width: 32.0, 13 | height: 32.0, 14 | decoration: BoxDecoration( 15 | color: const Color(0xff008d00), 16 | borderRadius: BorderRadius.circular(8.0), 17 | ), 18 | ), 19 | Transform.translate( 20 | offset: Offset(0.0, 5.0), 21 | child: SizedBox( 22 | width: 32.0, 23 | height: 22.0, 24 | child: Text( 25 | 'Hi!', 26 | style: TextStyle( 27 | fontFamily: 'Arial', 28 | fontSize: 18, 29 | color: const Color(0xffffffff), 30 | fontWeight: FontWeight.w700, 31 | ), 32 | textAlign: TextAlign.center, 33 | ), 34 | ), 35 | ), 36 | ], 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/core/decorators/ontap.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | const { AbstractDecorator } = require("./abstractdecorator"); 13 | const { Group } = require("../nodes/group"); 14 | 15 | class OnTap extends AbstractDecorator { 16 | static create(node, ctx) { 17 | if (!(node instanceof Group)) { return; } 18 | if (node.getParam("onTap")) { 19 | return new OnTap(node, ctx); 20 | } 21 | } 22 | 23 | _serialize(nodeStr, ctx) { 24 | return OnTap.get(nodeStr, this.node.getParam("onTap").name); 25 | } 26 | } 27 | exports.OnTap = OnTap; 28 | 29 | OnTap.get = function(nodeStr, onTap) { 30 | // This is also used by Component._serialize() 31 | if (!nodeStr || !onTap) { return nodeStr; } 32 | return 'GestureDetector(' + 33 | `onTap: ()=> ${onTap}?.call(), ` + 34 | `child: ${nodeStr}, ` + 35 | ')'; 36 | } -------------------------------------------------------------------------------- /test_suite/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:test_suite/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /adobe_xd/example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /test_suite/macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2020 Adobe Inc. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /adobe_xd/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2020 Adobe Inc. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /adobe_xd/example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | example 18 | 19 | 20 | 21 | 24 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/version.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | 13 | const app = require("application"); 14 | const { alert } = require("./ui/alert"); 15 | 16 | // Update for new builds: 17 | exports.version = "4.0.0"; 18 | exports.debug = false; 19 | exports.xdVersionRequired = 42; // the actual minimum XD version required to run the plugin. 20 | 21 | // Calculated: 22 | exports.xdVersion = parseInt(app.version); 23 | exports.xdVersionOk = (exports.xdVersion >= exports.xdVersionRequired); 24 | exports.label = exports.debug ? 'DEBUG' : 'Release'; 25 | 26 | // Methods: 27 | function checkXDVersion() { 28 | if (exports.xdVersionOk) { return true; } 29 | alert( 30 | `XD to Flutter plugin (v${exports.version}) requires Adobe XD version ` + 31 | `${exports.xdVersionRequired} or higher.` + 32 | `

Current version is ${app.version}. Please upgrade.` 33 | ); 34 | return false; 35 | } 36 | exports.checkXDVersion = checkXDVersion; -------------------------------------------------------------------------------- /test_suite/lib/xd_nested_component.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import './xd_component171.dart'; 3 | import 'package:adobe_xd/pinned.dart'; 4 | import './xd_component163.dart'; 5 | 6 | class XDNestedComponent extends StatelessWidget { 7 | XDNestedComponent({ 8 | Key? key, 9 | }) : super(key: key); 10 | @override 11 | Widget build(BuildContext context) { 12 | return Stack( 13 | children: [ 14 | Padding( 15 | padding: EdgeInsets.fromLTRB(0.0, 0.0, 32.0, 0.0), 16 | child: XDComponent171( 17 | icon: const AssetImage('assets/images/one.png'), 18 | label: 'One', 19 | labelColor: const Color(0xff000000), 20 | ), 21 | ), 22 | Pinned.fromPins( 23 | Pin(size: 32.0, end: 0.0), 24 | Pin(start: 0.0, end: 0.0), 25 | child: XDComponent163(), 26 | ), 27 | Align( 28 | alignment: Alignment.topLeft, 29 | child: Container( 30 | width: 104.0, 31 | height: 32.0, 32 | decoration: BoxDecoration( 33 | border: Border.all(width: 2.0, color: const Color(0xff707070)), 34 | ), 35 | ), 36 | ), 37 | ], 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /test_suite/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:test_suite/xd_home.dart'; 3 | 4 | void main() { 5 | runApp(MyApp()); 6 | } 7 | 8 | class MyApp extends StatelessWidget { 9 | // This widget is the root of your application. 10 | @override 11 | Widget build(BuildContext context) { 12 | return MaterialApp( 13 | title: 'Flutter Demo', 14 | theme: ThemeData( 15 | // This is the theme of your application. 16 | // 17 | // Try running your application with "flutter run". You'll see the 18 | // application has a blue toolbar. Then, without quitting the app, try 19 | // changing the primarySwatch below to Colors.green and then invoke 20 | // "hot reload" (press "r" in the console where you ran "flutter run", 21 | // or simply save your changes to "hot reload" in a Flutter IDE). 22 | // Notice that the counter didn't reset back to zero; the application 23 | // is not restarted. 24 | primarySwatch: Colors.blue, 25 | // This makes the visual density adapt to the platform that you run 26 | // the app on. For desktop platforms, the controls will be smaller and 27 | // closer together (more dense) than on mobile platforms. 28 | visualDensity: VisualDensity.adaptivePlatformDensity, 29 | ), 30 | home: XDHome(), 31 | ); 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /test_suite/lib/xd_nav_row.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:adobe_xd/pinned.dart'; 3 | 4 | class XDNavRow extends StatelessWidget { 5 | final String label; 6 | XDNavRow({ 7 | Key? key, 8 | this.label = 'label', 9 | }) : super(key: key); 10 | @override 11 | Widget build(BuildContext context) { 12 | return Stack( 13 | children: [ 14 | // Adobe XD layer: 'bg' (shape) 15 | Container( 16 | decoration: BoxDecoration( 17 | color: const Color(0xffffffff), 18 | borderRadius: BorderRadius.circular(3.0), 19 | border: Border.all(width: 1.0, color: const Color(0xfff0f0f0)), 20 | boxShadow: [ 21 | BoxShadow( 22 | color: const Color(0x0f000000), 23 | offset: Offset(0, 1), 24 | blurRadius: 3, 25 | ), 26 | ], 27 | ), 28 | ), 29 | Pinned.fromPins( 30 | Pin(start: 16.0, end: 16.0), 31 | Pin(size: 18.0, middle: 0.5), 32 | child: 33 | // Adobe XD layer: 'label' (text) 34 | Text( 35 | label, 36 | style: TextStyle( 37 | fontFamily: 'Arial', 38 | fontSize: 14, 39 | color: const Color(0xff000000), 40 | fontWeight: FontWeight.w700, 41 | ), 42 | ), 43 | ), 44 | ], 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /deploy-script.js: -------------------------------------------------------------------------------- 1 | let isProduction = false; 2 | try { 3 | const config = JSON.parse(process.env.npm_config_argv); 4 | isProduction = config.original.includes("--production"); 5 | } catch (e) {} 6 | 7 | const fs = require("fs"); 8 | const path = require("path"); 9 | const promisify = require("util").promisify; 10 | const archiver = require("archiver"); 11 | const ncp = require("ncp").ncp; 12 | 13 | const copy = promisify(ncp); 14 | const read = promisify(fs.readFile); 15 | 16 | const libDir = "./src/lib/"; 17 | const buildDir = "./build/"; 18 | const pluginName = "flutter-plugin"; 19 | 20 | (async () => { 21 | // TODO: clear the buildDir for production builds 22 | await copy("./manifest.json", buildDir + "manifest.json"); 23 | await copy("./debug.json", buildDir + "debug.json"); 24 | await copy(libDir, buildDir + "lib/"); 25 | // generate zip 26 | if (isProduction) { 27 | // read version from manifest.json: 28 | let v = "X_X_X"; 29 | try { 30 | let data = JSON.parse(await read("./manifest.json")); 31 | v = data.version.replace(/\./g, "_"); 32 | } catch (e) {} 33 | 34 | const output = fs.createWriteStream(__dirname + "/XDtoFlutter_v" + v + ".xdx"); 35 | const archive = archiver("zip"); 36 | output.on("close", () => console.log(`Zip: ${archive.pointer()} total bytes`)); 37 | // pipe archive data to the file 38 | archive.pipe(output); 39 | archive.directory(buildDir, pluginName); 40 | archive.finalize(); 41 | } 42 | })(); 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /test_suite/lib/xd_btn.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:adobe_xd/pinned.dart'; 3 | 4 | class XDBtn extends StatelessWidget { 5 | final String label; 6 | final Color labelColor; 7 | XDBtn({ 8 | Key? key, 9 | this.label = 'label', 10 | this.labelColor = const Color(0xff000000), 11 | }) : super(key: key); 12 | @override 13 | Widget build(BuildContext context) { 14 | return Stack( 15 | children: [ 16 | // Adobe XD layer: 'bg' (shape) 17 | Container( 18 | decoration: BoxDecoration( 19 | color: const Color(0xffffffff), 20 | borderRadius: BorderRadius.circular(3.0), 21 | border: Border.all(width: 1.0, color: const Color(0xfff0f0f0)), 22 | boxShadow: [ 23 | BoxShadow( 24 | color: const Color(0x0f000000), 25 | offset: Offset(0, 1), 26 | blurRadius: 3, 27 | ), 28 | ], 29 | ), 30 | ), 31 | Pinned.fromPins( 32 | Pin(start: 16.0, end: 16.0), 33 | Pin(size: 18.0, middle: 0.5), 34 | child: 35 | // Adobe XD layer: 'label' (text) 36 | Text( 37 | label, 38 | style: TextStyle( 39 | fontFamily: 'Arial', 40 | fontSize: 14, 41 | color: labelColor, 42 | ), 43 | textAlign: TextAlign.center, 44 | ), 45 | ), 46 | ], 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | **PLEASE READ THIS** 12 | 13 | We are committed to trying to solve issues, but we need your help. Please provide a concise, descriptive title, and take a few minutes to fill out the information below. In particular, a sample file demonstrating the issue helps us isolate and fix it. 14 | 15 | Thanks! You can delete this section now. 16 | 17 | 18 | 19 | --- 20 | 21 | 22 | 23 | ## Bug Description 24 | 25 | A clear and concise description of what the bug is. Does it happen with a specific file, artboard, or element? Can it be reproduced with a simpler case? Issues with descriptions such as "Can't export my file" don't provide us any information to work from, and will be closed. 26 | 27 | ## To Reproduce 28 | 29 | Specific steps to reproduce the behavior. 30 | 31 | ## Sample XD File or Screenshots 32 | 33 | If possible, add a link to an XD file that demonstrates the problem in the simplest way possible (ie. isolate just the artboard and layer that is causing the problem). If applicable, add screenshots to help explain your problem. 34 | 35 | ## Console Output 36 | 37 | Open the Developer Console in menu > plugins > developer, and provide any errors that are generated as part of the issue. 38 | 39 | ## Versions: 40 | 41 | - OS: [e.g. MacOS 10.15.1] 42 | - XD: [e.g. 29] 43 | - plugin: [e.g. 1.0.0] (near the bottom of the panel) 44 | - Flutter: [e.g. stable 1.20.0] 45 | -------------------------------------------------------------------------------- /test_suite/lib/xd_blank.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import './xd_page_size.dart'; 3 | import 'package:adobe_xd/pinned.dart'; 4 | import './xd_title_bar.dart'; 5 | 6 | class XDBlank extends StatelessWidget { 7 | XDBlank({ 8 | Key? key, 9 | }) : super(key: key); 10 | @override 11 | Widget build(BuildContext context) { 12 | return Scaffold( 13 | backgroundColor: const Color(0xfff3f3f3), 14 | body: Stack( 15 | children: [ 16 | SizedBox( 17 | width: 960.0, 18 | height: 720.0, 19 | child: 20 | // Adobe XD layer: 'PageSize' (component) 21 | XDPageSize(), 22 | ), 23 | Pinned.fromPins( 24 | Pin(start: 0.0, end: 0.0), 25 | Pin(size: 48.0, start: 0.0), 26 | child: 27 | // Adobe XD layer: 'TitleBar' (component) 28 | XDTitleBar( 29 | title: 'Blank (for adhoc tests)', 30 | ), 31 | ), 32 | Pinned.fromPins( 33 | Pin(start: 254.0, end: 20.0), 34 | Pin(size: 21.0, start: 15.0), 35 | child: Text( 36 | 'This artboard is just a handy place to quickly sketch new tests, or isolate existing ones.', 37 | style: TextStyle( 38 | fontFamily: 'Arial', 39 | fontSize: 14, 40 | color: const Color(0xff000000), 41 | ), 42 | ), 43 | ), 44 | ], 45 | ), 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /test_suite/README.md: -------------------------------------------------------------------------------- 1 | # XD to Flutter Test Suite 2 | 3 | The `test_suites.xd` file comprises a _reasonably_ comprehensive collection of tests for most features of the XD to Flutter plugin. It includes working features (in green), unsupported features/scenarios (in red), and known issues (in yellow, with an issue number per the GitHub repo). It also identifies when warnings are generated (black warning icon), or should be but aren't (yellow warning icon). 4 | 5 | ## Use and Maintenance 6 | The test suite should be updated to cover new scenarios whenever changes are made to the plugin. It should also be run and the output verified prior to committing any updates or publishing a new plugin. 7 | 8 | Always ensure the XD plugin debug console is open when testing against the plugin. The UXP Developer Tool does not capture console outputs, so it is very important to verify that the export completed successfully. Otherwise, export may fail silently, but the prior exported code will be left, which may mislead you to believe everything ran successfully. 9 | 10 | ### Verifying code 11 | In addition to visual verificiation, some tests, such as layout simplification and shape collapsing, should have the generated code verified, especially if changes have been made that would impact them. 12 | 13 | ## Errors in output 14 | The "dupe params of diff types" Component test will output a `xd_dupe_params_diff_type.dart` file that has errors. It will also generate an error in the panel. This is expected, and you can either delete that file to remove the errors, or it should run fine if you "ignore build errors". -------------------------------------------------------------------------------- /test_suite/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /test_suite/lib/xd_test_group.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:adobe_xd/pinned.dart'; 3 | 4 | class XDTestGroup extends StatelessWidget { 5 | final String title; 6 | XDTestGroup({ 7 | Key? key, 8 | this.title = 'title', 9 | }) : super(key: key); 10 | @override 11 | Widget build(BuildContext context) { 12 | return Stack( 13 | children: [ 14 | // Adobe XD layer: 'bg' (shape) 15 | Container( 16 | decoration: BoxDecoration( 17 | color: const Color(0xfff9f9f9), 18 | boxShadow: [ 19 | BoxShadow( 20 | color: const Color(0x1a000000), 21 | offset: Offset(0, 3), 22 | blurRadius: 6, 23 | ), 24 | ], 25 | ), 26 | ), 27 | Pinned.fromPins( 28 | Pin(start: 0.0, end: 0.0), 29 | Pin(size: 32.0, start: 0.0), 30 | child: 31 | // Adobe XD layer: 'headerbg' (shape) 32 | Container( 33 | color: const Color(0xffe9e9e9), 34 | ), 35 | ), 36 | Pinned.fromPins( 37 | Pin(start: 12.0, end: 20.0), 38 | Pin(size: 17.0, start: 7.0), 39 | child: Text( 40 | title, 41 | style: TextStyle( 42 | fontFamily: 'Arial', 43 | fontSize: 14, 44 | color: const Color(0xff666666), 45 | fontWeight: FontWeight.w700, 46 | ), 47 | ), 48 | ), 49 | ], 50 | ); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /test_suite/lib/xd_dupe_params_same_type.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:adobe_xd/pinned.dart'; 3 | 4 | class XDDupeParamsSameType extends StatelessWidget { 5 | final String label; 6 | final Color labelColor; 7 | XDDupeParamsSameType({ 8 | Key? key, 9 | this.label = 'Two', 10 | this.labelColor = const Color(0xff000000), 11 | }) : super(key: key); 12 | @override 13 | Widget build(BuildContext context) { 14 | return Stack( 15 | children: [ 16 | Container( 17 | decoration: BoxDecoration( 18 | color: const Color(0xffffffff), 19 | border: Border.all(width: 1.0, color: const Color(0xff707070)), 20 | ), 21 | ), 22 | Pinned.fromPins( 23 | Pin(end: 50.0, startFraction: 0.0851), 24 | Pin(size: 18.0, middle: 0.5714), 25 | child: Text( 26 | label, 27 | style: TextStyle( 28 | fontFamily: 'Arial', 29 | fontSize: 14, 30 | color: labelColor, 31 | fontWeight: FontWeight.w700, 32 | ), 33 | ), 34 | ), 35 | Pinned.fromPins( 36 | Pin(end: 6.0, startFraction: 0.5532), 37 | Pin(size: 18.0, middle: 0.5714), 38 | child: Text( 39 | label, 40 | style: TextStyle( 41 | fontFamily: 'Arial', 42 | fontSize: 14, 43 | color: labelColor, 44 | fontWeight: FontWeight.w700, 45 | ), 46 | ), 47 | ), 48 | ], 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /test_suite/lib/xd_component181.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:adobe_xd/pinned.dart'; 3 | 4 | class XDComponent181 extends StatelessWidget { 5 | XDComponent181({ 6 | Key? key, 7 | }) : super(key: key); 8 | @override 9 | Widget build(BuildContext context) { 10 | return Stack( 11 | children: [ 12 | Container( 13 | decoration: BoxDecoration( 14 | color: const Color(0xffffffff), 15 | border: Border.all(width: 1.0, color: const Color(0xff707070)), 16 | ), 17 | ), 18 | Pinned.fromPins( 19 | Pin(start: 4.0, endFraction: 0.6111), 20 | Pin(start: 4.0, end: 4.0), 21 | child: 22 | // Adobe XD layer: 'one' (shape) 23 | Container( 24 | decoration: BoxDecoration( 25 | image: DecorationImage( 26 | image: const AssetImage('assets/images/one.png'), 27 | fit: BoxFit.cover, 28 | ), 29 | border: Border.all(width: 1.0, color: const Color(0xff707070)), 30 | ), 31 | ), 32 | ), 33 | Pinned.fromPins( 34 | Pin(end: 4.0, startFraction: 0.4444), 35 | Pin(size: 18.0, middle: 0.5), 36 | child: Text( 37 | 'One', 38 | style: TextStyle( 39 | fontFamily: 'Arial', 40 | fontSize: 14, 41 | color: const Color(0xff000000), 42 | fontWeight: FontWeight.w700, 43 | ), 44 | ), 45 | ), 46 | ], 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/core/constants.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | 13 | const PropType = require("../core/proptype"); 14 | 15 | // a collection of miscellaneous constants that don't warrant their own files. 16 | let ExportMode = Object.freeze({ 17 | INLINE: "inline", 18 | METHOD: "method", 19 | BUILDER: "builder", 20 | CUSTOM: "custom" 21 | }); 22 | exports.ExportMode = ExportMode; 23 | 24 | exports.ExportModeOptions = [ 25 | {id: ExportMode.INLINE, label: "Export as inline code (default)"}, 26 | {id: ExportMode.METHOD, label: "Export as build method"}, 27 | {id: ExportMode.BUILDER, label: "Replace with builder param"}, 28 | {id: ExportMode.CUSTOM, label: "Replace with custom code"}, 29 | ]; 30 | 31 | exports.DEFAULT_CUSTOM_CODE = "Text('Hello World')"; 32 | exports.DEFAULT_CLASS_PREFIX = "XD"; 33 | exports.DEFAULT_COLORS_CLASS_NAME = "XDColors"; 34 | exports.DEFAULT_CHAR_STYLES_CLASS_NAME = "XDTextStyles"; 35 | exports.HELP_URL = "https://github.com/AdobeXD/xd-to-flutter-plugin/blob/master/README.md"; 36 | exports.REQUIRED_PARAM = {_:"required param"}; 37 | 38 | exports.DEFAULT_PLUGIN_DATA = { 39 | [PropType.WIDGET_PREFIX]: exports.DEFAULT_CLASS_PREFIX, 40 | [PropType.ENABLE_PROTOTYPE]: true, 41 | [PropType.NORMALIZE_NAME_CASE]: true, 42 | [PropType.INCLUDE_NAME_COMMENTS]: true, 43 | }; 44 | -------------------------------------------------------------------------------- /test_suite/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /test_suite/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | test_suite 30 | 31 | 32 | 33 | 36 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/core/proptype.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | module.exports = Object.freeze({ 13 | // Project 14 | EXPORT_PATH: "exportPath", 15 | CODE_PATH: "codePath", 16 | IMAGE_PATH: "imagePath", 17 | WIDGET_PREFIX: "widgetPrefix", 18 | ENABLE_PROTOTYPE: "enablePrototype", 19 | RESOLUTION_AWARE: "resolutionAware", 20 | NULL_SAFE: "nullSafe", 21 | INCLUDE_NAME_COMMENTS: "includeNameComments", 22 | NORMALIZE_NAME_CASE: "normalizeNameCase", 23 | EXPORT_COLORS: "exportColors", 24 | COLORS_CLASS_NAME: "colorsClassName", 25 | EXPORT_CHAR_STYLES: "exportCharStyles", 26 | CHAR_STYLES_CLASS_NAME: "charStylesClassName", 27 | 28 | // Component / Artboard 29 | INCLUDE_IN_EXPORT_PROJECT: "addToExportAll", 30 | WIDGET_NAME: "widgetName", 31 | TAP_CALLBACK_NAME: "tapCallbackName", 32 | 33 | // Text 34 | FLUTTER_FONT: "flutterFont", 35 | TEXT_PARAM_NAME: "textParamName", 36 | COLOR_PARAM_NAME: "colorParamName", 37 | 38 | // Shapes 39 | IMAGE_FILL_NAME: "imageFillName", 40 | IMAGE_PARAM_NAME: "imageParamName", 41 | INCLUDE_IN_EXPORT_ALL_IMAGES: "includeInExportAllImages", 42 | 43 | // Groups 44 | COMBINE_SHAPES: "combineShapes", 45 | EXPORT_MODE: "exportMode", 46 | BUILD_METHOD_NAME: "buildMethodName", 47 | CUSTOM_CODE: "customCode", 48 | 49 | // Grid 50 | DATA_PARAM_NAME: "dataParamName", 51 | 52 | // Shared 53 | FLATTEN_TO_IMAGE: "flattenToImage", 54 | }); 55 | 56 | -------------------------------------------------------------------------------- /src/core/nodes/artboard.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | const xd = require("scenegraph"); 13 | 14 | const { AbstractWidget } = require("./abstractwidget"); 15 | const { getColor } = require("../../utils/exportutils"); 16 | 17 | class Artboard extends AbstractWidget { 18 | static create(xdNode, ctx) { throw("Artboard.create() called."); } 19 | 20 | get symbolId() { 21 | return this.xdNode.guid; 22 | } 23 | 24 | _serialize(ctx) { 25 | return `${this.widgetName}(${this._getParamList(ctx)})`; 26 | } 27 | 28 | get adjustedBounds() { 29 | // we don't want the artboard's position in the document. 30 | let xdNode = this.xdNode; 31 | return {x: 0, y: 0, width: xdNode.width, height: xdNode.height}; 32 | } 33 | 34 | _serializeWidgetBody(ctx) { 35 | return `Scaffold(${this._getBackgroundColorParam(ctx)}body: ${this._getChildStack(this.children, ctx)}, )`; 36 | } 37 | 38 | _getBackgroundColorParam(ctx) { 39 | let xdNode = this.xdNode, fill = xdNode.fillEnabled && xdNode.fill, color; 40 | if (fill instanceof xd.Color) { color = fill; } 41 | else if (fill) { 42 | ctx.log.warn("Only solid color backgrounds are supported for artboards.", xdNode); 43 | let stops = fill.colorStops; 44 | if (stops && stops.length > 0) { color = stops[0].color; } 45 | } 46 | return color ? `backgroundColor: ${getColor(color)}, ` : ""; 47 | } 48 | } 49 | 50 | exports.Artboard = Artboard; 51 | -------------------------------------------------------------------------------- /test_suite/lib/xd_component171.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:adobe_xd/pinned.dart'; 3 | 4 | class XDComponent171 extends StatelessWidget { 5 | final ImageProvider icon; 6 | final String label; 7 | final Color labelColor; 8 | XDComponent171({ 9 | Key? key, 10 | this.icon = const AssetImage('assets/images/one.png'), 11 | this.label = 'One', 12 | this.labelColor = const Color(0xff000000), 13 | }) : super(key: key); 14 | @override 15 | Widget build(BuildContext context) { 16 | return Stack( 17 | children: [ 18 | Container( 19 | decoration: BoxDecoration( 20 | color: const Color(0xffffffff), 21 | border: Border.all(width: 1.0, color: const Color(0xff707070)), 22 | ), 23 | ), 24 | Pinned.fromPins( 25 | Pin(start: 4.0, endFraction: 0.6111), 26 | Pin(start: 4.0, end: 4.0), 27 | child: 28 | // Adobe XD layer: 'one' (shape) 29 | Container( 30 | decoration: BoxDecoration( 31 | image: DecorationImage( 32 | image: icon, 33 | fit: BoxFit.cover, 34 | ), 35 | border: Border.all(width: 1.0, color: const Color(0xff707070)), 36 | ), 37 | ), 38 | ), 39 | Pinned.fromPins( 40 | Pin(end: 4.0, startFraction: 0.4444), 41 | Pin(size: 18.0, middle: 0.5), 42 | child: Text( 43 | label, 44 | style: TextStyle( 45 | fontFamily: 'Arial', 46 | fontSize: 14, 47 | color: labelColor, 48 | fontWeight: FontWeight.w700, 49 | ), 50 | ), 51 | ), 52 | ], 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /test_suite/lib/xd_on_tap_component.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class XDOnTapComponent extends StatelessWidget { 4 | final VoidCallback? onTestTapComponent; 5 | final String label; 6 | final Color labelColor; 7 | XDOnTapComponent({ 8 | Key? key, 9 | this.onTestTapComponent, 10 | this.label = 'onTap Comp', 11 | this.labelColor = const Color(0xff008d00), 12 | }) : super(key: key); 13 | @override 14 | Widget build(BuildContext context) { 15 | return GestureDetector( 16 | onTap: () => onTestTapComponent?.call(), 17 | child: Stack( 18 | children: [ 19 | // Adobe XD layer: 'bg' (shape) 20 | Container( 21 | decoration: BoxDecoration( 22 | color: const Color(0xffffffff), 23 | borderRadius: BorderRadius.circular(3.0), 24 | border: Border.all(width: 1.0, color: const Color(0xfff0f0f0)), 25 | boxShadow: [ 26 | BoxShadow( 27 | color: const Color(0x0f000000), 28 | offset: Offset(0, 1), 29 | blurRadius: 3, 30 | ), 31 | ], 32 | ), 33 | ), 34 | Padding( 35 | padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 7.0), 36 | child: SizedBox.expand( 37 | child: 38 | // Adobe XD layer: 'label' (text) 39 | Text( 40 | label, 41 | style: TextStyle( 42 | fontFamily: 'Arial', 43 | fontSize: 14, 44 | color: labelColor, 45 | ), 46 | textAlign: TextAlign.center, 47 | )), 48 | ), 49 | ], 50 | ), 51 | ); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /test_suite/lib/xd_component261.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_svg/flutter_svg.dart'; 3 | 4 | class XDComponent261 extends StatelessWidget { 5 | XDComponent261({ 6 | Key? key, 7 | }) : super(key: key); 8 | @override 9 | Widget build(BuildContext context) { 10 | return Stack( 11 | children: [ 12 | SizedBox.expand( 13 | child: SvgPicture.string( 14 | _svg_i1ki, 15 | allowDrawingOutsideViewBox: true, 16 | fit: BoxFit.fill, 17 | )), 18 | ], 19 | ); 20 | } 21 | } 22 | 23 | const String _svg_i1ki = 24 | ''; 25 | -------------------------------------------------------------------------------- /adobe_xd/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | build/ 32 | 33 | # Android related 34 | **/android/**/gradle-wrapper.jar 35 | **/android/.gradle 36 | **/android/captures/ 37 | **/android/gradlew 38 | **/android/gradlew.bat 39 | **/android/local.properties 40 | **/android/**/GeneratedPluginRegistrant.java 41 | 42 | # iOS/XCode related 43 | **/ios/**/*.mode1v3 44 | **/ios/**/*.mode2v3 45 | **/ios/**/*.moved-aside 46 | **/ios/**/*.pbxuser 47 | **/ios/**/*.perspectivev3 48 | **/ios/**/*sync/ 49 | **/ios/**/.sconsign.dblite 50 | **/ios/**/.tags* 51 | **/ios/**/.vagrant/ 52 | **/ios/**/DerivedData/ 53 | **/ios/**/Icon? 54 | **/ios/**/Pods/ 55 | **/ios/**/.symlinks/ 56 | **/ios/**/profile 57 | **/ios/**/xcuserdata 58 | **/ios/.generated/ 59 | **/ios/Flutter/App.framework 60 | **/ios/Flutter/Flutter.framework 61 | **/ios/Flutter/Flutter.podspec 62 | **/ios/Flutter/Generated.xcconfig 63 | **/ios/Flutter/app.flx 64 | **/ios/Flutter/app.zip 65 | **/ios/Flutter/flutter_assets/ 66 | **/ios/Flutter/flutter_export_environment.sh 67 | **/ios/ServiceDefinitions.json 68 | **/ios/Runner/GeneratedPluginRegistrant.* 69 | 70 | # Exceptions to above rules. 71 | !**/ios/**/default.mode1v3 72 | !**/ios/**/default.mode2v3 73 | !**/ios/**/default.pbxuser 74 | !**/ios/**/default.perspectivev3 75 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 76 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Description 4 | 5 | 6 | 7 | ## Related Issue 8 | 9 | 10 | 11 | 12 | 13 | 14 | ## Motivation and Context 15 | 16 | 17 | 18 | ## How Has This Been Tested? 19 | 20 | 21 | 22 | 23 | 24 | ## Screenshots (if appropriate): 25 | 26 | ## Types of changes 27 | 28 | 29 | 30 | - [ ] Bug fix (non-breaking change which fixes an issue) 31 | - [ ] New feature (non-breaking change which adds functionality) 32 | - [ ] Breaking change (fix or feature that would cause existing functionality to change) 33 | 34 | ## Checklist: 35 | 36 | 37 | 38 | 39 | - [ ] I have signed the [Adobe Open Source CLA](https://opensource.adobe.com/cla.html). 40 | - [ ] My code follows the code style of this project. 41 | - [ ] My change requires a change to the documentation. 42 | - [ ] I have updated the documentation accordingly. 43 | - [ ] I have read the **CONTRIBUTING** document. 44 | - [ ] I have added tests to cover my changes. 45 | - [ ] All new and existing tests passed. 46 | -------------------------------------------------------------------------------- /src/ui/preview.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | const { h, Component, Fragment } = require('preact'); 13 | const NodeType = require('../core/nodetype'); 14 | const render_preview = require('./render_preview'); 15 | const { trace } = require('../utils/debug'); 16 | 17 | 18 | class Preview extends Component { 19 | constructor(props) { 20 | super(props); 21 | this.state = { rendition: '' } 22 | } 23 | 24 | componentDidMount() { 25 | this.renderPreview(this.props.node); 26 | } 27 | 28 | shouldComponentUpdate(nextProps, nextState) { 29 | // render new preview only if the props changed: 30 | if (this.props !== nextProps) { this.renderPreview(nextProps.node); } 31 | return true; 32 | } 33 | 34 | async renderPreview(node) { 35 | try { 36 | this.setState({ rendition: await render_preview.getPreview(node) }); 37 | } catch (e) { 38 | trace('error rendering preview', e); 39 | } 40 | } 41 | 42 | render() { 43 | let isMultiple = !this.props.node; 44 | let noPreview = isMultiple || this.state.rendition === null; 45 | let label = isMultiple ? 'MULTIPLE' : NodeType.getXDLabel(this.props.node); 46 | return ( 47 |
48 |
49 | preview 50 |
PREVIEW NOT AVAILABLE
51 |
52 | SELECTION: {label.toUpperCase()} 53 | 54 |
55 | ); 56 | } 57 | } 58 | 59 | 60 | 61 | module.exports = Preview; -------------------------------------------------------------------------------- /src/core/decorators/blur.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | const xd = require("scenegraph"); 13 | 14 | const $ = require("../../utils/utils"); 15 | const { AbstractDecorator } = require("./abstractdecorator"); 16 | const { Container } = require("../nodes/container"); 17 | 18 | class Blur extends AbstractDecorator { 19 | static create(node, ctx) { 20 | let xdNode = node.xdNode, blur = xdNode.blur; 21 | if (blur && blur.visible) { 22 | if (!(node instanceof Container)) { 23 | ctx.log.warn("Blur is currently only supported on rectangles and ellipses.", xdNode); 24 | return; 25 | } 26 | if (!blur.isBackgroundEffect) { 27 | ctx.log.warn("Object blur is not supported.", xdNode); 28 | return; 29 | } 30 | if (blur.isBackgroundEffect && Math.round(xdNode.blur.brightnessAmount) !== 0) { 31 | ctx.log.warn("Brightness is currently not supported on blurs.", xdNode); 32 | } 33 | ctx.addImport("dart:ui", false, "ui"); 34 | return new Blur(node, ctx); 35 | } 36 | } 37 | 38 | _serialize(nodeStr, ctx) { 39 | let xdNode = this.node.xdNode, blur = xdNode.blur; 40 | let clipType = xdNode instanceof xd.Rectangle ? "ClipRect" : "ClipOval"; 41 | let filterParam = _getImageFilterParam(blur, ctx); 42 | return `${clipType}(child: BackdropFilter(${filterParam}child: ${nodeStr}, ), )`; 43 | } 44 | } 45 | exports.Blur = Blur; 46 | 47 | 48 | function _getImageFilterParam(blur, ctx) { 49 | // currently just exports blurs. 50 | return `filter: ${_getImageFilter(blur, ctx)}, `; 51 | } 52 | 53 | function _getImageFilter(blur, ctx) { 54 | let sigStr = $.fix(blur.blurAmount, 0); 55 | return `ui.ImageFilter.blur(sigmaX: ${sigStr}, sigmaY: ${sigStr})`; 56 | } -------------------------------------------------------------------------------- /adobe_xd/example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.example.example" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | } 54 | } 55 | } 56 | 57 | flutter { 58 | source '../..' 59 | } 60 | 61 | dependencies { 62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 63 | } 64 | -------------------------------------------------------------------------------- /test_suite/lib/xd_component251.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_svg/flutter_svg.dart'; 3 | 4 | class XDComponent251 extends StatelessWidget { 5 | XDComponent251({ 6 | Key? key, 7 | }) : super(key: key); 8 | @override 9 | Widget build(BuildContext context) { 10 | return Stack( 11 | children: [ 12 | SizedBox( 13 | width: 24.0, 14 | height: 24.0, 15 | child: Stack( 16 | children: [ 17 | SizedBox.expand( 18 | child: SvgPicture.string( 19 | _svg_lmakmz, 20 | allowDrawingOutsideViewBox: true, 21 | fit: BoxFit.fill, 22 | )), 23 | ], 24 | ), 25 | ), 26 | ], 27 | ); 28 | } 29 | } 30 | 31 | const String _svg_lmakmz = 32 | ''; 33 | -------------------------------------------------------------------------------- /src/core/nodes/component.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | const NodeUtils = require("../../utils/nodeutils"); 13 | const { DartType } = require("../../utils/exportutils"); 14 | 15 | const { AbstractWidget } = require("./abstractwidget"); 16 | const PropType = require("../proptype"); 17 | const { ContextTarget } = require("../context"); 18 | const { OnTap } = require("../decorators/ontap"); 19 | const { Parameter } = require("../parameter"); 20 | 21 | class Component extends AbstractWidget { 22 | static create(xdNode, ctx) { throw("Component.create() called."); } 23 | 24 | constructor(xdNode, ctx) { 25 | super(xdNode, ctx); 26 | 27 | let tapCB = NodeUtils.getProp(this.xdNode, PropType.TAP_CALLBACK_NAME); 28 | if (tapCB) { this.addChildParam(new Parameter(tapCB, DartType.TAP_CB), ctx); } 29 | } 30 | 31 | get isMaster() { 32 | return this.xdNode.isMaster; 33 | } 34 | 35 | _serialize(ctx) { 36 | let master = ctx.masterComponents[this.symbolId]; 37 | if (!master) { 38 | ctx.log.error('Master component could not be found.', this.xdNode); 39 | return "Container()"; 40 | } 41 | if (ctx.target === ContextTarget.CLIPBOARD) { 42 | ctx.log.warn(`Component widget ${master.widgetName} not exported during copy to clipboard operation.`, null); 43 | } 44 | let str = `${master.widgetName}(${this._getParamList(ctx)})`; 45 | return this._decorate(str, ctx); 46 | } 47 | 48 | _serializeWidgetBody(ctx) { 49 | let str = this._getChildStack(this.children, ctx); 50 | // for Component, onTap is not handled by the decorator, because it isn't instance based: 51 | return OnTap.get(str, NodeUtils.getProp(this.xdNode, PropType.TAP_CALLBACK_NAME)); 52 | } 53 | } 54 | 55 | exports.Component = Component; 56 | -------------------------------------------------------------------------------- /adobe_xd/lib/gradient_xd_transform.dart: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | import 'package:flutter/material.dart'; 13 | 14 | /// Attempts to match Adobe XD gradient transformations within Flutter. 15 | @immutable 16 | class GradientXDTransform extends GradientTransform { 17 | const GradientXDTransform( 18 | this.a, this.b, this.c, this.d, this.e, this.f, this.center); 19 | 20 | final double a; 21 | final double b; 22 | final double c; 23 | final double d; 24 | final double e; 25 | final double f; 26 | final Alignment center; 27 | 28 | @override 29 | Matrix4? transform(Rect bounds, {TextDirection? textDirection}) { 30 | double w = bounds.width, h = bounds.height, m = w / h, mx = 1.0, my = 1.0; 31 | 32 | // Adjust for the aspect ratio of the widget: 33 | if (m > 1) { 34 | mx *= m; 35 | } else { 36 | my /= m; 37 | } 38 | 39 | // Convert from [-1 - +1] to [0 - 1], & find the pixel location of the gradient center: 40 | double cx = (center.x + 1.0) / 2.0, cy = (center.y + 1.0) / 2.0; 41 | Offset pt = Offset( 42 | bounds.left + bounds.width * cx, bounds.top + bounds.height * cy); 43 | 44 | Matrix4 transform = Matrix4( 45 | a * mx, b * my, 0.0, 0.0, // 46 | c * mx, d * my, 0.0, 0.0, // 47 | 0.0, 0.0, 1.0, 0.0, // 48 | 0.0, 0.0, 0.0, 1.0, 49 | ); 50 | 51 | // This offsets the draw position to account for the widget's position being 52 | // multiplied against the transformation: 53 | List loc = transform.applyToVector3Array([pt.dx, pt.dy, 0.0]); 54 | double dx = pt.dx - loc[0], dy = pt.dy - loc[1]; 55 | 56 | return Matrix4.identity() 57 | ..translate(dx, dy, 0.0) 58 | ..multiply(transform); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /adobe_xd/lib/blend_mask.dart: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | import 'dart:ui' as ui; 13 | import 'package:flutter/rendering.dart'; 14 | import 'package:flutter/widgets.dart'; 15 | 16 | /// Applies a BlendMode to its child. 17 | class BlendMask extends SingleChildRenderObjectWidget { 18 | final BlendMode blendMode; 19 | final double opacity; 20 | final ui.Rect? region; 21 | 22 | BlendMask( 23 | {required this.blendMode, 24 | this.opacity = 1.0, 25 | this.region, 26 | Key? key, 27 | required Widget child}) 28 | : super(key: key, child: child); 29 | 30 | @override 31 | RenderObject createRenderObject(context) { 32 | return RenderBlendMask(blendMode, opacity, region); 33 | } 34 | 35 | @override 36 | void updateRenderObject(BuildContext context, RenderBlendMask renderObject) { 37 | renderObject._blendMode = blendMode; 38 | renderObject._opacity = opacity; 39 | renderObject._region = region; 40 | } 41 | } 42 | 43 | class RenderBlendMask extends RenderProxyBox { 44 | BlendMode _blendMode; 45 | double _opacity; 46 | ui.Rect? _region; 47 | 48 | RenderBlendMask(BlendMode blendMode, double opacity, [ui.Rect? region]) 49 | : _blendMode = blendMode, 50 | _opacity = opacity, 51 | _region = region; 52 | 53 | @override 54 | void paint(context, offset) { 55 | // Create a new layer and specify the blend mode and opacity to composite it with: 56 | context.canvas.saveLayer( 57 | (_region != null ? _region : offset & size), 58 | Paint() 59 | ..blendMode = _blendMode 60 | ..color = Color.fromARGB((_opacity * 255).round(), 255, 255, 255)); 61 | 62 | super.paint(context, offset); 63 | 64 | // Composite the layer back into the canvas using the blendmode: 65 | context.canvas.restore(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/core/decorators/blend.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | const xd = require("scenegraph"); 13 | 14 | const $ = require("../../utils/utils"); 15 | const { AbstractDecorator } = require("./abstractdecorator"); 16 | 17 | class Blend extends AbstractDecorator { 18 | static create(node, ctx) { 19 | let xdNode = node.xdNode, blend = xdNode.blendMode; 20 | if (!blend || blend === "pass-through" || blend === "normal") { return; } 21 | if (!Blend.MODE_MAP[blend]) { 22 | ctx.log.warn(`Unsupported blend mode '${blend}'`, xdNode); 23 | return; 24 | } 25 | ctx.addImport("package:adobe_xd/blend_mask.dart", false); 26 | return new Blend(node, ctx); 27 | } 28 | 29 | _serialize(nodeStr, ctx) { 30 | let xdNode = this.node.xdNode, bounds = xdNode.boundsInParent; 31 | let mode = Blend.MODE_MAP[xdNode.blendMode], region = ""; 32 | 33 | if (xdNode instanceof xd.Group && this.node.layout.isFixedSize) { 34 | let lx = $.fix(bounds.x), ly = $.fix(bounds.y); 35 | let lw = $.fix(bounds.width), lh = $.fix(bounds.height); 36 | region = `region: Offset(${lx}, ${ly}) & Size(${lw}, ${lh}), `; 37 | } 38 | 39 | let str = "BlendMask(" + 40 | `blendMode: BlendMode.${mode || "src"}, ` + 41 | //`opacity: ${xdNode.opacity}, ` + 42 | region + 43 | `child: ${nodeStr}, ` + 44 | ")"; 45 | 46 | return str; 47 | } 48 | } 49 | exports.Blend = Blend; 50 | 51 | Blend.MODE_MAP = { 52 | "pass-through": "src", 53 | "normal": "srcOver", 54 | "darken": "darken", 55 | "multiply": "multiply", 56 | "color-burn": "colorBurn", 57 | "lighten": "lighten", 58 | "screen": "screen", 59 | "color-dodge": "colorDodge", 60 | "overlay": "overlay", 61 | "soft-light": "softLight", 62 | "hard-light": "hardLight", 63 | "difference": "difference", 64 | "exclusion": "exclusion", 65 | "hue": "hue", 66 | "saturation": "saturation", 67 | "color": "color", 68 | "luminosity": "luminosity", 69 | } 70 | 71 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thanks for choosing to contribute! 4 | 5 | The following are a set of guidelines to follow when contributing to this project. 6 | 7 | ## Code Of Conduct 8 | 9 | This project adheres to the Adobe [code of conduct](../CODE_OF_CONDUCT.md). By participating, 10 | you are expected to uphold this code. Please report unacceptable behavior to 11 | [Grp-opensourceoffice@adobe.com](mailto:Grp-opensourceoffice@adobe.com). 12 | 13 | ## Have A Question? 14 | 15 | Start by filing an issue. The existing committers on this project work to reach 16 | consensus around project direction and issue solutions within issue threads 17 | (when appropriate). 18 | 19 | ## Contributor License Agreement 20 | 21 | All third-party contributions to this project must be accompanied by a signed contributor 22 | license agreement. This gives Adobe permission to redistribute your contributions 23 | as part of the project. [Sign our CLA](https://opensource.adobe.com/cla.html). You 24 | only need to submit an Adobe CLA one time, so if you have submitted one previously, 25 | you are good to go! 26 | 27 | ## Code Reviews 28 | 29 | All submissions should come in the form of pull requests and need to be reviewed 30 | by project committers. Read [GitHub's pull request documentation](https://help.github.com/articles/about-pull-requests/) 31 | for more information on sending pull requests. 32 | 33 | Lastly, please follow the [pull request template](PULL_REQUEST_TEMPLATE.md) when 34 | submitting a pull request! 35 | 36 | ## From Contributor To Committer 37 | 38 | We love contributions from our community! If you'd like to go a step beyond contributor 39 | and become a committer with full write access and a say in the project, you must 40 | be invited to the project. The existing committers employ an internal nomination 41 | process that must reach lazy consensus (silence is approval) before invitations 42 | are issued. If you feel you are qualified and want to get more deeply involved, 43 | feel free to reach out to existing committers to have a conversation about that. 44 | 45 | ## Security Issues 46 | 47 | Security issues shouldn't be reported on this issue tracker. Instead, [file an issue to our security experts](https://helpx.adobe.com/security/alertus.html). 48 | -------------------------------------------------------------------------------- /adobe_xd/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 | 8 | ## [2.0.1] - 2022-01-25 9 | 10 | ### Changed 11 | - updated flutter_svg dependency version to improve compatibility 12 | 13 | ## [2.0.0+1] - 2021-04-26 14 | 15 | ### Changed 16 | - updated README & CHANGLOG 17 | - tweaks to code docs 18 | 19 | ## [2.0.0] - 2021-04-25 20 | 21 | ### Added 22 | - null safety support 23 | 24 | ## [1.1.0+1] - 2020-02-08 25 | 26 | ### Changed 27 | - updated homepage URL in pubspec.yaml 28 | 29 | ## [1.1.0] - 2020-02-08 30 | 31 | ### Changed 32 | - flutter_svg version dependency more flexible to support master / dev channels 33 | 34 | ## [1.0.0+1] - 2020-07-27 35 | 36 | ### Changed 37 | - flutter_svg version dependency more flexible 38 | 39 | ## [1.0.0] - 2020-07-23 40 | 41 | ### Added 42 | - Pinned layout widget 43 | 44 | ### Changed 45 | - n/a 46 | 47 | ### Removed 48 | - SpecificRectClip 49 | 50 | 51 | ## [0.1.4] - 2020-05-26 52 | 53 | ### Added 54 | - n/a 55 | 56 | ### Changed 57 | - update example & homepage urls in pubspec.yaml 58 | 59 | ### Removed 60 | - n/a 61 | 62 | 63 | ## [0.1.3] - 2020-05-13 64 | 65 | ### Added 66 | - n/a 67 | 68 | ### Changed 69 | - flutter format executed across select .dart files 70 | 71 | ### Removed 72 | - n/a 73 | 74 | ## [0.1.2] - 2020-05-13 75 | 76 | ### Added 77 | - docs and repo now public 78 | 79 | ### Changed 80 | - dartfmt executed across all .dart 81 | - added license headers 82 | 83 | ### Removed 84 | - n/a 85 | 86 | 87 | ## [0.1.1] - 2020-05-12 88 | 89 | ### Added 90 | 91 | - Released alongside the Early Access v0.1.0 plugin. 92 | - example folder 93 | 94 | ### Changed 95 | - extended package description 96 | 97 | ### Removed 98 | - n/a 99 | 100 | 101 | ## [0.1.0] - 2020-05-12 102 | 103 | ### Added 104 | - Released alongside the Early Access v0.1.0 plugin. 105 | 106 | ### Changed 107 | - n/a 108 | 109 | ### Removed 110 | - n/a -------------------------------------------------------------------------------- /src/core/nodetype.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | const xd = require("scenegraph"); 13 | 14 | function getType(xdNode) { 15 | if (xdNode instanceof xd.Text) { return exports.TEXT; } 16 | if (xdNode instanceof xd.Group || xdNode instanceof xd.ScrollableGroup) { return exports.GROUP; } 17 | if (xdNode instanceof xd.RepeatGrid) { return exports.GRID; } 18 | if (xdNode instanceof xd.SymbolInstance || xdNode instanceof xd.Artboard) { 19 | return exports.WIDGET; 20 | } 21 | if (xdNode instanceof xd.Path || xdNode instanceof xd.Polygon || 22 | xdNode instanceof xd.Rectangle || xdNode instanceof xd.Ellipse || 23 | xdNode instanceof xd.BooleanGroup || xdNode instanceof xd.Line) { 24 | return exports.SHAPE; 25 | } 26 | return exports.ROOT; 27 | } 28 | exports.getType = getType; 29 | 30 | function getXDLabel(xdNode) { 31 | if (xdNode == null) { return "none"; } 32 | // not necessarily the ideal location for this method, but it's good to maintain proximity to the other similar methods. 33 | if (xdNode instanceof xd.Text) { return "text"; } 34 | if (xdNode instanceof xd.Group || xdNode instanceof xd.ScrollableGroup) { return "group"; } 35 | if (xdNode instanceof xd.RepeatGrid) { return "grid"; } 36 | if (xdNode instanceof xd.SymbolInstance) { return "component"; } 37 | if (xdNode instanceof xd.Artboard) { return "artboard"; } 38 | if (xdNode instanceof xd.Path || xdNode instanceof xd.Polygon || 39 | xdNode instanceof xd.Rectangle || xdNode instanceof xd.Ellipse || 40 | xdNode instanceof xd.BooleanGroup || xdNode instanceof xd.Line) { 41 | return "shape"; 42 | } 43 | return "unknown element"; 44 | } 45 | exports.getXDLabel = getXDLabel; 46 | 47 | function getLabel(xdNode) { 48 | // this works fine for now. 49 | return getType(xdNode); 50 | } 51 | exports.getLabel = getLabel; 52 | 53 | exports.TEXT = "text"; 54 | exports.GROUP = "group"; 55 | exports.WIDGET = "widget"; 56 | exports.SHAPE = "shape"; 57 | exports.ROOT = "root"; 58 | exports.GRID = "grid"; 59 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /BUILDME.md: -------------------------------------------------------------------------------- 1 | # Build Process 2 | 3 | ## Initial set up 4 | * One time: Install nodejs (https://nodejs.org/en/download/) and yarn (npm i yarn -g) 5 | * Open terminal and navigate to the /xd-flutter-plugin-src folder 6 | * run `yarn` 7 | * run `yarn build`, plugin files will be copied into the `/build` folder 8 | * Install the Adobe UXP Developer Tool (UDT) via the Creative Cloud app 9 | * In UDT "Add (Existing) Plugin..." and select `/build/manifest.json` 10 | 11 | ## Development 12 | * Open terminal and navigate to the `/xd-to-flutter-plugin` folder 13 | * run `yarn build`, it will watch for changes and update the `/build` folder 14 | * In UDT select "Load" under the "Actions (...)" menu for XD to Flutter 15 | * select "Watch" in the actions menu - UDT will watch for changes in `/build`, and update the plugin in XD 16 | 17 | ## Notes 18 | * If you get errors about missing dependencies when building, you probably need to run `yarn` again 19 | * builds are run in watch mode by default, meaning webpack re-bundles on file save 20 | * add `--no-watch` to disable watch mode 21 | * changes to `manifest.json` will not trigger a build, rerun `yarn build`, then unload/load the plugin in UDT 22 | 23 | ## Production builds 24 | If you are creating production builds for publishing, there are a few other things to consider: 25 | * in version.js: set `debug` to true 26 | * re-export the example and test suite and test thoroughly, double checking console for issues 27 | * in version.js: update the `version`, `xdVersionRequired`, & set `debug` to false 28 | * re-export / test the example and test suite again (to ensure no issues related to disabling debug) 29 | * update the `version` in manifest.json, and ensure the README and CHANGELOG are up to date (incl. version) and committed. 30 | * clear the `build` folder and use `yarn build --production` 31 | * this disables source maps, minifies the code, and generates a `.xdx` file named with the current version in manifest.json 32 | * once the plugin is submitted & approved, tag the commit with its version number (ex. `v1.0.0`), update the CHANGELOG with the date. 33 | 34 | ### adobe_xd 35 | If you are also publishing a new version of the adobe_xd package: 36 | * update version in adobe_xd/pubspec.yaml and the plugin README (Flutter Dependencies), and ensure the README and CHANGELOG are up to date (incl. version) and committed. 37 | * update Flutter and run Clean Project & Upgrade Packages on adobe_xd, example, and test suite 38 | * run Format Document on adobe_xd files (set line length to 80 first) 39 | * re-export example and test suite and test thoroughly 40 | * update change log -------------------------------------------------------------------------------- /src/ui/results.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | const { h, Component, Fragment } = require("preact"); 13 | const { resultsAlert } = require('./alert'); 14 | const version = require('../version'); 15 | const { shell } = require('uxp'); 16 | const { HELP_URL } = require('../core/constants'); 17 | 18 | const iconError = require('./assets/icon-error.png'); 19 | 20 | class Results extends Component { 21 | constructor(props) { 22 | super(props); 23 | } 24 | 25 | shouldComponentUpdate(nextProps) { 26 | if (this.props.node !== nextProps.node) { 27 | this.setState({ results: null }) 28 | return true; 29 | } 30 | if (this.props.context === nextProps.context) return false; 31 | if (nextProps.context && nextProps.context.log) { 32 | this.setState({ results: nextProps.context.log.getResults() }) 33 | } 34 | } 35 | 36 | render(props, state) { 37 | if (!version.xdVersionOk) { 38 | return
39 |
{`Version ${version.xdVersionRequired}+ of Adobe XD is required (v${version.version})`}
40 |
41 | } 42 | if (!props.context || !state.results) { 43 | return
44 | {`${version.label} v${version.version}`} 45 | Need help? 46 |
; 47 | } 48 | if (!props.context.log) { return

UNEXPECTED RESULT OBJECT!

; } 49 | 50 | let results = state.results, errorMsg = this.getErrorMsg(results); 51 | return ( 52 | {results &&
53 | {props.context.resultMessage}{(errorMsg) ? ': ' : '.'}{errorMsg} 54 |
} 55 |
); 56 | } 57 | 58 | getErrorMsg(results) { 59 | if (!results) { return null; } 60 | let count = results.errors.length, hasErrors = count > 0; 61 | let noun = count ? 'error' : 'warning'; 62 | if (!count) { count = results.warnings.length; } 63 | let s = count > 1 ? 's' : ''; 64 | return !count ? null : resultsAlert(results)}> 65 | {hasErrors ? : null} 66 | {`${count} ${noun}${s}`} 67 | ; 68 | } 69 | } 70 | 71 | module.exports = Results; -------------------------------------------------------------------------------- /test_suite/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: test_suite 2 | description: A new Flutter project. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 1.0.0+1 19 | 20 | environment: 21 | sdk: ">=2.12.0 <3.0.0" 22 | 23 | dependencies: 24 | flutter: 25 | sdk: flutter 26 | cupertino_icons: ^1.0.0 27 | adobe_xd: 28 | path: ../adobe_xd 29 | 30 | dev_dependencies: 31 | flutter_test: 32 | sdk: flutter 33 | 34 | # For information on the generic Dart part of this file, see the 35 | # following page: https://dart.dev/tools/pub/pubspec 36 | 37 | # The following section is specific to Flutter. 38 | flutter: 39 | 40 | # The following line ensures that the Material Icons font is 41 | # included with your application, so that you can use the icons in 42 | # the material Icons class. 43 | uses-material-design: true 44 | 45 | # To add assets to your application, add an assets section, like this: 46 | assets: 47 | - assets/images/ 48 | 49 | # An image asset can refer to one or more resolution-specific "variants", see 50 | # https://flutter.dev/assets-and-images/#resolution-aware. 51 | 52 | # For details regarding adding assets from package dependencies, see 53 | # https://flutter.dev/assets-and-images/#from-packages 54 | 55 | # To add custom fonts to your application, add a fonts section here, 56 | # in this "flutter" section. Each entry in this list should have a 57 | # "family" key with the font family name, and a "fonts" key with a 58 | # list giving the asset and other descriptors for the font. For 59 | # example: 60 | 61 | # For details regarding fonts from package dependencies, 62 | # see https://flutter.dev/custom-fonts/#from-packages 63 | -------------------------------------------------------------------------------- /test_suite/lib/xd_page_size.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:adobe_xd/pinned.dart'; 3 | import './xd_component5.dart'; 4 | 5 | class XDPageSize extends StatelessWidget { 6 | XDPageSize({ 7 | Key? key, 8 | }) : super(key: key); 9 | @override 10 | Widget build(BuildContext context) { 11 | return Stack( 12 | children: [ 13 | SizedBox( 14 | width: 960.0, 15 | height: 720.0, 16 | child: 17 | // Adobe XD layer: 'Elements' (group) 18 | Stack( 19 | children: [ 20 | Transform.rotate( 21 | angle: 3.1416, 22 | child: Container( 23 | width: 960.0, 24 | height: 720.0, 25 | decoration: BoxDecoration( 26 | color: const Color(0x66ffffff), 27 | border: 28 | Border.all(width: 2.0, color: const Color(0x6600c4ff)), 29 | ), 30 | ), 31 | ), 32 | Pinned.fromPins( 33 | Pin(size: 32.0, start: 928.0), 34 | Pin(size: 32.0, start: 688.0), 35 | child: 36 | // Adobe XD layer: 'LargeCorner' (component) 37 | XDComponent5(), 38 | ), 39 | Pinned.fromPins( 40 | Pin(size: 32.0, start: 928.0), 41 | Pin(size: 32.0, start: 0.0), 42 | child: Transform.rotate( 43 | angle: 4.7124, 44 | child: 45 | // Adobe XD layer: 'LargeCorner' (component) 46 | XDComponent5(), 47 | ), 48 | ), 49 | Pinned.fromPins( 50 | Pin(size: 32.0, start: 0.0), 51 | Pin(size: 32.0, start: 688.0), 52 | child: Transform.rotate( 53 | angle: 1.5708, 54 | child: 55 | // Adobe XD layer: 'LargeCorner' (component) 56 | XDComponent5(), 57 | ), 58 | ), 59 | Align( 60 | alignment: Alignment.topLeft, 61 | child: SizedBox( 62 | width: 32.0, 63 | height: 32.0, 64 | child: Transform.rotate( 65 | angle: 3.1416, 66 | child: 67 | // Adobe XD layer: 'LargeCorner' (component) 68 | XDComponent5(), 69 | ), 70 | ), 71 | ), 72 | ], 73 | ), 74 | ), 75 | ], 76 | ); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /adobe_xd/example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 23 | 27 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const exec = require("child_process").exec; 2 | const CircularDependencyPlugin = require("circular-dependency-plugin"); 3 | 4 | let isProd = false; 5 | let isWatch = true; 6 | try { 7 | const config = JSON.parse(process.env.npm_config_argv); 8 | isProd = config.original.includes("--production"); 9 | isWatch = !(config.original.includes("--no-watch") || isProd); 10 | } catch (e) { } 11 | 12 | module.exports = { 13 | entry: "./src/ui/main.jsx", 14 | mode: isProd ? "production" : "development", 15 | watch: isWatch, 16 | output: { 17 | path: __dirname + "/build", 18 | filename: 'main.js', 19 | libraryTarget: "commonjs2" 20 | }, 21 | devtool: isProd ? "none" : "source-map", 22 | resolve: { 23 | extensions: ['.js', '.jsx', '.styl'], 24 | }, 25 | module: { 26 | rules: [ 27 | { 28 | test: /\.jsx?$/, 29 | exclude: /node_modules/, 30 | loader: "babel-loader", 31 | options: { 32 | plugins: [ 33 | ["transform-react-jsx", { 34 | "pragma": "h", // default pragma is React.createElement 35 | "pragmaFrag": "Fragment", // default is React.Fragment 36 | }] 37 | ] 38 | } 39 | }, 40 | { 41 | test: /\.styl?$/, 42 | use: [ 43 | { 44 | loader: "style-loader" // creates style nodes from JS strings 45 | }, 46 | { 47 | loader: "css-loader" // translates CSS into CommonJS 48 | }, 49 | { 50 | loader: "stylus-loader" // compiles Stylus to CSS 51 | } 52 | ] 53 | }, 54 | { 55 | test: /\.(png|svg|jpg|gif)$/, 56 | loader: 'file-loader', 57 | options: { 58 | outputPath: 'images', 59 | name: '[name].[ext]' 60 | } 61 | }, 62 | ] 63 | }, 64 | externals: [ 65 | "os", 66 | "scenegraph", 67 | "application", 68 | "clipboard", 69 | "assets", 70 | "uxp", 71 | function (context, request, callback) { 72 | if (/lib/.test(request)) { 73 | return callback(null, request.substr(1), "commonjs2") 74 | } 75 | callback(); 76 | } 77 | ], 78 | plugins: [ 79 | // new CircularDependencyPlugin({ failOnError: true }), 80 | { 81 | apply: (compiler) => { 82 | const runDeploy = () => exec("yarn deploy", (err, stdout, stderr) => { 83 | if (stdout) { console.log("\nWebpack bundle complete, plugin folder updated"); } 84 | if (stderr) { console.error(stderr); } 85 | }); 86 | if (isWatch) { 87 | compiler.hooks.afterEmit.tap("DeployPlugin", runDeploy); 88 | } else { 89 | compiler.hooks.done.tap("DeployPlugin", runDeploy); 90 | } 91 | } 92 | } 93 | ] 94 | }; -------------------------------------------------------------------------------- /test_suite/lib/xd_title_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:adobe_xd/pinned.dart'; 3 | import './xd_nav_btn.dart'; 4 | import 'package:adobe_xd/page_link.dart'; 5 | 6 | class XDTitleBar extends StatelessWidget { 7 | final String title; 8 | XDTitleBar({ 9 | Key? key, 10 | this.title = 'Title', 11 | }) : super(key: key); 12 | @override 13 | Widget build(BuildContext context) { 14 | return Stack( 15 | children: [ 16 | Pinned.fromPins( 17 | Pin(start: 0.0, end: 0.0), 18 | Pin(size: 48.0, start: 0.0), 19 | child: 20 | // Adobe XD layer: 'bg' (shape) 21 | Container( 22 | color: const Color(0xffe2e2e2), 23 | ), 24 | ), 25 | Pinned.fromPins( 26 | Pin(start: 64.0, end: 22.0), 27 | Pin(size: 20.0, start: 14.0), 28 | child: 29 | // Adobe XD layer: 'title' (text) 30 | Text( 31 | title, 32 | style: TextStyle( 33 | fontFamily: 'Arial', 34 | fontSize: 16, 35 | color: const Color(0xff000000), 36 | fontWeight: FontWeight.w700, 37 | ), 38 | ), 39 | ), 40 | Pinned.fromPins( 41 | Pin(size: 32.0, start: 16.0), 42 | Pin(size: 32.0, middle: 0.5), 43 | child: 44 | // Adobe XD layer: 'home_btn' (group) 45 | PageLink( 46 | links: [ 47 | PageLinkInfo(), 48 | ], 49 | child: Stack( 50 | children: [ 51 | Align( 52 | alignment: Alignment.topLeft, 53 | child: SizedBox( 54 | width: 32.0, 55 | height: 32.0, 56 | child: 57 | // Adobe XD layer: 'NavButton' (component) 58 | XDNavBtn(), 59 | ), 60 | ), 61 | Pinned.fromPins( 62 | Pin(size: 16.9, start: 8.0), 63 | Pin(size: 16.0, start: 8.0), 64 | child: 65 | // Adobe XD layer: 'glyphicons-21-home@…' (shape) 66 | Container( 67 | decoration: BoxDecoration( 68 | image: DecorationImage( 69 | image: const AssetImage('assets/images/home.png'), 70 | fit: BoxFit.fill, 71 | colorFilter: new ColorFilter.mode( 72 | Colors.black.withOpacity(0.5), BlendMode.dstIn), 73 | ), 74 | ), 75 | ), 76 | ), 77 | ], 78 | ), 79 | ), 80 | ), 81 | ], 82 | ); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /adobe_xd/example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: A new Flutter project. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 2.0.0 19 | 20 | environment: 21 | sdk: ">=2.12.0 <3.0.0" 22 | 23 | # In production, use the adobe_xd package from https://pub.dev/packages/adobe_xd 24 | dependencies: 25 | adobe_xd: 26 | path: ../ 27 | flutter: 28 | sdk: flutter 29 | 30 | 31 | # The following adds the Cupertino Icons font to your application. 32 | # Use with the CupertinoIcons class for iOS style icons. 33 | cupertino_icons: ^0.1.3 34 | 35 | dev_dependencies: 36 | flutter_test: 37 | sdk: flutter 38 | 39 | # For information on the generic Dart part of this file, see the 40 | # following page: https://dart.dev/tools/pub/pubspec 41 | 42 | # The following section is specific to Flutter. 43 | flutter: 44 | 45 | # The following line ensures that the Material Icons font is 46 | # included with your application, so that you can use the icons in 47 | # the material Icons class. 48 | uses-material-design: true 49 | 50 | # To add assets to your application, add an assets section, like this: 51 | assets: 52 | - assets/images/ 53 | 54 | # An image asset can refer to one or more resolution-specific "variants", see 55 | # https://flutter.dev/assets-and-images/#resolution-aware. 56 | 57 | # For details regarding adding assets from package dependencies, see 58 | # https://flutter.dev/assets-and-images/#from-packages 59 | 60 | # To add custom fonts to your application, add a fonts section here, 61 | # in this "flutter" section. Each entry in this list should have a 62 | # "family" key with the font family name, and a "fonts" key with a 63 | # list giving the asset and other descriptors for the font. For 64 | # example: 65 | fonts: 66 | - family: Helvetica 67 | # not included with example for copyright reasons 68 | - family: Georgia 69 | # not included with example for copyright reasons 70 | 71 | # For details regarding fonts from package dependencies, 72 | # see https://flutter.dev/custom-fonts/#from-packages 73 | -------------------------------------------------------------------------------- /src/core/log.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | const $ = require('../utils/utils'); 13 | const { trace } = require('../utils/debug'); 14 | const version = require("../version"); 15 | 16 | class Log { 17 | constructor(message) { 18 | this.entries = {}; 19 | this.log = []; 20 | this.startTime = Date.now(); 21 | message && this.add(message); 22 | } 23 | 24 | add(message, severity = LogSeverity.NOTE, xdNode = null) { 25 | if (xdNode) { 26 | message = `[${$.shorten(xdNode.name, 20)}] ${message}`; 27 | } 28 | let entry = new Entry(message, severity); 29 | this.log.push(entry); 30 | let o = this.entries[entry.hash] = (this.entries[entry.hash] || entry); 31 | o.count += 1; 32 | return o; 33 | } 34 | 35 | getResults() { 36 | let entries = this.entries, results = {warnings:[], errors:[]} 37 | for (let n in entries) { 38 | let o = entries[n], severity = o.severity; 39 | if (severity === LogSeverity.WARNING) { results.warnings.push(o); } 40 | else if (severity === LogSeverity.ERROR) { results.errors.push(o); } 41 | } 42 | return results; 43 | } 44 | 45 | dump(message) { 46 | // if in debug mode, this ends the log and traces the result. 47 | if (!version.debug) { return; } 48 | this.add("Complete" + (message ? ": " + message : "")); 49 | let str = "", log = this.log, t = this.startTime; 50 | for (let i=0; i 1 ? ` (x${this.count})` : ''); 89 | } 90 | } 91 | 92 | const LogSeverity = Object.freeze({ 93 | NOTE: 0, // Not surfaced to user, dev log. 94 | WARNING: 1, // Surfaced as warning. 95 | ERROR: 2, // Surfaced as error. 96 | FATAL: 3, // Unlikely to be used. Plugin is in an unrecoverable state. 97 | BLACKWATCH_PLAID: 11, // Pee pee pants 98 | }); 99 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /test_suite/lib/xd_vertical_layout.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:adobe_xd/pinned.dart'; 3 | 4 | class XDVerticalLayout extends StatelessWidget { 5 | XDVerticalLayout({ 6 | Key? key, 7 | }) : super(key: key); 8 | @override 9 | Widget build(BuildContext context) { 10 | return Stack( 11 | children: [ 12 | Pinned.fromPins( 13 | Pin(startFraction: 0.8431, endFraction: 0.0784), 14 | Pin(size: 64.0, end: 8.0), 15 | child: 16 | // Adobe XD layer: 'fixHeightPinBottom' (shape) 17 | Container( 18 | color: const Color(0xff62008d), 19 | ), 20 | ), 21 | Pinned.fromPins( 22 | Pin(startFraction: 0.7451, endFraction: 0.1765), 23 | Pin(size: 64.0, start: 8.0), 24 | child: 25 | // Adobe XD layer: 'fixHeightPinTop' (shape) 26 | Container( 27 | color: const Color(0xff62008d), 28 | ), 29 | ), 30 | Pinned.fromPins( 31 | Pin(startFraction: 0.6471, endFraction: 0.2745), 32 | Pin(size: 64.0, middle: 0.5), 33 | child: 34 | // Adobe XD layer: 'fixHeight' (shape) 35 | Container( 36 | color: const Color(0xff62008d), 37 | ), 38 | ), 39 | Pinned.fromPins( 40 | Pin(startFraction: 0.5098, endFraction: 0.4118), 41 | Pin(start: 40.0, end: 40.0), 42 | child: 43 | // Adobe XD layer: 'pinBoth' (shape) 44 | Container( 45 | color: const Color(0xff008d00), 46 | ), 47 | ), 48 | Pinned.fromPins( 49 | Pin(startFraction: 0.4118, endFraction: 0.5098), 50 | Pin(end: 8.0, startFraction: 0.5), 51 | child: 52 | // Adobe XD layer: 'pinBottom' (shape) 53 | Container( 54 | color: const Color(0xff008d00), 55 | ), 56 | ), 57 | Pinned.fromPins( 58 | Pin(startFraction: 0.3137, endFraction: 0.6078), 59 | Pin(start: 8.0, endFraction: 0.5), 60 | child: 61 | // Adobe XD layer: 'pinTop' (shape) 62 | Container( 63 | color: const Color(0xff008d00), 64 | ), 65 | ), 66 | Pinned.fromPins( 67 | Pin(startFraction: 0.2157, endFraction: 0.7059), 68 | Pin(startFraction: 0.2778, endFraction: 0.2778), 69 | child: 70 | // Adobe XD layer: 'none' (shape) 71 | Container( 72 | color: const Color(0xff008d00), 73 | ), 74 | ), 75 | Pinned.fromPins( 76 | Pin(startFraction: 0.0784, endFraction: 0.8431), 77 | Pin(start: 8.0, end: 8.0), 78 | child: 79 | // Adobe XD layer: 'fullHeight' (shape) 80 | Container( 81 | color: const Color(0xff62008d), 82 | ), 83 | ), 84 | // Adobe XD layer: 'outline' (shape) 85 | Container( 86 | decoration: BoxDecoration( 87 | border: Border.all(width: 1.0, color: const Color(0xff00e2ff)), 88 | ), 89 | ), 90 | ], 91 | ); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /test_suite/lib/xd_horizontal_layout.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:adobe_xd/pinned.dart'; 3 | 4 | class XDHorizontalLayout extends StatelessWidget { 5 | XDHorizontalLayout({ 6 | Key? key, 7 | }) : super(key: key); 8 | @override 9 | Widget build(BuildContext context) { 10 | return Stack( 11 | children: [ 12 | Pinned.fromPins( 13 | Pin(size: 64.0, end: 8.0), 14 | Pin(startFraction: 0.8431, endFraction: 0.0784), 15 | child: 16 | // Adobe XD layer: 'fixWidthPinRight' (shape) 17 | Container( 18 | color: const Color(0xff62008d), 19 | ), 20 | ), 21 | Pinned.fromPins( 22 | Pin(size: 64.0, start: 8.0), 23 | Pin(startFraction: 0.7451, endFraction: 0.1765), 24 | child: 25 | // Adobe XD layer: 'fixWidthPinLeft' (shape) 26 | Container( 27 | color: const Color(0xff62008d), 28 | ), 29 | ), 30 | Pinned.fromPins( 31 | Pin(size: 64.0, middle: 0.5), 32 | Pin(startFraction: 0.6471, endFraction: 0.2745), 33 | child: 34 | // Adobe XD layer: 'fixWidth' (shape) 35 | Container( 36 | color: const Color(0xff62008d), 37 | ), 38 | ), 39 | Pinned.fromPins( 40 | Pin(start: 40.0, end: 40.0), 41 | Pin(startFraction: 0.5098, endFraction: 0.4118), 42 | child: 43 | // Adobe XD layer: 'pinBoth' (shape) 44 | Container( 45 | color: const Color(0xff008d00), 46 | ), 47 | ), 48 | Pinned.fromPins( 49 | Pin(end: 8.0, startFraction: 0.5), 50 | Pin(startFraction: 0.4118, endFraction: 0.5098), 51 | child: 52 | // Adobe XD layer: 'pinRight' (shape) 53 | Container( 54 | color: const Color(0xff008d00), 55 | ), 56 | ), 57 | Pinned.fromPins( 58 | Pin(start: 8.0, endFraction: 0.5), 59 | Pin(startFraction: 0.3137, endFraction: 0.6078), 60 | child: 61 | // Adobe XD layer: 'pinLeft' (shape) 62 | Container( 63 | color: const Color(0xff008d00), 64 | ), 65 | ), 66 | Pinned.fromPins( 67 | Pin(startFraction: 0.2778, endFraction: 0.2778), 68 | Pin(startFraction: 0.2157, endFraction: 0.7059), 69 | child: 70 | // Adobe XD layer: 'none' (shape) 71 | Container( 72 | color: const Color(0xff008d00), 73 | ), 74 | ), 75 | Pinned.fromPins( 76 | Pin(start: 8.0, end: 8.0), 77 | Pin(startFraction: 0.0784, endFraction: 0.8431), 78 | child: 79 | // Adobe XD layer: 'fullWidth' (shape) 80 | Container( 81 | color: const Color(0xff62008d), 82 | ), 83 | ), 84 | // Adobe XD layer: 'outline' (shape) 85 | Container( 86 | decoration: BoxDecoration( 87 | border: Border.all(width: 1.0, color: const Color(0xff00e2ff)), 88 | ), 89 | ), 90 | ], 91 | ); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Adobe Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | nationality, personal appearance, race, religion, or sexual identity and 10 | orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language. 18 | * Being respectful of differing viewpoints and experiences. 19 | * Gracefully accepting constructive criticism. 20 | * Focusing on what is best for the community. 21 | * Showing empathy towards other community members. 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances. 27 | * Trolling, insulting/derogatory comments, and personal or political attacks. 28 | * Public or private harassment. 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission. 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting. 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at Grp-opensourceoffice@adobe.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at [https://contributor-covenant.org/version/1/4][version]. 72 | 73 | [homepage]: https://contributor-covenant.org 74 | [version]: https://contributor-covenant.org/version/1/4/ 75 | -------------------------------------------------------------------------------- /test_suite/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /test_suite/lib/xd_layout_box_components.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import './xd_small_corner.dart'; 3 | import 'package:adobe_xd/pinned.dart'; 4 | import './xd_edge.dart'; 5 | import './xd_center_point.dart'; 6 | 7 | class XDLayoutBoxComponents extends StatelessWidget { 8 | XDLayoutBoxComponents({ 9 | Key? key, 10 | }) : super(key: key); 11 | @override 12 | Widget build(BuildContext context) { 13 | return Stack( 14 | children: [ 15 | Align( 16 | alignment: Alignment.bottomRight, 17 | child: SizedBox( 18 | width: 8.0, 19 | height: 8.0, 20 | child: 21 | // Adobe XD layer: 'br' (component) 22 | XDSmallCorner(), 23 | ), 24 | ), 25 | Align( 26 | alignment: Alignment.bottomLeft, 27 | child: SizedBox( 28 | width: 8.0, 29 | height: 8.0, 30 | child: Transform.rotate( 31 | angle: 1.5708, 32 | child: 33 | // Adobe XD layer: 'bl' (component) 34 | XDSmallCorner(), 35 | ), 36 | ), 37 | ), 38 | Align( 39 | alignment: Alignment.topLeft, 40 | child: SizedBox( 41 | width: 8.0, 42 | height: 8.0, 43 | child: Transform.rotate( 44 | angle: 3.1416, 45 | child: 46 | // Adobe XD layer: 'tl' (component) 47 | XDSmallCorner(), 48 | ), 49 | ), 50 | ), 51 | Align( 52 | alignment: Alignment.topRight, 53 | child: SizedBox( 54 | width: 8.0, 55 | height: 8.0, 56 | child: Transform.rotate( 57 | angle: 4.7124, 58 | child: 59 | // Adobe XD layer: 'tr' (component) 60 | XDSmallCorner(), 61 | ), 62 | ), 63 | ), 64 | Pinned.fromPins( 65 | Pin(size: 4.0, end: 0.0), 66 | Pin(start: 16.0, end: 16.0), 67 | child: 68 | // Adobe XD layer: 'right' (component) 69 | XDEdge(), 70 | ), 71 | Center( 72 | child: SizedBox( 73 | width: 4.0, 74 | height: 4.0, 75 | child: 76 | // Adobe XD layer: 'center' (component) 77 | XDCenterPoint(), 78 | ), 79 | ), 80 | Pinned.fromPins( 81 | Pin(start: 18.0, end: 18.0), 82 | Pin(size: 8.0, end: -2.0), 83 | child: Transform.rotate( 84 | angle: 1.5708, 85 | child: 86 | // Adobe XD layer: 'right' (component) 87 | XDEdge(), 88 | ), 89 | ), 90 | Pinned.fromPins( 91 | Pin(size: 4.0, start: 0.0), 92 | Pin(start: 16.0, end: 16.0), 93 | child: Transform.rotate( 94 | angle: 3.1416, 95 | child: 96 | // Adobe XD layer: 'right' (component) 97 | XDEdge(), 98 | ), 99 | ), 100 | Pinned.fromPins( 101 | Pin(start: 18.0, end: 18.0), 102 | Pin(size: 8.0, start: -2.0), 103 | child: Transform.rotate( 104 | angle: 4.7124, 105 | child: 106 | // Adobe XD layer: 'right' (component) 107 | XDEdge(), 108 | ), 109 | ), 110 | ], 111 | ); 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /adobe_xd/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 64 | 65 | 71 | 73 | 79 | 80 | 81 | 82 | 84 | 85 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /adobe_xd/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /src/core/nodes/abstractnode.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | const $ = require("../../utils/utils"); 13 | const { getAdjustedBounds } = require("../../utils/layoututils"); 14 | 15 | const { Parameter } = require("../parameter"); 16 | const { Layout } = require("../decorators/layout"); 17 | 18 | // Abstract class representing the minimum interface required for an export node. 19 | class AbstractNode { 20 | // Nodes should also have a static `create(xdNode, ctx)` method 21 | // that returns an instance if appropriate for the xdNode. 22 | 23 | constructor(xdNode, ctx) { 24 | this.xdNode = xdNode; 25 | this.parameters = null; 26 | this.children = null; 27 | this.decorators = null; 28 | this.hasDecorators = false; // indicates this node has non-cosmetic decorators. 29 | this._cache = null; 30 | this.layout = this._getLayout(ctx); 31 | } 32 | 33 | get hasChildren() { 34 | return !!(this.children && this.children.length); 35 | } 36 | 37 | get xdId() { 38 | return this.xdNode ? this.xdNode.guid : null; 39 | } 40 | 41 | get xdName() { 42 | return this.xdNode ? this.xdNode.name : null; 43 | } 44 | 45 | get adjustedBounds() { 46 | return getAdjustedBounds(this.xdNode); 47 | } 48 | 49 | addDecorator(decorator) { 50 | this.decorators = this.decorators || []; 51 | this.decorators.push(decorator); 52 | if (!decorator.cosmetic) { this.hasDecorators = true; } 53 | } 54 | 55 | addParam(key, name, type, value) { 56 | if (!name || !key) { return null; } 57 | let param = new Parameter(name, type, value); 58 | if (!this.parameters) { this.parameters = {}; } 59 | return this.parameters[key] = param; 60 | } 61 | 62 | getParam(key) { 63 | return this.parameters && this.parameters[key]; 64 | } 65 | 66 | getParamName(key) { 67 | let param = this.getParam(key); 68 | return (param && param.name) || null; 69 | } 70 | 71 | get transform() { 72 | // currently supports rotation & flipY. 73 | return {rotation: this.xdNode.rotation, flipY: false}; 74 | } 75 | 76 | toString(ctx) { 77 | return `[${this.constructor.name}]`; 78 | } 79 | 80 | serialize(ctx) { 81 | if (this._cache === null) { 82 | let nodeStr = this._serialize(ctx); 83 | this._cache = this._decorate(nodeStr, ctx); 84 | } 85 | return this._cache; 86 | } 87 | 88 | _serialize(ctx) { 89 | return ""; 90 | } 91 | 92 | _decorate(nodeStr, ctx) { 93 | if (!nodeStr) { return nodeStr; } 94 | let decorators = this.decorators, l = nodeStr && decorators ? decorators.length : 0; 95 | for (let i=0; i { 104 | let childStr = node && node.serialize(ctx); 105 | if (childStr) { str += childStr + ", "; } 106 | }); 107 | return str; 108 | } 109 | 110 | _getChildStack(children, ctx) { 111 | return `Stack(children: [${this._getChildList(children, ctx)}], )`; 112 | } 113 | 114 | // can be overridden by subclasses to set layout properties: 115 | _getLayout(ctx) { 116 | return (new Layout(this)).calculate(ctx); 117 | } 118 | } 119 | exports.AbstractNode = AbstractNode; 120 | -------------------------------------------------------------------------------- /src/ui/render_preview.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | const app = require('application'); 13 | const fs = require('uxp').storage; 14 | const $ = require('../utils/utils'); 15 | 16 | let previewFile; 17 | 18 | function initPreview() { 19 | (fs.localFileSystem.getTemporaryFolder()).then((folder) => { 20 | (folder.createFile('XD_Flutter_preview.png', { overwrite: true })).then((f) => { 21 | previewFile = f; 22 | }) 23 | }); 24 | } 25 | initPreview(); 26 | 27 | async function getPreview(node, retryCount=0) { 28 | // return null when something goes wrong, empty string for an empty preview 29 | if (!node) { return ''; } 30 | if (!previewFile) { return null; } 31 | let bounds = node.localBounds; 32 | let scale = Math.min(20, 200 / bounds.height, 400 / bounds.width) * 3; // for hi-dpi 33 | try { 34 | await app.createRenditions([{ 35 | node, scale, 36 | outputFile: previewFile, 37 | type: app.RenditionType.PNG, 38 | }]); 39 | } catch(e) { 40 | if (retryCount > 0) { 41 | await $.delay(100); 42 | return await getPreview(node, retryCount-1); 43 | } else { 44 | return null; 45 | } 46 | } 47 | const data = await previewFile.read({ format: fs.formats.binary }); 48 | return 'data:image/png;base64,' + base64ArrayBuffer(data); 49 | } 50 | exports.getPreview = getPreview; 51 | 52 | function base64ArrayBuffer(arrayBuffer) { 53 | let base64 = ''; 54 | const encodings = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; 55 | 56 | const bytes = new Uint8Array(arrayBuffer); 57 | const byteLength = bytes.byteLength; 58 | const byteRemainder = byteLength % 3; 59 | const mainLength = byteLength - byteRemainder; 60 | 61 | let a, b, c, d; 62 | let chunk; 63 | 64 | // Main loop deals with bytes in chunks of 3 65 | for (var i = 0; i < mainLength; i = i + 3) { 66 | // Combine the three bytes into a single integer 67 | chunk = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2]; 68 | 69 | // Use bitmasks to extract 6-bit segments from the triplet 70 | a = (chunk & 16515072) >> 18; // 16515072 = (2^6 - 1) << 18 71 | b = (chunk & 258048) >> 12; // 258048 = (2^6 - 1) << 12 72 | c = (chunk & 4032) >> 6; // 4032 = (2^6 - 1) << 6 73 | d = chunk & 63; // 63 = 2^6 - 1 74 | 75 | // Convert the raw binary segments to the appropriate ASCII encoding 76 | base64 += encodings[a] + encodings[b] + encodings[c] + encodings[d]; 77 | } 78 | 79 | // Deal with the remaining bytes and padding 80 | if (byteRemainder == 1) { 81 | chunk = bytes[mainLength]; 82 | 83 | a = (chunk & 252) >> 2; // 252 = (2^6 - 1) << 2 84 | 85 | // Set the 4 least significant bits to zero 86 | b = (chunk & 3) << 4; // 3 = 2^2 - 1 87 | 88 | base64 += encodings[a] + encodings[b] + '=='; 89 | } else if (byteRemainder == 2) { 90 | chunk = (bytes[mainLength] << 8) | bytes[mainLength + 1]; 91 | 92 | a = (chunk & 64512) >> 10; // 64512 = (2^6 - 1) << 10 93 | b = (chunk & 1008) >> 4; // 1008 = (2^6 - 1) << 4 94 | 95 | // Set the 2 least significant bits to zero 96 | c = (chunk & 15) << 2; // 15 = 2^4 - 1 97 | 98 | base64 += encodings[a] + encodings[b] + encodings[c] + '='; 99 | } 100 | 101 | return base64; 102 | } -------------------------------------------------------------------------------- /src/utils/nameutils.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Adobe 3 | All Rights Reserved. 4 | 5 | NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | accordance with the terms of the Adobe license agreement accompanying 7 | it. If you have received this file from a source other than Adobe, 8 | then your use, modification, or distribution of it requires the prior 9 | written permission of Adobe. 10 | */ 11 | 12 | const $ = require("./utils"); 13 | 14 | exports.DART_RESERVED_WORDS = [ 15 | // reserved words: 16 | "assert", "break", "case", "catch", "class", "const", "continue", "default", 17 | "do", "else", "enum", "extends", "false", "final", "finally", "for", "if", "in", 18 | "is", "new", "null", "rethrow", "return", "super", "switch", "this", "throw", 19 | "true", "try", "var", "void", "while", "with", 20 | // keywords: 21 | "async", "hide", "on", "show", "sync", 22 | // identifiers: 23 | "abstract", "as", "covariant", "deferred", "export", "factory", 24 | "Function", "get", "implements", "import", "interface", "library", "mixin", 25 | "operator", "part", "set", "static", "typedef", 26 | "await", "yield", 27 | // types: 28 | "bool", "double", "dynamic", "int", "List", "Map", "String", 29 | ]; 30 | 31 | exports.DART_RESERVED_WORDS_MAP = $.buildMap(exports.DART_RESERVED_WORDS); 32 | 33 | // clean a Dart name without consideration for case: 34 | function cleanDartName(name) { 35 | if (!name) { return ""; } 36 | name = name.replace(/^[\W\d]+|\W/ig, ''); 37 | if (exports.DART_RESERVED_WORDS_MAP[name]) { name += "_"; } 38 | return name; 39 | } 40 | exports.cleanDartName = cleanDartName; 41 | 42 | function cleanClassName(name, fixCase=true) { 43 | if (!fixCase) { return cleanDartName(name); } 44 | let words = findWords(name), n = ""; 45 | for (let i=0; i adbTester instead of aDBTester? Less important than for file names 58 | return name[0].toLowerCase() + name.slice(1); 59 | } 60 | exports.cleanIdentifierName = cleanIdentifierName; 61 | 62 | function cleanFileName(name, fixCase=true) { 63 | // remove bad chars including / 64 | if (!(name = name.replace(/[\/\\:*?"<>|#]]+/ig, '')) || !fixCase) { return name; } 65 | let words = findWords(name), n = "", prev; 66 | for (let i=0; i adb_tester instead of a_d_b_tester 70 | if (isSingleCap(word) && isSingleCap(prev)) { } 71 | else if (i > 0) { n += "_"; } 72 | prev = word; 73 | n += word.toLowerCase(); 74 | } 75 | return n; 76 | } 77 | exports.cleanFileName = cleanFileName; 78 | 79 | 80 | function pushNonEmpty(arr, val) { 81 | if (val) { arr.push(val); } 82 | } 83 | 84 | function findWords(str) { 85 | if (!str) { return []; } 86 | let re = /[-A-Z_ ]/g, arr=[], i=0, o; 87 | while (o = re.exec(str)) { 88 | let c = o[0]; 89 | pushNonEmpty(arr, str.slice(i, re.lastIndex-1)); 90 | i = re.lastIndex-1; 91 | if (c === "-" || c === "_" || c === " ") { ++i; } 92 | } 93 | pushNonEmpty(arr, str.slice(i)); 94 | return arr; 95 | } 96 | 97 | function isSingleCap(str) { 98 | if (!str || str.length !== 1) { return false; } 99 | return str.toLowerCase() !== str; 100 | } --------------------------------------------------------------------------------