Fixup displayed link + add linkify to licenses.dart
continuous-integration/drone/pr Build is pending
Details
continuous-integration/drone/pr Build is pending
Details
This commit is contained in:
parent
cd1bf07fba
commit
303b70d751
|
@ -116,4 +116,27 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''');
|
||||
|
||||
yield LicenseEntryWithLineBreaks(["flaticons"], "Icons made by Freepik (https://www.freepik.com) from Flaticon (www.flaticon.com)");
|
||||
|
||||
yield LicenseEntryWithLineBreaks(["flutter_linkify", "linkify"],
|
||||
'''MIT License
|
||||
|
||||
Copyright (c) 2019/2020 Charles-William Crete
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.''');
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ import 'package:flutter/rendering.dart';
|
|||
|
||||
import 'linkify.dart';
|
||||
|
||||
export 'linkify.dart' show LinkifyElement, LinkifyOptions, LinkableElement, TextElement, Linkifier;
|
||||
export 'linkify.dart' show LinkifyElement, LinkifyOptions, LinkableElement, TextElement, Linkifier, UrlElement, UrlLinkifier;
|
||||
|
||||
/// Callback clicked link
|
||||
typedef LinkCallback = void Function(LinkableElement link);
|
||||
|
|
|
@ -23,7 +23,10 @@
|
|||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
import 'package:cwtch/third_party/linkify/uri.dart';
|
||||
|
||||
import 'uri.dart';
|
||||
export 'uri.dart' show UrlLinkifier, UrlElement;
|
||||
|
||||
|
||||
abstract class LinkifyElement {
|
||||
final String text;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
import 'package:cwtch/third_party/linkify/linkify.dart';
|
||||
import 'linkify.dart';
|
||||
|
||||
final _urlRegex = RegExp(
|
||||
r'^(.*?)((?:https?:\/\/|www\.)[^\s/$.?#].[^\s]*)',
|
||||
|
@ -75,7 +75,13 @@ class UrlLinkifier extends Linkifier {
|
|||
|
||||
var url = originalUrl;
|
||||
|
||||
list.add(UrlElement(originalUrl, url));
|
||||
// If protocol has not been specified then append a protocol
|
||||
// to the start of the URL so that it can be opened...
|
||||
if (!url.startsWith("https://") && !url.startsWith("http://")) {
|
||||
url = "https://"+url;
|
||||
}
|
||||
|
||||
list.add(UrlElement(url, originalUrl));
|
||||
|
||||
if (end != null) {
|
||||
list.add(TextElement(end));
|
||||
|
|
Loading…
Reference in New Issue