Unfortunately, this makes it impossible to widget/integration/unit test web embeds and reduces the code coverage because there's no apparent way of overriding this variable during tests.
However, I believe we can work around this problem by having a CustomButton that does the exact same thing an ImageButton does.
For additional context, please see https://github.com/dwyl/app/pull/341#issuecomment-1747752793.
The
ImageButton
fromflutter_quill
has different behaviour when the app is accessed from a mobile app or a web browser. It useskIsWeb
to check if the platform is web-based or not - see https://github.com/singerdmx/flutter-quill/blob/8cb14b8155219a94c612467df79206ff09b9b386/flutter_quill_extensions/lib/embeds/toolbar/media_button.dart#L120.Unfortunately, this makes it impossible to widget/integration/unit test web embeds and reduces the code coverage because there's no apparent way of overriding this variable during tests.
However, I believe we can work around this problem by having a
CustomButton
that does the exact same thing anImageButton
does.