Skip to content

Commit

Permalink
[rfw] Replace deprecated textScaleFactor (flutter#6130)
Browse files Browse the repository at this point in the history
Replaces the deprecated `textScaleFactor` with a linear `TextScaler`.

Updates the minimum deployment version to 3.16 where the new API was added.

Part of flutter#143400
  • Loading branch information
stuartmorgan authored Feb 15, 2024
1 parent b4bd165 commit 4035b62
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 13 deletions.
4 changes: 4 additions & 0 deletions packages/rfw/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.23

* Replaces usage of deprecated Flutter APIs.

## 1.0.22

* Adds more testing to restore coverage to 100%.
Expand Down
4 changes: 2 additions & 2 deletions packages/rfw/example/hello/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.10.0"
sdk: ^3.2.0
flutter: ">=3.16.0"

dependencies:
flutter:
Expand Down
4 changes: 2 additions & 2 deletions packages/rfw/example/local/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.10.0"
sdk: ^3.2.0
flutter: ">=3.16.0"

dependencies:
flutter:
Expand Down
4 changes: 2 additions & 2 deletions packages/rfw/example/remote/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.10.0"
sdk: ^3.2.0
flutter: ">=3.16.0"

dependencies:
flutter:
Expand Down
4 changes: 2 additions & 2 deletions packages/rfw/example/wasm/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ publish_to: none # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.10.0"
sdk: ^3.2.0
flutter: ">=3.16.0"

dependencies:
flutter:
Expand Down
3 changes: 2 additions & 1 deletion packages/rfw/lib/src/flutter/core_widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,7 @@ Map<String, LocalWidgetBuilder> get _coreWidgetsDefinitions => <String, LocalWid
}
text = builder.toString();
}
final double? textScaleFactor = source.v<double>(['textScaleFactor']);
return Text(
text,
style: ArgumentDecoders.textStyle(source, ['style']),
Expand All @@ -658,7 +659,7 @@ Map<String, LocalWidgetBuilder> get _coreWidgetsDefinitions => <String, LocalWid
locale: ArgumentDecoders.locale(source, ['locale']),
softWrap: source.v<bool>(['softWrap']),
overflow: ArgumentDecoders.enumValue<TextOverflow>(TextOverflow.values, source, ['overflow']),
textScaleFactor: source.v<double>(['textScaleFactor']),
textScaler: textScaleFactor == null ? null : TextScaler.linear(textScaleFactor),
maxLines: source.v<int>(['maxLines']),
semanticsLabel: source.v<String>(['semanticsLabel']),
textWidthBasis: ArgumentDecoders.enumValue<TextWidthBasis>(TextWidthBasis.values, source, ['textWidthBasis']),
Expand Down
6 changes: 3 additions & 3 deletions packages/rfw/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: rfw
description: "Remote Flutter widgets: a library for rendering declarative widget description files at runtime."
repository: https://github.com/flutter/packages/tree/main/packages/rfw
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+rfw%22
version: 1.0.22
version: 1.0.23

environment:
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.10.0"
sdk: ^3.2.0
flutter: ">=3.16.0"

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion packages/rfw/test_coverage/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 1.0.0
publish_to: none

environment:
sdk: ">=3.0.0 <4.0.0"
sdk: ^3.2.0

dependencies:
lcov_parser: 0.1.1
Expand Down

0 comments on commit 4035b62

Please sign in to comment.