Only launch video as link when read only

pull/307/head
Xin Yao 4 years ago
parent bb38db5ed0
commit b12a28b625
  1. 3
      CHANGELOG.md
  2. 17
      lib/src/widgets/video_app.dart
  3. 2
      pubspec.yaml

@ -1,3 +1,6 @@
## [1.7.0]
* Support video.
## [1.6.4] ## [1.6.4]
* Bug fix for clear format button. * Bug fix for clear format button.

@ -40,13 +40,18 @@ class _VideoAppState extends State<VideoApp> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final defaultStyles = DefaultStyles.getInstance(context); final defaultStyles = DefaultStyles.getInstance(context);
if (!_controller.value.isInitialized || _controller.value.hasError) { 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( return RichText(
text: TextSpan( text: TextSpan(text: widget.videoUrl, style: defaultStyles.link));
text: widget.videoUrl,
style: defaultStyles.link,
recognizer: TapGestureRecognizer()
..onTap = () => launch(widget.videoUrl)),
);
} }
return Container( return Container(

@ -1,6 +1,6 @@
name: flutter_quill name: flutter_quill
description: A rich text editor supporting mobile and web (Demo App @ bulletjournal.us) description: A rich text editor supporting mobile and web (Demo App @ bulletjournal.us)
version: 1.6.4 version: 1.7.0
#author: bulletjournal #author: bulletjournal
homepage: https://bulletjournal.us/home/index.html homepage: https://bulletjournal.us/home/index.html
repository: https://github.com/singerdmx/flutter-quill repository: https://github.com/singerdmx/flutter-quill

Loading…
Cancel
Save