Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore deprecated MediaQuery.textScaleFactor #1053

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/widgetbook/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Unreleased

- **FIX** Ignore deprecated `MediaQuery.textScaleFactor`; to maintain compatibility with Flutter versions < 3.16.0. ([#1053](https://github.com/widgetbook/widgetbook/pull/1053))

## 3.4.1

- **FIX**: Use `MediaQuery.of(context).size` instead of `MediaQuery.sizeOf`, to maintain compatibility with Flutter v3.7. ([#1049](https://github.com/widgetbook/widgetbook/pull/1049))
Expand All @@ -6,7 +10,7 @@
## 3.4.0

- **BREAKING**: Set minimum SDK version to 2.19.0 & minimum Flutter version to 3.7.0. ([#1030](https://github.com/widgetbook/widgetbook/pull/1030))
- **FEAT**: Add mobile support. ([#1019](https://github.com/widgetbook/widgetbook/pull/1019) - by [@Mastersam07](https://github.com/Mastersam07))
- **FEAT**: Add mobile support. ([#1019](https://github.com/widgetbook/widgetbook/pull/1019) - by [@Mastersam07](https://github.com/Mastersam07))
- **FEAT**: Add light theme support. ([#919](https://github.com/widgetbook/widgetbook/pull/919) - by [@07Abhinavkapoor](https://github.com/07Abhinavkapoor))
- **FEAT**: Introduce `WidgetbookLeafComponent` navigation node for components with a single use-case. ([#1015](https://github.com/widgetbook/widgetbook/pull/1015))
- **FEAT**: Add `designLink` to `WidgetbookUseCase`. ([#926](https://github.com/widgetbook/widgetbook/pull/926) - by [@Mastersam07](https://github.com/Mastersam07))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import '../addons.dart';
/// * [ThemeAddon], changes the active custom theme.
/// * [MaterialThemeAddon], changes the active [ThemeData].
/// * [CupertinoThemeAddon], changes the active [CupertinoThemeData].
/// * [TextScaleAddon], changes the active [MediaQueryData.textScaleFactor].
/// * [TextScaleAddon], changes the active text scale.
/// * [LocalizationAddon], changes the active [Locale].
/// * [DeviceFrameAddon], an [WidgetbookAddon] to change the active frame that
/// allows to view the [WidgetbookUseCase] on different screens.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// [MediaQuery.textScaleFactor] is deprecated in Flutter 3.16.0,
// Since our minimum Flutter version is 3.7.0, we cannot use [TextScaler] yet.
// More info: https://docs.flutter.dev/release/breaking-changes/deprecate-textscalefactor
// ignore_for_file: deprecated_member_use

import 'package:flutter/material.dart';

import '../../fields/fields.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ void main() {
);

expect(
// ignore: deprecated_member_use
mediaQuery.textScaleFactor,
equals(factor),
);
Expand Down