Use url_launcher plugin in Flutter Gallery (#9751)
This commit is contained in:
@@ -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');
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user