From 4bbf158b6a6e3606d888cd36619446237ed61a9a Mon Sep 17 00:00:00 2001 From: Sarah Zakarias Date: Fri, 5 May 2017 14:14:33 +0200 Subject: [PATCH] Revert plugin use in gallery (#9838) * Revert "add Podfile (#9835)" This reverts commit 74e656752ca76987163653548ec8844c005a3d75. * Revert "update ref to url_launcher plugin in Flutter Gallery (#9833)" This reverts commit 30c49781c5a87a864763783a4fa2950d8ff4687c. * Revert "Use url_launcher plugin in Flutter Gallery (#9751)" This reverts commit 02dfd6be53291e106d10fabc6f50d48da0b78ba7. --- .../examples/gallery/MainActivity.java | 1 - .../io/flutter/plugins/PluginRegistry.java | 3 -- examples/flutter_gallery/flutter_gallery.iml | 2 - examples/flutter_gallery/ios/Podfile | 38 ------------------- .../ios/Runner/PluginRegistry.h | 2 - .../ios/Runner/PluginRegistry.m | 1 - .../flutter_gallery/lib/gallery/drawer.dart | 7 ++-- examples/flutter_gallery/pubspec.yaml | 1 - 8 files changed, 3 insertions(+), 52 deletions(-) delete mode 100644 examples/flutter_gallery/ios/Podfile diff --git a/examples/flutter_gallery/android/app/src/main/java/io/flutter/examples/gallery/MainActivity.java b/examples/flutter_gallery/android/app/src/main/java/io/flutter/examples/gallery/MainActivity.java index f690c3b215..9ecbc3dbd6 100644 --- a/examples/flutter_gallery/android/app/src/main/java/io/flutter/examples/gallery/MainActivity.java +++ b/examples/flutter_gallery/android/app/src/main/java/io/flutter/examples/gallery/MainActivity.java @@ -1,7 +1,6 @@ package io.flutter.examples.gallery; import android.os.Bundle; - import io.flutter.app.FlutterActivity; import io.flutter.plugins.PluginRegistry; diff --git a/examples/flutter_gallery/android/app/src/main/java/io/flutter/plugins/PluginRegistry.java b/examples/flutter_gallery/android/app/src/main/java/io/flutter/plugins/PluginRegistry.java index 846c01bc50..92f7a749c4 100644 --- a/examples/flutter_gallery/android/app/src/main/java/io/flutter/plugins/PluginRegistry.java +++ b/examples/flutter_gallery/android/app/src/main/java/io/flutter/plugins/PluginRegistry.java @@ -2,16 +2,13 @@ package io.flutter.plugins; import io.flutter.app.FlutterActivity; -import io.flutter.plugins.url_launcher.UrlLauncherPlugin; /** * Generated file. Do not edit. */ public class PluginRegistry { - public UrlLauncherPlugin url_launcher; public void registerAll(FlutterActivity activity) { - url_launcher = UrlLauncherPlugin.register(activity); } } diff --git a/examples/flutter_gallery/flutter_gallery.iml b/examples/flutter_gallery/flutter_gallery.iml index 7bf659c2e2..9d5dae1954 100644 --- a/examples/flutter_gallery/flutter_gallery.iml +++ b/examples/flutter_gallery/flutter_gallery.iml @@ -7,8 +7,6 @@ - - diff --git a/examples/flutter_gallery/ios/Podfile b/examples/flutter_gallery/ios/Podfile deleted file mode 100644 index 74b3de0649..0000000000 --- a/examples/flutter_gallery/ios/Podfile +++ /dev/null @@ -1,38 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '9.0' - -if ENV['FLUTTER_FRAMEWORK_DIR'] == nil - abort('Please set FLUTTER_FRAMEWORK_DIR to the directory containing Flutter.framework') -end - -target 'Runner' do - use_frameworks! - - # Pods for Runner - - # Flutter Pods - pod 'Flutter', :path => ENV['FLUTTER_FRAMEWORK_DIR'] - - if File.exists? '../.flutter-plugins' - flutter_root = File.expand_path('..') - File.foreach('../.flutter-plugins') { |line| - plugin = line.split(pattern='=') - if plugin.length == 2 - name = plugin[0].strip() - path = plugin[1].strip() - resolved_path = File.expand_path("#{path}/ios", flutter_root) - pod name, :path => resolved_path - else - puts "Invalid plugin specification: #{line}" - end - } - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - target.build_configurations.each do |config| - config.build_settings['ENABLE_BITCODE'] = 'NO' - end - end -end diff --git a/examples/flutter_gallery/ios/Runner/PluginRegistry.h b/examples/flutter_gallery/ios/Runner/PluginRegistry.h index 34a6174568..df039db515 100644 --- a/examples/flutter_gallery/ios/Runner/PluginRegistry.h +++ b/examples/flutter_gallery/ios/Runner/PluginRegistry.h @@ -7,11 +7,9 @@ #import -#import "UrlLauncherPlugin.h" @interface PluginRegistry : NSObject -@property (readonly, nonatomic) UrlLauncherPlugin *url_launcher; - (instancetype)initWithController:(FlutterViewController *)controller; diff --git a/examples/flutter_gallery/ios/Runner/PluginRegistry.m b/examples/flutter_gallery/ios/Runner/PluginRegistry.m index 1bb042ddd6..0a34729946 100644 --- a/examples/flutter_gallery/ios/Runner/PluginRegistry.m +++ b/examples/flutter_gallery/ios/Runner/PluginRegistry.m @@ -8,7 +8,6 @@ - (instancetype)initWithController:(FlutterViewController *)controller { if (self = [super init]) { - _url_launcher = [[UrlLauncherPlugin alloc] initWithController:controller]; } return self; } diff --git a/examples/flutter_gallery/lib/gallery/drawer.dart b/examples/flutter_gallery/lib/gallery/drawer.dart index 3ab056b3f7..584292401d 100644 --- a/examples/flutter_gallery/lib/gallery/drawer.dart +++ b/examples/flutter_gallery/lib/gallery/drawer.dart @@ -7,15 +7,14 @@ import 'dart:math' as math; import 'package:flutter/foundation.dart' show defaultTargetPlatform, required; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; - -import 'package:url_launcher/url_launcher.dart'; +import 'package:flutter/services.dart'; class LinkTextSpan extends TextSpan { LinkTextSpan({ TextStyle style, String url, String text }) : super( style: style, text: text ?? url, recognizer: new TapGestureRecognizer()..onTap = () { - launch(url); + UrlLauncher.launch(url); } ); } @@ -204,7 +203,7 @@ class GalleryDrawer extends StatelessWidget { leading: const Icon(Icons.report), title: const Text('Send feedback'), onTap: onSendFeedback ?? () { - launch('https://github.com/flutter/flutter/issues/new'); + UrlLauncher.launch('https://github.com/flutter/flutter/issues/new'); }, ); diff --git a/examples/flutter_gallery/pubspec.yaml b/examples/flutter_gallery/pubspec.yaml index 0e94e028d9..8d41f33d23 100644 --- a/examples/flutter_gallery/pubspec.yaml +++ b/examples/flutter_gallery/pubspec.yaml @@ -6,7 +6,6 @@ dependencies: flutter: sdk: flutter - url_launcher: ^0.3.3 # Also update dev/benchmarks/complex_layout/pubspec.yaml flutter_gallery_assets: