Use url_launcher plugin in Flutter Gallery (#9751)

This commit is contained in:
Sarah Zakarias 2017-05-05 10:48:46 +02:00 committed by GitHub
parent 20da5c1beb
commit 02dfd6be53
3 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,7 @@
package io.flutter.examples.gallery;
import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.PluginRegistry;

View File

@ -7,14 +7,15 @@ 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:flutter/services.dart';
import 'package:url_launcher/url_launcher.dart';
class LinkTextSpan extends TextSpan {
LinkTextSpan({ TextStyle style, String url, String text }) : super(
style: style,
text: text ?? url,
recognizer: new TapGestureRecognizer()..onTap = () {
UrlLauncher.launch(url);
launch(url);
}
);
}
@ -203,7 +204,7 @@ class GalleryDrawer extends StatelessWidget {
leading: const Icon(Icons.report),
title: const Text('Send feedback'),
onTap: onSendFeedback ?? () {
UrlLauncher.launch('https://github.com/flutter/flutter/issues/new');
launch('https://github.com/flutter/flutter/issues/new');
},
);

View File

@ -6,6 +6,7 @@ dependencies:
flutter:
sdk: flutter
url_launcher: ^0.3.1
# Also update dev/benchmarks/complex_layout/pubspec.yaml
flutter_gallery_assets: