From b29319edfec459020e876d86e6c2ebc59151ac84 Mon Sep 17 00:00:00 2001 From: Ahmed Hnewa <73608287+freshtechtips@users.noreply.github.com> Date: Thu, 19 Oct 2023 08:26:43 +0300 Subject: [PATCH] Update todo --- flutter_quill_extensions/lib/embeds/builders.dart | 15 +++++---------- lib/src/utils/string.dart | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/flutter_quill_extensions/lib/embeds/builders.dart b/flutter_quill_extensions/lib/embeds/builders.dart index 64bcc5f1..5d9e0236 100644 --- a/flutter_quill_extensions/lib/embeds/builders.dart +++ b/flutter_quill_extensions/lib/embeds/builders.dart @@ -232,16 +232,11 @@ class ImageEmbedBuilder extends EmbedBuilder { return sb.toString(); } - // TODO: Please consider add bool - // property in - // replaceStyleString that will use either - // mobileWidth or width based on that - // property - // but that require changes to the - // flutter_quill - // and it should be - // published and then we can - // change it from flutter_quill_extensions + // TODO: When update flutter_quill + // we should update flutter_quill_extensions + // to use the latest version and use + // base.replaceStyleStringWithSize() + // instead of replaceStyleString final attr = base.isMobile() ? base.replaceStyleString( diff --git a/lib/src/utils/string.dart b/lib/src/utils/string.dart index 3de84e65..f639c716 100644 --- a/lib/src/utils/string.dart +++ b/lib/src/utils/string.dart @@ -19,6 +19,20 @@ Map parseKeyValuePairs(String s, Set targetKeys) { return result; } +@Deprecated('Use replaceStyleStringWithSize instead') +String replaceStyleString( + String s, + double width, + double height, +) { + return replaceStyleStringWithSize( + s, + width: width, + height: height, + isMobile: true, + ); +} + String replaceStyleStringWithSize( String s, { required double width,