From 34e6a35795d43a7f88049fc8ad156587652ba590 Mon Sep 17 00:00:00 2001 From: Xin Yao Date: Sat, 24 Jul 2021 10:57:13 -0700 Subject: [PATCH] Upgrade to 1.7.1 --- CHANGELOG.md | 3 +++ lib/src/widgets/editor.dart | 10 ++++------ lib/src/widgets/youtube_video_app.dart | 1 - pubspec.yaml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16807c9a..5d5f9d52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [1.7.1] +* Support Youtube video. + ## [1.7.0] * Support video. diff --git a/lib/src/widgets/editor.dart b/lib/src/widgets/editor.dart index 774c0282..733650c6 100644 --- a/lib/src/widgets/editor.dart +++ b/lib/src/widgets/editor.dart @@ -8,7 +8,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; -import 'package:flutter_quill/src/widgets/youtube_video_app.dart'; import 'package:string_validator/string_validator.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -27,6 +26,7 @@ import 'image.dart'; import 'raw_editor.dart'; import 'text_selection.dart'; import 'video_app.dart'; +import 'youtube_video_app.dart'; const linkPrefixes = [ 'mailto:', // email @@ -110,14 +110,12 @@ Widget _defaultEmbedBuilder( : Image.file(io.File(imageUrl)); case 'video': final videoUrl = node.value.data; - if (videoUrl.toString().contains('www.youtube.com') || - videoUrl.toString().contains('youtu.be')) { + if (videoUrl.contains('youtube.com') || + videoUrl.contains('youtu.be')) { return YoutubeVideoApp( videoUrl: videoUrl, context: context, readOnly: readOnly); - } else { - return VideoApp( - videoUrl: videoUrl, context: context, readOnly: readOnly); } + return VideoApp(videoUrl: videoUrl, context: context, readOnly: readOnly); default: throw UnimplementedError( 'Embeddable type "${node.value.type}" is not supported by default ' diff --git a/lib/src/widgets/youtube_video_app.dart b/lib/src/widgets/youtube_video_app.dart index f299f1fd..eae3cb51 100644 --- a/lib/src/widgets/youtube_video_app.dart +++ b/lib/src/widgets/youtube_video_app.dart @@ -37,7 +37,6 @@ class _YoutubeVideoAppState extends State { Widget build(BuildContext context) { final defaultStyles = DefaultStyles.getInstance(context); if (_youtubeController == null) { - print('problem with youtube video'); if (widget.readOnly) { return RichText( text: TextSpan( diff --git a/pubspec.yaml b/pubspec.yaml index add26fd5..81d20f75 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_quill description: A rich text editor supporting mobile and web (Demo App @ bulletjournal.us) -version: 1.7.0 +version: 1.7.1 #author: bulletjournal homepage: https://bulletjournal.us/home/index.html repository: https://github.com/singerdmx/flutter-quill