From b12a28b6255aafc5883dc5976fe5c009fd677a98 Mon Sep 17 00:00:00 2001 From: Xin Yao Date: Tue, 20 Jul 2021 15:19:51 -0700 Subject: [PATCH] Only launch video as link when read only --- CHANGELOG.md | 3 +++ lib/src/widgets/video_app.dart | 17 +++++++++++------ pubspec.yaml | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e4acda9..16807c9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [1.7.0] +* Support video. + ## [1.6.4] * Bug fix for clear format button. diff --git a/lib/src/widgets/video_app.dart b/lib/src/widgets/video_app.dart index e0838a2f..b6f85cb8 100644 --- a/lib/src/widgets/video_app.dart +++ b/lib/src/widgets/video_app.dart @@ -40,13 +40,18 @@ class _VideoAppState extends State { Widget build(BuildContext context) { final defaultStyles = DefaultStyles.getInstance(context); if (!_controller.value.isInitialized || _controller.value.hasError) { + if (widget.readOnly) { + return RichText( + text: TextSpan( + text: widget.videoUrl, + style: defaultStyles.link, + recognizer: TapGestureRecognizer() + ..onTap = () => launch(widget.videoUrl)), + ); + } + return RichText( - text: TextSpan( - text: widget.videoUrl, - style: defaultStyles.link, - recognizer: TapGestureRecognizer() - ..onTap = () => launch(widget.videoUrl)), - ); + text: TextSpan(text: widget.videoUrl, style: defaultStyles.link)); } return Container( diff --git a/pubspec.yaml b/pubspec.yaml index aae787c0..85005e4e 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.6.4 +version: 1.7.0 #author: bulletjournal homepage: https://bulletjournal.us/home/index.html repository: https://github.com/singerdmx/flutter-quill