├── .gitignore ├── .idea ├── libraries │ ├── Dart_SDK.xml │ └── Flutter_for_Android.xml ├── modules.xml ├── runConfigurations │ └── example_lib_main_dart.xml └── workspace.xml ├── .metadata ├── .vscode └── settings.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.buildship.core.prefs │ └── org.eclipse.jdt.core.prefs ├── build.gradle ├── gradle.properties ├── settings.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── io │ └── flutter │ └── plugins │ └── linkpreview │ ├── LinkPreviewPlugin.java │ └── MetaData.java ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── .project │ ├── .settings │ │ └── org.eclipse.buildship.core.prefs │ ├── app │ │ ├── .classpath │ │ ├── .project │ │ ├── .settings │ │ │ ├── org.eclipse.buildship.core.prefs │ │ │ └── org.eclipse.jdt.core.prefs │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── io │ │ │ │ └── flutter │ │ │ │ └── plugins │ │ │ │ └── linkpreview │ │ │ │ └── linkpreviewexample │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── 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 │ │ │ └── values │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── flutter_export_environment.sh │ ├── Podfile │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── 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-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── main.m ├── lib │ └── main.dart ├── pubspec.yaml └── test │ └── widget_test.dart ├── ios ├── .gitignore ├── Assets │ └── .gitkeep ├── Classes │ ├── LinkPreviewPlugin.h │ └── LinkPreviewPlugin.m └── link_preview.podspec ├── lib ├── link_preview.dart └── src │ └── widget │ ├── linkedin │ ├── index.dart │ └── view.dart │ ├── preview_link.dart │ ├── skype │ ├── index.dart │ └── view.dart │ ├── telegram │ ├── index.dart │ └── view.dart │ ├── twitter │ ├── index.dart │ └── view.dart │ └── whatsapp │ ├── index.dart │ └── view.dart ├── link_preview.iml ├── pubspec.yaml └── screenshots ├── flutter_01.png └── flutter_02.png /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | pubspec.lock 7 | 8 | build/ 9 | -------------------------------------------------------------------------------- /.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/libraries/Flutter_for_Android.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/runConfigurations/example_lib_main_dart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 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 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /.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: 5391447fae6209bb21a89e6a5a6583cac1af9b4b 8 | channel: dev 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "java.configuration.updateBuildConfiguration": "interactive" 3 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * initial release just now available only on Android -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | TODO: Add your license here. 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # link_preview 2 | A Rich Link Preview flutter plugin. 3 | 4 |
5 | screen_01 6 | screen_02 7 |
8 | 9 | ## Usage 10 | To use this plugin, add `link_preview` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). 11 | 12 | ### Example 13 | 14 | ``` dart 15 | import 'package:flutter/material.dart'; 16 | import 'package:link_preview/widget/whatsapp/index.dart'; 17 | 18 | WhatsAppLinkPreview whatsapp = WhatsAppLinkPreview(); 19 | 20 | void main() { 21 | runApp(MaterialApp( 22 | home: Scaffold( 23 | body: Center( 24 | child: whatsapp.build('https://whatsapp.com') 25 | ), 26 | ), 27 | )); 28 | } 29 | ``` -------------------------------------------------------------------------------- /android/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | link_preview 4 | Project link_preview created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir=../example/android 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /android/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=13 3 | org.eclipse.jdt.core.compiler.compliance=13 4 | org.eclipse.jdt.core.compiler.source=13 5 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'io.flutter.plugins.linkpreview' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:3.2.1' 12 | } 13 | } 14 | 15 | rootProject.allprojects { 16 | repositories { 17 | google() 18 | jcenter() 19 | } 20 | } 21 | 22 | apply plugin: 'com.android.library' 23 | 24 | android { 25 | compileSdkVersion 27 26 | 27 | defaultConfig { 28 | minSdkVersion 16 29 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 30 | } 31 | lintOptions { 32 | disable 'InvalidPackage' 33 | } 34 | dependencies { 35 | implementation 'org.jsoup:jsoup:1.11.3' 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'link_preview' 2 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/java/io/flutter/plugins/linkpreview/LinkPreviewPlugin.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins.linkpreview; 2 | 3 | import android.webkit.URLUtil; 4 | import android.os.Handler; 5 | 6 | import org.jsoup.Jsoup; 7 | import org.jsoup.nodes.Document; 8 | import org.jsoup.nodes.Element; 9 | import org.jsoup.select.Elements; 10 | 11 | import java.io.IOException; 12 | import java.net.URI; 13 | import java.net.URISyntaxException; 14 | import java.util.HashMap; 15 | import java.util.Map; 16 | 17 | import io.flutter.plugin.common.MethodCall; 18 | import io.flutter.plugin.common.MethodChannel; 19 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler; 20 | import io.flutter.plugin.common.MethodChannel.Result; 21 | import io.flutter.plugin.common.PluginRegistry.Registrar; 22 | 23 | public class LinkPreviewPlugin implements MethodCallHandler { 24 | private final Registrar registrar; 25 | final private Handler mainHandler = new Handler(); 26 | 27 | public static void registerWith(Registrar registrar) { 28 | final MethodChannel channel = new MethodChannel(registrar.messenger(), "plugins.flutter.io/link_preview"); 29 | LinkPreviewPlugin instance = new LinkPreviewPlugin(registrar); 30 | channel.setMethodCallHandler(instance); 31 | } 32 | 33 | private LinkPreviewPlugin(Registrar registrar) { 34 | this.registrar = registrar; 35 | } 36 | 37 | @Override 38 | public void onMethodCall(MethodCall call, Result result) { 39 | if (call.method.equals("metaData")) { 40 | handleUrlMetaData(call, result); 41 | } else { 42 | result.notImplemented(); 43 | } 44 | } 45 | 46 | private void handleUrlMetaData(MethodCall call, final Result result) { 47 | @SuppressWarnings("unchecked") 48 | Map arguments = (Map) call.arguments; 49 | final String url = (String) arguments.get("url"); 50 | new Thread(new Runnable() { 51 | @Override 52 | public void run() { 53 | final MetaData metaData = new MetaData(); 54 | try { 55 | Document doc = Jsoup.connect(url).timeout(5 * 1000).get(); 56 | Elements elements = doc.getElementsByTag("meta"); 57 | // getTitle doc.select("meta[property=og:title]") 58 | String title = doc.select("meta[property=og:title]").attr("content"); 59 | if (title == null || title.isEmpty()) { 60 | title = doc.title(); 61 | } 62 | metaData.setTitle(title); 63 | 64 | // getDescription 65 | String description = doc.select("meta[name=description]").attr("content"); 66 | if (description.isEmpty() || description == null) { 67 | description = doc.select("meta[name=Description]").attr("content"); 68 | } 69 | if (description.isEmpty() || description == null) { 70 | description = doc.select("meta[property=og:description]").attr("content"); 71 | } 72 | if (description.isEmpty() || description == null) { 73 | description = ""; 74 | } 75 | metaData.setDescription(description); 76 | 77 | // getMediaType 78 | Elements mediaTypes = doc.select("meta[name=medium]"); 79 | String type = ""; 80 | if (mediaTypes.size() > 0) { 81 | String media = mediaTypes.attr("content"); 82 | type = media.equals("image") ? "photo" : media; 83 | } else { 84 | type = doc.select("meta[property=og:type]").attr("content"); 85 | } 86 | metaData.setMediatype(type); 87 | 88 | // getImages 89 | Elements imageElements = doc.select("meta[property=og:image]"); 90 | if (imageElements.size() > 0) { 91 | String image = imageElements.attr("content"); 92 | if (!image.isEmpty()) { 93 | metaData.setImageurl(resolveURL(url, image)); 94 | } 95 | } 96 | if (metaData.getImageurl() == null || metaData.getImageurl().isEmpty()) { 97 | String src = doc.select("link[rel=image_src]").attr("href"); 98 | if (!src.isEmpty()) { 99 | metaData.setImageurl(resolveURL(url, src)); 100 | } else { 101 | src = doc.select("link[rel=apple-touch-icon]").attr("href"); 102 | if (!src.isEmpty()) { 103 | metaData.setImageurl(resolveURL(url, src)); 104 | metaData.setFavicon(resolveURL(url, src)); 105 | } else { 106 | src = doc.select("link[rel=icon]").attr("href"); 107 | if (!src.isEmpty()) { 108 | metaData.setImageurl(resolveURL(url, src)); 109 | metaData.setFavicon(resolveURL(url, src)); 110 | } 111 | } 112 | } 113 | } 114 | // Favicon 115 | String src = doc.select("link[rel=apple-touch-icon]").attr("href"); 116 | if (!src.isEmpty()) { 117 | metaData.setFavicon(resolveURL(url, src)); 118 | } else { 119 | src = doc.select("link[rel=icon]").attr("href"); 120 | if (!src.isEmpty()) { 121 | metaData.setFavicon(resolveURL(url, src)); 122 | } 123 | } 124 | for (Element element : elements) { 125 | if (element.hasAttr("property")) { 126 | String str_property = element.attr("property").toString().trim(); 127 | if (str_property.equals("og:url")) { 128 | metaData.setUrl(element.attr("content").toString()); 129 | } 130 | if (str_property.equals("og:site_name")) { 131 | metaData.setSitename(element.attr("content").toString()); 132 | } 133 | } 134 | } 135 | if (metaData.getUrl() == null || (metaData.getUrl().equals("") || metaData.getUrl().isEmpty())) { 136 | URI uri = null; 137 | try { 138 | uri = new URI(url); 139 | if (url == null) { 140 | metaData.setUrl(url); 141 | } else { 142 | metaData.setUrl(uri.getHost()); 143 | } 144 | } catch (URISyntaxException e) { 145 | e.printStackTrace(); 146 | } 147 | } 148 | } catch (IOException e) { 149 | e.printStackTrace(); 150 | } 151 | mainHandler.post(new Runnable() { 152 | @Override 153 | public void run() { 154 | result.success(metaData.toJSON()); 155 | } 156 | }); 157 | } 158 | }).start(); 159 | } 160 | 161 | private String resolveURL(String url, String part) { 162 | if (URLUtil.isValidUrl(part)) { 163 | return part; 164 | } else { 165 | URI base_uri = null; 166 | try { 167 | base_uri = new URI(url); 168 | } catch (URISyntaxException e) { 169 | e.printStackTrace(); 170 | } 171 | base_uri = base_uri.resolve(part); 172 | return base_uri.toString(); 173 | } 174 | } 175 | } 176 | -------------------------------------------------------------------------------- /android/src/main/java/io/flutter/plugins/linkpreview/MetaData.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins.linkpreview; 2 | import java.util.HashMap; 3 | import java.util.Map; 4 | 5 | public class MetaData { 6 | 7 | private String url = null; 8 | private String imageurl = null; 9 | private String title = null; 10 | private String description = null; 11 | private String sitename = null; 12 | private String mediatype = null; 13 | private String favicon = null; 14 | 15 | public String getUrl() { 16 | return url; 17 | } 18 | public void setUrl(String url) { 19 | this.url = url; 20 | } 21 | public String getImageurl() { 22 | return imageurl; 23 | } 24 | public void setImageurl(String imageurl) { 25 | this.imageurl = imageurl; 26 | } 27 | public String getTitle() { 28 | return title; 29 | } 30 | public void setTitle(String title) { 31 | this.title = title; 32 | } 33 | public String getDescription() { 34 | return description; 35 | } 36 | public void setDescription(String description) { 37 | this.description = description; 38 | } 39 | public String getSitename() { 40 | return sitename; 41 | } 42 | public void setSitename(String sitename) { 43 | this.sitename = sitename; 44 | } 45 | public String getMediatype() { 46 | return mediatype; 47 | } 48 | public void setMediatype(String mediatype) { 49 | this.mediatype = mediatype; 50 | } 51 | public String getFavicon() { 52 | return favicon; 53 | } 54 | public void setFavicon(String favicon) { 55 | this.favicon = favicon; 56 | } 57 | public Map toJSON(){ 58 | Map parameters = new HashMap<>(); 59 | parameters.put("url", this.url); 60 | parameters.put("image_url", this.imageurl); 61 | parameters.put("title", this.title); 62 | parameters.put("description", this.description); 63 | parameters.put("sitename", this.sitename); 64 | parameters.put("media_type", this.mediatype); 65 | parameters.put("favicon", this.favicon); 66 | return parameters; 67 | } 68 | } -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.lock 4 | *.log 5 | *.pyc 6 | *.swp 7 | .DS_Store 8 | .atom/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # Visual Studio Code related 20 | .vscode/ 21 | 22 | # Flutter/Dart/Pub related 23 | **/doc/api/ 24 | .dart_tool/ 25 | .flutter-plugins 26 | .packages 27 | .pub-cache/ 28 | .pub/ 29 | build/ 30 | 31 | # Android related 32 | **/android/**/gradle-wrapper.jar 33 | **/android/.gradle 34 | **/android/captures/ 35 | **/android/gradlew 36 | **/android/gradlew.bat 37 | **/android/local.properties 38 | **/android/**/GeneratedPluginRegistrant.java 39 | 40 | # iOS/XCode related 41 | **/ios/**/*.mode1v3 42 | **/ios/**/*.mode2v3 43 | **/ios/**/*.moved-aside 44 | **/ios/**/*.pbxuser 45 | **/ios/**/*.perspectivev3 46 | **/ios/**/*sync/ 47 | **/ios/**/.sconsign.dblite 48 | **/ios/**/.tags* 49 | **/ios/**/.vagrant/ 50 | **/ios/**/DerivedData/ 51 | **/ios/**/Icon? 52 | **/ios/**/Pods/ 53 | **/ios/**/.symlinks/ 54 | **/ios/**/profile 55 | **/ios/**/xcuserdata 56 | **/ios/.generated/ 57 | **/ios/Flutter/App.framework 58 | **/ios/Flutter/Flutter.framework 59 | **/ios/Flutter/Generated.xcconfig 60 | **/ios/Flutter/app.flx 61 | **/ios/Flutter/app.zip 62 | **/ios/Flutter/flutter_assets/ 63 | **/ios/ServiceDefinitions.json 64 | **/ios/Runner/GeneratedPluginRegistrant.* 65 | 66 | # Exceptions to above rules. 67 | !**/ios/**/default.mode1v3 68 | !**/ios/**/default.mode2v3 69 | !**/ios/**/default.pbxuser 70 | !**/ios/**/default.perspectivev3 71 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 72 | -------------------------------------------------------------------------------- /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: 5391447fae6209bb21a89e6a5a6583cac1af9b4b 8 | channel: dev 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # link_preview_example 2 | 3 | Demonstrates how to use the link_preview plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.io/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.io/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.io/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android 4 | Project android created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.buildship.core.gradleprojectbuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.buildship.core.gradleprojectnature 16 | 17 | 18 | -------------------------------------------------------------------------------- /example/android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir= 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /example/android/app/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /example/android/app/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | app 4 | Project app created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /example/android/app/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir=.. 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /example/android/app/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=13 3 | org.eclipse.jdt.core.compiler.compliance=13 4 | org.eclipse.jdt.core.compiler.source=13 5 | -------------------------------------------------------------------------------- /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 from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 27 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "io.flutter.plugins.linkpreview.linkpreviewexample" 37 | minSdkVersion 16 38 | targetSdkVersion 27 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 61 | } 62 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 10 | 17 | 21 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/io/flutter/plugins/linkpreview/linkpreviewexample/MainActivity.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins.linkpreview.linkpreviewexample; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.2.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /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-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/flutter_export_environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This is a generated file; do not edit or check into version control. 3 | export "FLUTTER_ROOT=/Users/dennysegura/development/flutter" 4 | export "FLUTTER_APPLICATION_PATH=/Users/dennysegura/Dev/Flutter/flutter-link-preview/example" 5 | export "FLUTTER_TARGET=lib/main.dart" 6 | export "FLUTTER_BUILD_DIR=build" 7 | export "SYMROOT=${SOURCE_ROOT}/../build/ios" 8 | export "FLUTTER_FRAMEWORK_DIR=/Users/dennysegura/development/flutter/bin/cache/artifacts/engine/ios" 9 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def parse_KV_file(file, separator='=') 14 | file_abs_path = File.expand_path(file) 15 | if !File.exists? file_abs_path 16 | return []; 17 | end 18 | pods_ary = [] 19 | skip_line_start_symbols = ["#", "/"] 20 | File.foreach(file_abs_path) { |line| 21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } 22 | plugin = line.split(pattern=separator) 23 | if plugin.length == 2 24 | podname = plugin[0].strip() 25 | path = plugin[1].strip() 26 | podpath = File.expand_path("#{path}", file_abs_path) 27 | pods_ary.push({:name => podname, :path => podpath}); 28 | else 29 | puts "Invalid plugin specification: #{line}" 30 | end 31 | } 32 | return pods_ary 33 | end 34 | 35 | target 'Runner' do 36 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock 37 | # referring to absolute paths on developers' machines. 38 | system('rm -rf .symlinks') 39 | system('mkdir -p .symlinks/plugins') 40 | 41 | # Flutter Pods 42 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') 43 | if generated_xcode_build_settings.empty? 44 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first." 45 | end 46 | generated_xcode_build_settings.map { |p| 47 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR' 48 | symlink = File.join('.symlinks', 'flutter') 49 | File.symlink(File.dirname(p[:path]), symlink) 50 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) 51 | end 52 | } 53 | 54 | # Plugin Pods 55 | plugin_pods = parse_KV_file('../.flutter-plugins') 56 | plugin_pods.map { |p| 57 | symlink = File.join('.symlinks', 'plugins', p[:name]) 58 | File.symlink(p[:path], symlink) 59 | pod p[:name], :path => File.join(symlink, 'ios') 60 | } 61 | end 62 | 63 | post_install do |installer| 64 | installer.pods_project.targets.each do |target| 65 | target.build_configurations.each do |config| 66 | config.build_settings['ENABLE_BITCODE'] = 'NO' 67 | end 68 | end 69 | end 70 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; }; 12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 13 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 14 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 18 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 19 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 20 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 21 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 22 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXCopyFilesBuildPhase section */ 26 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 27 | isa = PBXCopyFilesBuildPhase; 28 | buildActionMask = 2147483647; 29 | dstPath = ""; 30 | dstSubfolderSpec = 10; 31 | files = ( 32 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 33 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 34 | ); 35 | name = "Embed Frameworks"; 36 | runOnlyForDeploymentPostprocessing = 0; 37 | }; 38 | /* End PBXCopyFilesBuildPhase section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 42 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 43 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; 44 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 45 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 46 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 47 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 48 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 49 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 50 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 51 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 52 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 54 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 55 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 56 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 57 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 58 | /* End PBXFileReference section */ 59 | 60 | /* Begin PBXFrameworksBuildPhase section */ 61 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 66 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 67 | ); 68 | runOnlyForDeploymentPostprocessing = 0; 69 | }; 70 | /* End PBXFrameworksBuildPhase section */ 71 | 72 | /* Begin PBXGroup section */ 73 | 9740EEB11CF90186004384FC /* Flutter */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, 77 | 3B80C3931E831B6300D905FE /* App.framework */, 78 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 79 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 80 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 81 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 82 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 83 | ); 84 | name = Flutter; 85 | sourceTree = ""; 86 | }; 87 | 97C146E51CF9000F007C117D = { 88 | isa = PBXGroup; 89 | children = ( 90 | 9740EEB11CF90186004384FC /* Flutter */, 91 | 97C146F01CF9000F007C117D /* Runner */, 92 | 97C146EF1CF9000F007C117D /* Products */, 93 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, 94 | ); 95 | sourceTree = ""; 96 | }; 97 | 97C146EF1CF9000F007C117D /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 97C146EE1CF9000F007C117D /* Runner.app */, 101 | ); 102 | name = Products; 103 | sourceTree = ""; 104 | }; 105 | 97C146F01CF9000F007C117D /* Runner */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 109 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 110 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 111 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 112 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 113 | 97C147021CF9000F007C117D /* Info.plist */, 114 | 97C146F11CF9000F007C117D /* Supporting Files */, 115 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 116 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 117 | ); 118 | path = Runner; 119 | sourceTree = ""; 120 | }; 121 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 97C146F21CF9000F007C117D /* main.m */, 125 | ); 126 | name = "Supporting Files"; 127 | sourceTree = ""; 128 | }; 129 | /* End PBXGroup section */ 130 | 131 | /* Begin PBXNativeTarget section */ 132 | 97C146ED1CF9000F007C117D /* Runner */ = { 133 | isa = PBXNativeTarget; 134 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 135 | buildPhases = ( 136 | 9740EEB61CF901F6004384FC /* Run Script */, 137 | 97C146EA1CF9000F007C117D /* Sources */, 138 | 97C146EB1CF9000F007C117D /* Frameworks */, 139 | 97C146EC1CF9000F007C117D /* Resources */, 140 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 141 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 142 | ); 143 | buildRules = ( 144 | ); 145 | dependencies = ( 146 | ); 147 | name = Runner; 148 | productName = Runner; 149 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 150 | productType = "com.apple.product-type.application"; 151 | }; 152 | /* End PBXNativeTarget section */ 153 | 154 | /* Begin PBXProject section */ 155 | 97C146E61CF9000F007C117D /* Project object */ = { 156 | isa = PBXProject; 157 | attributes = { 158 | LastUpgradeCheck = 0910; 159 | ORGANIZATIONNAME = "The Chromium Authors"; 160 | TargetAttributes = { 161 | 97C146ED1CF9000F007C117D = { 162 | CreatedOnToolsVersion = 7.3.1; 163 | }; 164 | }; 165 | }; 166 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 167 | compatibilityVersion = "Xcode 3.2"; 168 | developmentRegion = English; 169 | hasScannedForEncodings = 0; 170 | knownRegions = ( 171 | en, 172 | Base, 173 | ); 174 | mainGroup = 97C146E51CF9000F007C117D; 175 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 176 | projectDirPath = ""; 177 | projectRoot = ""; 178 | targets = ( 179 | 97C146ED1CF9000F007C117D /* Runner */, 180 | ); 181 | }; 182 | /* End PBXProject section */ 183 | 184 | /* Begin PBXResourcesBuildPhase section */ 185 | 97C146EC1CF9000F007C117D /* Resources */ = { 186 | isa = PBXResourcesBuildPhase; 187 | buildActionMask = 2147483647; 188 | files = ( 189 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 190 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 191 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 192 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 193 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, 194 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | }; 198 | /* End PBXResourcesBuildPhase section */ 199 | 200 | /* Begin PBXShellScriptBuildPhase section */ 201 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 202 | isa = PBXShellScriptBuildPhase; 203 | buildActionMask = 2147483647; 204 | files = ( 205 | ); 206 | inputPaths = ( 207 | ); 208 | name = "Thin Binary"; 209 | outputPaths = ( 210 | ); 211 | runOnlyForDeploymentPostprocessing = 0; 212 | shellPath = /bin/sh; 213 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 214 | }; 215 | 9740EEB61CF901F6004384FC /* Run Script */ = { 216 | isa = PBXShellScriptBuildPhase; 217 | buildActionMask = 2147483647; 218 | files = ( 219 | ); 220 | inputPaths = ( 221 | ); 222 | name = "Run Script"; 223 | outputPaths = ( 224 | ); 225 | runOnlyForDeploymentPostprocessing = 0; 226 | shellPath = /bin/sh; 227 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 228 | }; 229 | /* End PBXShellScriptBuildPhase section */ 230 | 231 | /* Begin PBXSourcesBuildPhase section */ 232 | 97C146EA1CF9000F007C117D /* Sources */ = { 233 | isa = PBXSourcesBuildPhase; 234 | buildActionMask = 2147483647; 235 | files = ( 236 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 237 | 97C146F31CF9000F007C117D /* main.m in Sources */, 238 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | }; 242 | /* End PBXSourcesBuildPhase section */ 243 | 244 | /* Begin PBXVariantGroup section */ 245 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 246 | isa = PBXVariantGroup; 247 | children = ( 248 | 97C146FB1CF9000F007C117D /* Base */, 249 | ); 250 | name = Main.storyboard; 251 | sourceTree = ""; 252 | }; 253 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 254 | isa = PBXVariantGroup; 255 | children = ( 256 | 97C147001CF9000F007C117D /* Base */, 257 | ); 258 | name = LaunchScreen.storyboard; 259 | sourceTree = ""; 260 | }; 261 | /* End PBXVariantGroup section */ 262 | 263 | /* Begin XCBuildConfiguration section */ 264 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 265 | isa = XCBuildConfiguration; 266 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 267 | buildSettings = { 268 | ALWAYS_SEARCH_USER_PATHS = NO; 269 | CLANG_ANALYZER_NONNULL = YES; 270 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 271 | CLANG_CXX_LIBRARY = "libc++"; 272 | CLANG_ENABLE_MODULES = YES; 273 | CLANG_ENABLE_OBJC_ARC = YES; 274 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 275 | CLANG_WARN_BOOL_CONVERSION = YES; 276 | CLANG_WARN_COMMA = YES; 277 | CLANG_WARN_CONSTANT_CONVERSION = YES; 278 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 279 | CLANG_WARN_EMPTY_BODY = YES; 280 | CLANG_WARN_ENUM_CONVERSION = YES; 281 | CLANG_WARN_INFINITE_RECURSION = YES; 282 | CLANG_WARN_INT_CONVERSION = YES; 283 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 284 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 285 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 286 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 287 | CLANG_WARN_STRICT_PROTOTYPES = YES; 288 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 289 | CLANG_WARN_UNREACHABLE_CODE = YES; 290 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 291 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 292 | COPY_PHASE_STRIP = NO; 293 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 294 | ENABLE_NS_ASSERTIONS = NO; 295 | ENABLE_STRICT_OBJC_MSGSEND = YES; 296 | GCC_C_LANGUAGE_STANDARD = gnu99; 297 | GCC_NO_COMMON_BLOCKS = YES; 298 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 299 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 300 | GCC_WARN_UNDECLARED_SELECTOR = YES; 301 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 302 | GCC_WARN_UNUSED_FUNCTION = YES; 303 | GCC_WARN_UNUSED_VARIABLE = YES; 304 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 305 | MTL_ENABLE_DEBUG_INFO = NO; 306 | SDKROOT = iphoneos; 307 | TARGETED_DEVICE_FAMILY = "1,2"; 308 | VALIDATE_PRODUCT = YES; 309 | }; 310 | name = Profile; 311 | }; 312 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 313 | isa = XCBuildConfiguration; 314 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 315 | buildSettings = { 316 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 317 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 318 | DEVELOPMENT_TEAM = S8QB4VV633; 319 | ENABLE_BITCODE = NO; 320 | FRAMEWORK_SEARCH_PATHS = ( 321 | "$(inherited)", 322 | "$(PROJECT_DIR)/Flutter", 323 | ); 324 | INFOPLIST_FILE = Runner/Info.plist; 325 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 326 | LIBRARY_SEARCH_PATHS = ( 327 | "$(inherited)", 328 | "$(PROJECT_DIR)/Flutter", 329 | ); 330 | PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.linkpreview.linkPreviewExample; 331 | PRODUCT_NAME = "$(TARGET_NAME)"; 332 | VERSIONING_SYSTEM = "apple-generic"; 333 | }; 334 | name = Profile; 335 | }; 336 | 97C147031CF9000F007C117D /* Debug */ = { 337 | isa = XCBuildConfiguration; 338 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 339 | buildSettings = { 340 | ALWAYS_SEARCH_USER_PATHS = NO; 341 | CLANG_ANALYZER_NONNULL = YES; 342 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 343 | CLANG_CXX_LIBRARY = "libc++"; 344 | CLANG_ENABLE_MODULES = YES; 345 | CLANG_ENABLE_OBJC_ARC = YES; 346 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 347 | CLANG_WARN_BOOL_CONVERSION = YES; 348 | CLANG_WARN_COMMA = YES; 349 | CLANG_WARN_CONSTANT_CONVERSION = YES; 350 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 351 | CLANG_WARN_EMPTY_BODY = YES; 352 | CLANG_WARN_ENUM_CONVERSION = YES; 353 | CLANG_WARN_INFINITE_RECURSION = YES; 354 | CLANG_WARN_INT_CONVERSION = YES; 355 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 356 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 357 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 358 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 359 | CLANG_WARN_STRICT_PROTOTYPES = YES; 360 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 361 | CLANG_WARN_UNREACHABLE_CODE = YES; 362 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 363 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 364 | COPY_PHASE_STRIP = NO; 365 | DEBUG_INFORMATION_FORMAT = dwarf; 366 | ENABLE_STRICT_OBJC_MSGSEND = YES; 367 | ENABLE_TESTABILITY = YES; 368 | GCC_C_LANGUAGE_STANDARD = gnu99; 369 | GCC_DYNAMIC_NO_PIC = NO; 370 | GCC_NO_COMMON_BLOCKS = YES; 371 | GCC_OPTIMIZATION_LEVEL = 0; 372 | GCC_PREPROCESSOR_DEFINITIONS = ( 373 | "DEBUG=1", 374 | "$(inherited)", 375 | ); 376 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 377 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 378 | GCC_WARN_UNDECLARED_SELECTOR = YES; 379 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 380 | GCC_WARN_UNUSED_FUNCTION = YES; 381 | GCC_WARN_UNUSED_VARIABLE = YES; 382 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 383 | MTL_ENABLE_DEBUG_INFO = YES; 384 | ONLY_ACTIVE_ARCH = YES; 385 | SDKROOT = iphoneos; 386 | TARGETED_DEVICE_FAMILY = "1,2"; 387 | }; 388 | name = Debug; 389 | }; 390 | 97C147041CF9000F007C117D /* Release */ = { 391 | isa = XCBuildConfiguration; 392 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 393 | buildSettings = { 394 | ALWAYS_SEARCH_USER_PATHS = NO; 395 | CLANG_ANALYZER_NONNULL = YES; 396 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 397 | CLANG_CXX_LIBRARY = "libc++"; 398 | CLANG_ENABLE_MODULES = YES; 399 | CLANG_ENABLE_OBJC_ARC = YES; 400 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 401 | CLANG_WARN_BOOL_CONVERSION = YES; 402 | CLANG_WARN_COMMA = YES; 403 | CLANG_WARN_CONSTANT_CONVERSION = YES; 404 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 405 | CLANG_WARN_EMPTY_BODY = YES; 406 | CLANG_WARN_ENUM_CONVERSION = YES; 407 | CLANG_WARN_INFINITE_RECURSION = YES; 408 | CLANG_WARN_INT_CONVERSION = YES; 409 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 410 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 411 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 412 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 413 | CLANG_WARN_STRICT_PROTOTYPES = YES; 414 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 415 | CLANG_WARN_UNREACHABLE_CODE = YES; 416 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 417 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 418 | COPY_PHASE_STRIP = NO; 419 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 420 | ENABLE_NS_ASSERTIONS = NO; 421 | ENABLE_STRICT_OBJC_MSGSEND = YES; 422 | GCC_C_LANGUAGE_STANDARD = gnu99; 423 | GCC_NO_COMMON_BLOCKS = YES; 424 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 425 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 426 | GCC_WARN_UNDECLARED_SELECTOR = YES; 427 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 428 | GCC_WARN_UNUSED_FUNCTION = YES; 429 | GCC_WARN_UNUSED_VARIABLE = YES; 430 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 431 | MTL_ENABLE_DEBUG_INFO = NO; 432 | SDKROOT = iphoneos; 433 | TARGETED_DEVICE_FAMILY = "1,2"; 434 | VALIDATE_PRODUCT = YES; 435 | }; 436 | name = Release; 437 | }; 438 | 97C147061CF9000F007C117D /* Debug */ = { 439 | isa = XCBuildConfiguration; 440 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 441 | buildSettings = { 442 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 443 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 444 | ENABLE_BITCODE = NO; 445 | FRAMEWORK_SEARCH_PATHS = ( 446 | "$(inherited)", 447 | "$(PROJECT_DIR)/Flutter", 448 | ); 449 | INFOPLIST_FILE = Runner/Info.plist; 450 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 451 | LIBRARY_SEARCH_PATHS = ( 452 | "$(inherited)", 453 | "$(PROJECT_DIR)/Flutter", 454 | ); 455 | PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.linkpreview.linkPreviewExample; 456 | PRODUCT_NAME = "$(TARGET_NAME)"; 457 | VERSIONING_SYSTEM = "apple-generic"; 458 | }; 459 | name = Debug; 460 | }; 461 | 97C147071CF9000F007C117D /* Release */ = { 462 | isa = XCBuildConfiguration; 463 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 464 | buildSettings = { 465 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 466 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 467 | ENABLE_BITCODE = NO; 468 | FRAMEWORK_SEARCH_PATHS = ( 469 | "$(inherited)", 470 | "$(PROJECT_DIR)/Flutter", 471 | ); 472 | INFOPLIST_FILE = Runner/Info.plist; 473 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 474 | LIBRARY_SEARCH_PATHS = ( 475 | "$(inherited)", 476 | "$(PROJECT_DIR)/Flutter", 477 | ); 478 | PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.linkpreview.linkPreviewExample; 479 | PRODUCT_NAME = "$(TARGET_NAME)"; 480 | VERSIONING_SYSTEM = "apple-generic"; 481 | }; 482 | name = Release; 483 | }; 484 | /* End XCBuildConfiguration section */ 485 | 486 | /* Begin XCConfigurationList section */ 487 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 488 | isa = XCConfigurationList; 489 | buildConfigurations = ( 490 | 97C147031CF9000F007C117D /* Debug */, 491 | 97C147041CF9000F007C117D /* Release */, 492 | 249021D3217E4FDB00AE95B9 /* Profile */, 493 | ); 494 | defaultConfigurationIsVisible = 0; 495 | defaultConfigurationName = Release; 496 | }; 497 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 498 | isa = XCConfigurationList; 499 | buildConfigurations = ( 500 | 97C147061CF9000F007C117D /* Debug */, 501 | 97C147071CF9000F007C117D /* Release */, 502 | 249021D4217E4FDB00AE95B9 /* Profile */, 503 | ); 504 | defaultConfigurationIsVisible = 0; 505 | defaultConfigurationName = Release; 506 | }; 507 | /* End XCConfigurationList section */ 508 | }; 509 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 510 | } 511 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | link_preview_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 | -------------------------------------------------------------------------------- /example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'dart:async'; 3 | 4 | import 'package:flutter/services.dart'; 5 | import 'package:link_preview/link_preview.dart'; 6 | 7 | void main() => runApp(MyApp()); 8 | 9 | class MyApp extends StatefulWidget { 10 | @override 11 | _MyAppState createState() => _MyAppState(); 12 | } 13 | 14 | class _MyAppState extends State { 15 | LinkPreview previwer = LinkPreview(); 16 | WhatsAppLinkPreview wspPreview = WhatsAppLinkPreview(); 17 | LinkedInLinkPreview liPreview = LinkedInLinkPreview(); 18 | TwitterLinkPreview twPreview = TwitterLinkPreview(); 19 | TelegramLinkPreview tPreview = TelegramLinkPreview(); 20 | SkypeLinkPreview skPreview = SkypeLinkPreview(); 21 | 22 | Future _message = Future.value(''); 23 | @override 24 | void initState() { 25 | super.initState(); 26 | } 27 | 28 | Future initMetaDataState() async { 29 | dynamic linkPreview; 30 | try { 31 | linkPreview = await previwer.getUrlMetaData(url: 'https://flutter.io'); 32 | } on PlatformException catch (e) { 33 | debugPrint(e.message); 34 | linkPreview = 'Failed to get platform version.'; 35 | } 36 | return linkPreview.toString(); 37 | } 38 | 39 | @override 40 | Widget build(BuildContext context) { 41 | return MaterialApp( 42 | home: Scaffold( 43 | backgroundColor: Color.fromRGBO(241, 243, 244, 1.0), 44 | appBar: AppBar( 45 | title: const Text('Rich Link Preview example app'), 46 | ), 47 | body: SingleChildScrollView( 48 | controller: ScrollController(), 49 | child: Column( 50 | mainAxisAlignment: MainAxisAlignment.start, 51 | crossAxisAlignment: CrossAxisAlignment.start, 52 | children: [ 53 | Container( 54 | margin: EdgeInsets.symmetric(vertical: 4.0), 55 | child: wspPreview.build('https://whatsapp.com')), 56 | Container( 57 | margin: EdgeInsets.symmetric(vertical: 4.0), 58 | child: tPreview.build('https://telegram.org')), 59 | Container( 60 | margin: EdgeInsets.symmetric(vertical: 4.0), 61 | child: skPreview.build('https://skype.com')), 62 | Container( 63 | margin: EdgeInsets.symmetric(vertical: 4.0), 64 | child: twPreview.build('https://twitter.com')), 65 | Container( 66 | margin: EdgeInsets.symmetric(vertical: 4.0), 67 | child: liPreview.build('https://linkedin.com')), 68 | MaterialButton( 69 | onPressed: () { 70 | setState(() { 71 | _message = initMetaDataState(); 72 | }); 73 | }, 74 | textColor: Colors.white, 75 | child: Text('Test Flutter Preview Metadata'), 76 | color: Color.fromRGBO(19, 137, 253, 1.0), 77 | ), 78 | FutureBuilder( 79 | future: _message, 80 | builder: (_, AsyncSnapshot snapshot) { 81 | return Text(snapshot.data ?? ''); 82 | }, 83 | ), 84 | ], 85 | ), 86 | ), 87 | ), 88 | ); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: link_preview_example 2 | description: Demonstrates how to use the link_preview plugin. 3 | publish_to: 'none' 4 | 5 | environment: 6 | sdk: ">=2.0.0-dev.68.0 <3.0.0" 7 | 8 | dependencies: 9 | flutter: 10 | sdk: flutter 11 | 12 | cupertino_icons: ^0.1.2 13 | 14 | dev_dependencies: 15 | flutter_test: 16 | sdk: flutter 17 | 18 | link_preview: 19 | path: ../ 20 | 21 | flutter: 22 | uses-material-design: true -------------------------------------------------------------------------------- /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:link_preview_example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Verify Platform version', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that platform version is retrieved. 19 | expect( 20 | find.byWidgetPredicate( 21 | (Widget widget) => widget is Text && 22 | widget.data.startsWith('Running on:'), 23 | ), 24 | findsOneWidget, 25 | ); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | -------------------------------------------------------------------------------- /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /ios/Classes/LinkPreviewPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface LinkPreviewPlugin : NSObject 4 | @end 5 | -------------------------------------------------------------------------------- /ios/Classes/LinkPreviewPlugin.m: -------------------------------------------------------------------------------- 1 | #import "LinkPreviewPlugin.h" 2 | 3 | @implementation LinkPreviewPlugin 4 | + (void)registerWithRegistrar:(NSObject*)registrar { 5 | FlutterMethodChannel* channel = [FlutterMethodChannel 6 | methodChannelWithName:@"link_preview" 7 | binaryMessenger:[registrar messenger]]; 8 | LinkPreviewPlugin* instance = [[LinkPreviewPlugin alloc] init]; 9 | [registrar addMethodCallDelegate:instance channel:channel]; 10 | } 11 | 12 | - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { 13 | if ([@"getPlatformVersion" isEqualToString:call.method]) { 14 | result([@"iOS " stringByAppendingString:[[UIDevice currentDevice] systemVersion]]); 15 | } else { 16 | result(FlutterMethodNotImplemented); 17 | } 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /ios/link_preview.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 3 | # 4 | Pod::Spec.new do |s| 5 | s.name = 'link_preview' 6 | s.version = '0.0.1' 7 | s.summary = 'A new flutter plugin project.' 8 | s.description = <<-DESC 9 | A new flutter plugin project. 10 | DESC 11 | s.homepage = 'http://example.com' 12 | s.license = { :file => '../LICENSE' } 13 | s.author = { 'Your Company' => 'email@example.com' } 14 | s.source = { :path => '.' } 15 | s.source_files = 'Classes/**/*' 16 | s.public_header_files = 'Classes/**/*.h' 17 | s.dependency 'Flutter' 18 | 19 | s.ios.deployment_target = '8.0' 20 | end 21 | 22 | -------------------------------------------------------------------------------- /lib/link_preview.dart: -------------------------------------------------------------------------------- 1 | library link_preview; 2 | 3 | import 'dart:async'; 4 | 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter/services.dart'; 7 | import 'package:flutter/widgets.dart'; 8 | 9 | import 'package:meta/meta.dart'; 10 | import 'package:async/async.dart'; 11 | 12 | part 'src/widget/preview_link.dart'; 13 | part 'src/widget/whatsapp/index.dart'; 14 | part 'src/widget/whatsapp/view.dart'; 15 | part 'src/widget/telegram/index.dart'; 16 | part 'src/widget/telegram/view.dart'; 17 | part 'src/widget/twitter/index.dart'; 18 | part 'src/widget/twitter/view.dart'; 19 | part 'src/widget/skype/index.dart'; 20 | part 'src/widget/skype/view.dart'; 21 | part 'src/widget/linkedin/index.dart'; 22 | part 'src/widget/linkedin/view.dart'; 23 | 24 | 25 | class LinkPreview { 26 | final MethodChannel _channel = 27 | MethodChannel('plugins.flutter.io/link_preview'); 28 | 29 | Future getUrlMetaData({@required String url}) async { 30 | return await _channel.invokeMethod('metaData', {'url': url}); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/src/widget/linkedin/index.dart: -------------------------------------------------------------------------------- 1 | part of link_preview; 2 | 3 | class LinkedInLinkPreview extends PreviewLink { 4 | build(String url) { 5 | return this.render(url, (dynamic body) { 6 | return LinkedInView( 7 | imageUrl: body['image_url'], 8 | title: body['title'].toString().split(':')[0], 9 | url: body['url'], 10 | description: body['description'], 11 | ); 12 | }); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/widget/linkedin/view.dart: -------------------------------------------------------------------------------- 1 | part of link_preview; 2 | 3 | class LinkedInView extends StatelessWidget { 4 | final String imageUrl; 5 | final String title; 6 | final String description; 7 | final String url; 8 | 9 | LinkedInView( 10 | {Key key, 11 | @required this.imageUrl, 12 | @required this.title, 13 | this.description, 14 | @required this.url}); 15 | 16 | Widget build(BuildContext context) { 17 | Size screenSize = MediaQuery.of(context).size; 18 | return Container( 19 | constraints: BoxConstraints(maxWidth: screenSize.width * 0.84), 20 | padding: EdgeInsets.only(bottom: 32.0, left: 4.0, top: 4.0, right: 4.0), 21 | color: Colors.white, 22 | child: Row( 23 | mainAxisAlignment: MainAxisAlignment.start, 24 | children: [ 25 | Padding( 26 | padding: EdgeInsets.symmetric(horizontal: 4.0), 27 | child: Container( 28 | margin: EdgeInsets.only(right: 16.0), 29 | height: screenSize.width * 0.18, 30 | width: screenSize.width * 0.18, 31 | color: Colors.white, 32 | child: Image.network( 33 | imageUrl, 34 | fit: BoxFit.contain, 35 | )), 36 | ), 37 | Column( 38 | mainAxisAlignment: MainAxisAlignment.start, 39 | crossAxisAlignment: CrossAxisAlignment.start, 40 | mainAxisSize: MainAxisSize.max, 41 | children: [ 42 | Container( 43 | width: screenSize.width * 0.57, 44 | child: Text( 45 | title, 46 | maxLines: 1, 47 | style: TextStyle( 48 | color: Colors.black, 49 | fontSize: 14.0, 50 | fontWeight: FontWeight.bold, 51 | ), 52 | ), 53 | ), 54 | Container( 55 | width: screenSize.width * 0.57, 56 | child: RichText( 57 | maxLines: 2, 58 | text: TextSpan( 59 | children: [ 60 | TextSpan( 61 | text: url, style: TextStyle(color: Colors.black54)), 62 | TextSpan( 63 | text: ' $description', 64 | style: 65 | TextStyle(color: Colors.black, fontSize: 12.0)), 66 | ], 67 | ), 68 | ), 69 | ), 70 | ], 71 | ), 72 | ], 73 | ), 74 | ); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /lib/src/widget/preview_link.dart: -------------------------------------------------------------------------------- 1 | part of link_preview; 2 | 3 | class PreviewLink { 4 | AsyncMemoizer memoizer; 5 | MethodChannel channel; 6 | PreviewLink() { 7 | this.channel = MethodChannel('plugins.flutter.io/link_preview'); 8 | this.memoizer = AsyncMemoizer(); 9 | } 10 | 11 | Widget render(String url, Function widget) { 12 | return FutureBuilder( 13 | future: this.getFuture('metaData', {'url': url}), 14 | builder: (context, snapshot) { 15 | return snapshot.connectionState == ConnectionState.done 16 | ? snapshot.hasError ? Container() : widget(snapshot.data) 17 | : Container(); 18 | }, 19 | ); 20 | } 21 | 22 | getFuture(String name, dynamic params) { 23 | return this.memoizer.runOnce(() async { 24 | return await channel.invokeMethod(name, params); 25 | }); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/src/widget/skype/index.dart: -------------------------------------------------------------------------------- 1 | part of link_preview; 2 | 3 | class SkypeLinkPreview extends PreviewLink { 4 | build(String url) { 5 | return this.render(url, (dynamic body) { 6 | return SkypeView( 7 | imageUrl: body['image_url'], 8 | title: body['title'], 9 | url: body['url'], 10 | favUrl: body['favicon'], 11 | description: body['description'], 12 | ); 13 | }); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/src/widget/skype/view.dart: -------------------------------------------------------------------------------- 1 | part of link_preview; 2 | 3 | class SkypeView extends StatelessWidget { 4 | final String imageUrl; 5 | final String title; 6 | final String description; 7 | final String url; 8 | final String favUrl; 9 | 10 | SkypeView( 11 | {Key key, 12 | @required this.imageUrl, 13 | @required this.title, 14 | this.description, 15 | @required this.url, 16 | this.favUrl}); 17 | 18 | Widget build(BuildContext context) { 19 | Size screenSize = MediaQuery.of(context).size; 20 | return Stack( 21 | children: [ 22 | Image( 23 | fit: BoxFit.contain, 24 | image: NetworkImage(imageUrl), 25 | height: screenSize.height * 0.25, 26 | width: screenSize.width * 0.84, 27 | ), 28 | Container( 29 | height: screenSize.height * 0.25, 30 | width: screenSize.width * 0.84, 31 | decoration: BoxDecoration( 32 | gradient: LinearGradient( 33 | begin: Alignment.topCenter, 34 | end: Alignment.bottomCenter, 35 | colors: [ 36 | Color.fromRGBO(0, 0, 0, 0.1), 37 | Color.fromRGBO(0, 0, 0, 0.3), 38 | ], 39 | ), 40 | ), 41 | ), 42 | Container( 43 | padding: EdgeInsets.symmetric(horizontal: 8.0), 44 | height: screenSize.height * 0.25, 45 | width: screenSize.width * 0.84, 46 | child: Column( 47 | mainAxisAlignment: MainAxisAlignment.end, 48 | crossAxisAlignment: CrossAxisAlignment.start, 49 | children: [ 50 | Container( 51 | margin: EdgeInsets.only(bottom: 8.0), 52 | width: screenSize.width * 0.80, 53 | child: Text( 54 | title, 55 | maxLines: 1, 56 | style: TextStyle( 57 | color: Colors.white, 58 | fontSize: 12.0, 59 | fontWeight: FontWeight.bold), 60 | ), 61 | ), 62 | Container( 63 | margin: EdgeInsets.only(bottom: 8.0), 64 | width: screenSize.width * 0.80, 65 | child: Text( 66 | description, 67 | maxLines: 2, 68 | overflow: TextOverflow.ellipsis, 69 | style: TextStyle(color: Colors.white, fontSize: 12.0), 70 | ), 71 | ), 72 | Row( 73 | children: [ 74 | Container( 75 | margin: EdgeInsets.only(right: 8.0), 76 | height: 20.0, 77 | width: 20.0, 78 | child: Image.network( 79 | favUrl, 80 | fit: BoxFit.contain, 81 | ), 82 | ), 83 | Text(url, 84 | style: TextStyle(color: Colors.white, fontSize: 12.0)) 85 | ], 86 | ), 87 | ], 88 | ), 89 | ) 90 | ], 91 | ); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /lib/src/widget/telegram/index.dart: -------------------------------------------------------------------------------- 1 | part of link_preview; 2 | 3 | class TelegramLinkPreview extends PreviewLink { 4 | build(String url) { 5 | return this.render(url, (dynamic body) { 6 | return TelegramView( 7 | imageUrl: body['image_url'], 8 | title: body['sitename'], 9 | url: body['url'], 10 | description: body['title'], 11 | ); 12 | }); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/widget/telegram/view.dart: -------------------------------------------------------------------------------- 1 | part of link_preview; 2 | 3 | class TelegramView extends StatelessWidget { 4 | final String url; 5 | final String imageUrl; 6 | final String title; 7 | final String description; 8 | final String newUrl; 9 | 10 | TelegramView({ 11 | Key key, 12 | @required this.url, 13 | @required this.imageUrl, 14 | @required this.title, 15 | @required this.description, 16 | }) : this.newUrl = url.contains('http') ? url : 'www.$url'; 17 | 18 | Widget build(BuildContext context) { 19 | Size screenSize = MediaQuery.of(context).size; 20 | return Container( 21 | constraints: BoxConstraints(maxWidth: screenSize.width * 0.84), 22 | padding: EdgeInsets.all(16.0), 23 | decoration: new BoxDecoration( 24 | color: Colors.white, 25 | borderRadius: new BorderRadius.circular(8.0), 26 | ), 27 | child: Column( 28 | mainAxisAlignment: MainAxisAlignment.start, 29 | crossAxisAlignment: CrossAxisAlignment.start, 30 | children: [ 31 | Text( 32 | newUrl, 33 | style: TextStyle( 34 | decoration: TextDecoration.underline, 35 | color: Color.fromRGBO(41, 158, 216, 1.0), 36 | fontSize: 10.0, 37 | ), 38 | ), 39 | Container( 40 | margin: EdgeInsets.only(top: 8.0), 41 | padding: EdgeInsets.all(8.0), 42 | decoration: BoxDecoration( 43 | border: Border( 44 | left: BorderSide( 45 | width: 2.0, 46 | color: Color.fromRGBO(41, 158, 216, 1.0), 47 | ), 48 | ), 49 | ), 50 | child: Row( 51 | mainAxisAlignment: MainAxisAlignment.start, 52 | crossAxisAlignment: CrossAxisAlignment.start, 53 | children: [ 54 | Container( 55 | child: Column( 56 | children: [ 57 | Container( 58 | width: screenSize.width * 0.50, 59 | child: Text( 60 | title, 61 | maxLines: 1, 62 | style: TextStyle( 63 | color: Color.fromRGBO(41, 158, 216, 1.0), 64 | fontSize: 12.0, 65 | fontWeight: FontWeight.bold, 66 | ), 67 | ), 68 | ), 69 | Container( 70 | margin: EdgeInsets.only(top: 8.0), 71 | width: screenSize.width * 0.50, 72 | child: Row( 73 | children: [ 74 | new Expanded( 75 | child: new Text( 76 | description, 77 | maxLines: 2, 78 | overflow: TextOverflow.ellipsis, 79 | style: TextStyle( 80 | fontWeight: FontWeight.bold, 81 | color: Colors.black, 82 | fontSize: 12.0, 83 | wordSpacing: 0.0, 84 | ), 85 | ), 86 | ) 87 | ], 88 | ), 89 | ) 90 | ], 91 | )), 92 | Container( 93 | height: screenSize.width * 0.18, 94 | width: screenSize.width * 0.18, 95 | color: Colors.white, 96 | child: Image.network( 97 | imageUrl, 98 | fit: BoxFit.cover, 99 | ), 100 | ) 101 | ], 102 | )) 103 | ], 104 | ), 105 | ); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /lib/src/widget/twitter/index.dart: -------------------------------------------------------------------------------- 1 | part of link_preview; 2 | 3 | class TwitterLinkPreview extends PreviewLink { 4 | build(String url) { 5 | return this.render(url, (dynamic body) { 6 | return TwitterView( 7 | imageUrl: body['image_url'], 8 | title: body['title'], 9 | url: body['url'], 10 | description: body['description'], 11 | ); 12 | }); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/widget/twitter/view.dart: -------------------------------------------------------------------------------- 1 | part of link_preview; 2 | 3 | class TwitterView extends StatelessWidget { 4 | final String imageUrl; 5 | final String title; 6 | final String description; 7 | final String url; 8 | 9 | TwitterView( 10 | {Key key, 11 | @required this.imageUrl, 12 | @required this.title, 13 | this.description, 14 | @required this.url}); 15 | 16 | Widget build(BuildContext context) { 17 | Size screenSize = MediaQuery.of(context).size; 18 | return Container( 19 | constraints: BoxConstraints(maxWidth: screenSize.width * 0.84), 20 | padding: EdgeInsets.all(16.0), 21 | decoration: new BoxDecoration( 22 | color: Colors.white, 23 | borderRadius: new BorderRadius.circular(16.0), 24 | ), 25 | child: Row( 26 | mainAxisAlignment: MainAxisAlignment.start, 27 | children: [ 28 | Padding( 29 | padding: EdgeInsets.symmetric(horizontal: 4.0), 30 | child: Container( 31 | height: screenSize.width * 0.18, 32 | width: screenSize.width * 0.18, 33 | color: Colors.white, 34 | child: Image.network( 35 | imageUrl, 36 | fit: BoxFit.contain, 37 | )), 38 | ), 39 | Column( 40 | mainAxisAlignment: MainAxisAlignment.start, 41 | crossAxisAlignment: CrossAxisAlignment.start, 42 | mainAxisSize: MainAxisSize.max, 43 | children: [ 44 | Container( 45 | margin: EdgeInsets.only(bottom: 8.0), 46 | width: screenSize.width * 0.50, 47 | child: Text( 48 | title, 49 | maxLines: 1, 50 | style: TextStyle( 51 | color: Colors.black, 52 | fontSize: 16.0, 53 | fontWeight: FontWeight.bold, 54 | ), 55 | ), 56 | ), 57 | Container( 58 | width: screenSize.width * 0.50, 59 | child: Row( 60 | children: [ 61 | new Expanded( 62 | child: new Text( 63 | description, 64 | maxLines: 2, 65 | overflow: TextOverflow.ellipsis, 66 | style: TextStyle( 67 | color: Colors.black54, 68 | fontSize: 12.0, 69 | wordSpacing: 0.0, 70 | ), 71 | ), 72 | ) 73 | ], 74 | ), 75 | ), 76 | ], 77 | ), 78 | ], 79 | ), 80 | ); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /lib/src/widget/whatsapp/index.dart: -------------------------------------------------------------------------------- 1 | part of link_preview; 2 | 3 | class WhatsAppLinkPreview extends PreviewLink { 4 | build(String url) { 5 | return this.render(url, (dynamic body) { 6 | return WhatsAppView( 7 | imageUrl: body['image_url'], 8 | title: body['title'], 9 | url: body['url'], 10 | description: body['description'], 11 | ); 12 | }); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/widget/whatsapp/view.dart: -------------------------------------------------------------------------------- 1 | part of link_preview; 2 | 3 | class WhatsAppView extends StatelessWidget { 4 | final String imageUrl; 5 | final String title; 6 | final String description; 7 | final String url; 8 | 9 | WhatsAppView( 10 | {Key key, 11 | @required this.imageUrl, 12 | @required this.title, 13 | this.description, 14 | @required this.url}); 15 | 16 | Widget build(BuildContext context) { 17 | Size screenSize = MediaQuery.of(context).size; 18 | return Container( 19 | constraints: BoxConstraints(maxWidth: screenSize.width * 0.84), 20 | padding: EdgeInsets.all(4.0), 21 | decoration: new BoxDecoration( 22 | color: Color.fromRGBO(223, 249, 204, 1.0), 23 | borderRadius: new BorderRadius.circular(8.0), 24 | ), 25 | child: Row( 26 | mainAxisAlignment: MainAxisAlignment.start, 27 | children: [ 28 | Padding( 29 | padding: EdgeInsets.symmetric(horizontal: 4.0), 30 | child: Container( 31 | height: screenSize.width * 0.18, 32 | width: screenSize.width * 0.18, 33 | color: Colors.white, 34 | child: Image.network( 35 | imageUrl, 36 | fit: BoxFit.cover, 37 | ), 38 | ), 39 | ), 40 | Column( 41 | mainAxisAlignment: MainAxisAlignment.start, 42 | crossAxisAlignment: CrossAxisAlignment.start, 43 | mainAxisSize: MainAxisSize.max, 44 | children: [ 45 | Container( 46 | width: screenSize.width * 0.58, 47 | child: Text( 48 | title, 49 | maxLines: 1, 50 | style: TextStyle(color: Colors.black, fontSize: 16.0), 51 | ), 52 | ), 53 | Container( 54 | width: screenSize.width * 0.58, 55 | child: Row( 56 | children: [ 57 | new Expanded( 58 | child: new Text( 59 | description, 60 | maxLines: 2, 61 | overflow: TextOverflow.ellipsis, 62 | style: TextStyle( 63 | color: Colors.black54, 64 | fontSize: 12.0, 65 | wordSpacing: 0.0, 66 | ), 67 | ), 68 | ) 69 | ], 70 | ), 71 | ), 72 | Text( 73 | url, 74 | style: TextStyle( 75 | color: Colors.black54, 76 | fontSize: 10.0, 77 | ), 78 | ), 79 | ], 80 | ), 81 | ], 82 | ), 83 | ); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /link_preview.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: link_preview 2 | description: Flutter plugin Rich Link Preview, enabling Android and iOS 3 | customs component providers like WhatApp, Telegram, Skype, Twitter, 4 | LinkedIn. 5 | author: Denny Segura 6 | version: 0.0.1 7 | homepage: https://github.com/devdennysegura/flutter-link-preview 8 | 9 | environment: 10 | sdk: ">=2.0.0-dev.68.0 <3.0.0" 11 | 12 | dependencies: 13 | flutter: 14 | sdk: flutter 15 | async: ^2.0.8 16 | 17 | flutter: 18 | plugin: 19 | androidPackage: io.flutter.plugins.linkpreview 20 | pluginClass: LinkPreviewPlugin -------------------------------------------------------------------------------- /screenshots/flutter_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/screenshots/flutter_01.png -------------------------------------------------------------------------------- /screenshots/flutter_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devdennysegura/flutter-link-preview/21b4ad80852f47cfbbcbafd8583d4e13370fa166/screenshots/flutter_02.png --------------------------------------------------------------------------------