Skip to content

Commit

Permalink
Bug fixes + Provide a way to handle the image errors and use custom i…
Browse files Browse the repository at this point in the history
…mage provider (#1428)
  • Loading branch information
EchoEllet authored Oct 19, 2023
1 parent 4b87821 commit db143c9
Show file tree
Hide file tree
Showing 27 changed files with 568 additions and 238 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# [7.4.14]
- Custom style attrbuites for platforms other than mobile (alignment, margin, width, height)
- Improve performance by reducing the number of widgets rebuilt by listening to media query for only the needed things, for example instead of using `MediaQuery.of(context).size`, now we are using `MediaQuery.sizeOf(context)`

# [7.4.13]
- Fixed tab editing when in readOnly mode.

Expand Down
Empty file added FETCH_HEAD
Empty file.
4 changes: 2 additions & 2 deletions example/lib/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class _HomePageState extends State<HomePage> {
),
drawer: Container(
constraints:
BoxConstraints(maxWidth: MediaQuery.of(context).size.width * 0.7),
BoxConstraints(maxWidth: MediaQuery.sizeOf(context).width * 0.7),
color: Colors.grey.shade800,
child: _buildMenuBar(context),
),
Expand Down Expand Up @@ -408,7 +408,7 @@ class _HomePageState extends State<HomePage> {
);

Widget _buildMenuBar(BuildContext context) {
final size = MediaQuery.of(context).size;
final size = MediaQuery.sizeOf(context);
const itemStyle = TextStyle(
color: Colors.white,
fontSize: 18,
Expand Down
8 changes: 4 additions & 4 deletions example/lib/universal_ui/universal_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ImageEmbedBuilderWeb extends EmbedBuilder {
// TODO: handle imageUrl of base64
return const SizedBox();
}
final size = MediaQuery.of(context).size;
final size = MediaQuery.sizeOf(context);
UniversalUI().platformViewRegistry.registerViewFactory(imageUrl, (viewId) {
return html.ImageElement()
..src = imageUrl
Expand All @@ -61,7 +61,7 @@ class ImageEmbedBuilderWeb extends EmbedBuilder {
: size.width * 0.2,
),
child: SizedBox(
height: MediaQuery.of(context).size.height * 0.45,
height: MediaQuery.sizeOf(context).height * 0.45,
child: HtmlElementView(
viewType: imageUrl,
),
Expand Down Expand Up @@ -94,8 +94,8 @@ class VideoEmbedBuilderWeb extends EmbedBuilder {
UniversalUI().platformViewRegistry.registerViewFactory(
videoUrl,
(id) => html.IFrameElement()
..width = MediaQuery.of(context).size.width.toString()
..height = MediaQuery.of(context).size.height.toString()
..width = MediaQuery.sizeOf(context).width.toString()
..height = MediaQuery.sizeOf(context).height.toString()
..src = videoUrl
..style.border = 'none');

Expand Down
8 changes: 4 additions & 4 deletions example/lib/widgets/responsive_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ class ResponsiveWidget extends StatelessWidget {
final Widget? smallScreen;

static bool isSmallScreen(BuildContext context) {
return MediaQuery.of(context).size.width < 800;
return MediaQuery.sizeOf(context).width < 800;
}

static bool isLargeScreen(BuildContext context) {
return MediaQuery.of(context).size.width > 1200;
return MediaQuery.sizeOf(context).width > 1200;
}

static bool isMediumScreen(BuildContext context) {
return MediaQuery.of(context).size.width >= 800 &&
MediaQuery.of(context).size.width <= 1200;
return MediaQuery.sizeOf(context).width >= 800 &&
MediaQuery.sizeOf(context).width <= 1200;
}

@override
Expand Down
7 changes: 7 additions & 0 deletions flutter_quill_extensions/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
## 0.5.1
- Provide a way to use custom image provider for the image widgets
- Provide a way to handle different errors in image widgets
- Two bug fixes related to pick the image and capture it using the camera
- Add support for image resizing on desktop platforms when forced using the mobile context menu
- Improve performance by reducing the number of widgets rebuilt by listening to media query for only the needed things, for example instead of using `MediaQuery.of(context).size`, now we are using `MediaQuery.sizeOf(context)`
- Fix warrning "The platformViewRegistry getter is deprecated and will be removed in a future release. Please import it from dart:ui_web instead."
- Add QuillImageUtilities class
- Small improvemenets
- Allow to use the mobile context menu on desktop by force using it
- Add the resizing option to the forced mobile context menu
- Add new custom style attrbuite for desktop and other platforms

## 0.5.0
- Migrated from `gallery_saver` to `gal` for saving images
Expand Down
Loading

1 comment on commit db143c9

@EchoEllet
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@singerdmx
There is a file called FETCH_HEAD not sure where it comes from, should I delete it or do you know what it's for??

Please sign in to comment.