Skip to content

Commit 8299215

Browse files
committed
* Migrate to Flutter 3.16.0
1 parent ed312f9 commit 8299215

File tree

15 files changed

+392
-120
lines changed

15 files changed

+392
-120
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 12.0.0
2+
3+
* Migrate to Flutter 3.16.0
4+
5+
16
## 11.1.0
27

38
* Migrate to Flutter 3.13.0

analysis_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ analyzer:
2929
# Ignore analyzer hints for updating pubspecs when using Future or
3030
# Stream and not importing dart:async
3131
# Please see https://github.com/flutter/flutter/pull/24528 for details.
32-
sdk_version_async_exported_from_core: ignore
32+
# sdk_version_async_exported_from_core: ignore
3333
# exclude:
3434
# - "bin/cache/**"
3535
# # the following two are relative to the stocks example and the flutter package respectively

example/analysis_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ analyzer:
2929
# Ignore analyzer hints for updating pubspecs when using Future or
3030
# Stream and not importing dart:async
3131
# Please see https://github.com/flutter/flutter/pull/24528 for details.
32-
sdk_version_async_exported_from_core: ignore
32+
# sdk_version_async_exported_from_core: ignore
3333
# exclude:
3434
# - "bin/cache/**"
3535
# # the following two are relative to the stocks example and the flutter package respectively

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class MyApp extends StatelessWidget {
2525
if (!kIsWeb) {
2626
final MediaQueryData data = MediaQuery.of(c);
2727
return MediaQuery(
28-
data: data.copyWith(textScaleFactor: 1.0),
28+
data: data.copyWith(textScaler: TextScaler.noScaling),
2929
child: w!,
3030
);
3131
}

example/lib/text/selection_area.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ class CommonSelectionArea extends StatelessWidget {
6565
Clipboard.getData('text/plain').then((ClipboardData? value) {
6666
if (value != null) {
6767
// remove zeroWidthSpace
68-
final String? plainText =
69-
value.text?.replaceAll(ExtendedTextLibraryUtils.zeroWidthSpace, '');
68+
final String? plainText = value.text?.replaceAll(
69+
ExtendedTextLibraryUtils.zeroWidthSpace, '');
7070
if (plainText != null) {
7171
Clipboard.setData(ClipboardData(text: plainText));
7272
}

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ version: 1.0.0+1
1111

1212
environment:
1313
sdk: '>=3.0.0 <4.0.0'
14-
flutter: ">=3.13.0"
14+
flutter: ">=3.16.0"
1515
dependencies:
1616
cupertino_icons: ^1.0.2
1717
ff_annotation_route_library: ^3.0.0

lib/extended_text.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ export 'package:extended_text_library/extended_text_library.dart';
55
export 'src/extended/widgets/rich_text.dart';
66
export 'src/extended/widgets/text.dart';
77
export 'src/extended/widgets/text_overflow_widget.dart';
8-

lib/src/extended/rendering/paragraph.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ExtendedRenderParagraph extends _RenderParagraph
3232
required super.textDirection,
3333
super.softWrap = true,
3434
super.overflow = TextOverflow.clip,
35-
super.textScaleFactor = 1.0,
35+
super.textScaler = TextScaler.noScaling,
3636
super.maxLines,
3737
super.locale,
3838
super.strutStyle,
@@ -125,7 +125,7 @@ class ExtendedRenderParagraph extends _RenderParagraph
125125
final TextPainter fadeSizePainter = TextPainter(
126126
text: TextSpan(style: _textPainter.text!.style, text: '\u2026'),
127127
textDirection: textDirection,
128-
textScaleFactor: textScaleFactor,
128+
textScaler: textScaler,
129129
locale: locale,
130130
)..layout();
131131
if (didOverflowWidth) {

lib/src/extended/text_overflow_mixin.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ mixin TextOverflowMixin on _RenderParagraph {
619619
text: inlineSpan ?? text,
620620
textAlign: _textPainter.textAlign,
621621
textDirection: _textPainter.textDirection,
622-
textScaleFactor: _textPainter.textScaleFactor,
622+
textScaler: _textPainter.textScaler,
623623
maxLines: maxLines,
624624
ellipsis: null,
625625
locale: _textPainter.locale,

lib/src/extended/widgets/rich_text.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ExtendedRichText extends _RichText {
1414
super.textDirection,
1515
super.softWrap = true,
1616
super.overflow = TextOverflow.clip,
17-
super.textScaleFactor = 1.0,
17+
super.textScaler = TextScaler.noScaling,
1818
super.maxLines,
1919
super.locale,
2020
super.strutStyle,
@@ -25,7 +25,7 @@ class ExtendedRichText extends _RichText {
2525
this.overflowWidget,
2626
this.canSelectPlaceholderSpan = true,
2727
}) : super(
28-
children: _extractChildren(text, overflowWidget, textScaleFactor),
28+
children: _extractChildren(text, overflowWidget, textScaler),
2929
);
3030

3131
final TextOverflowWidget? overflowWidget;
@@ -42,7 +42,7 @@ class ExtendedRichText extends _RichText {
4242
textDirection: textDirection ?? Directionality.of(context),
4343
softWrap: softWrap,
4444
overflow: overflow,
45-
textScaleFactor: textScaleFactor,
45+
textScaler: textScaler,
4646
maxLines: maxLines,
4747
strutStyle: strutStyle,
4848
textWidthBasis: textWidthBasis,
@@ -65,7 +65,7 @@ class ExtendedRichText extends _RichText {
6565
..textDirection = textDirection ?? Directionality.of(context)
6666
..softWrap = softWrap
6767
..overflow = overflow
68-
..textScaleFactor = textScaleFactor
68+
..textScaler = textScaler
6969
..maxLines = maxLines
7070
..strutStyle = strutStyle
7171
..textWidthBasis = textWidthBasis
@@ -77,21 +77,21 @@ class ExtendedRichText extends _RichText {
7777
..canSelectPlaceholderSpan = canSelectPlaceholderSpan;
7878
}
7979

80-
// Traverses the InlineSpan tree and depth-first collects the list of
81-
// child widgets that are created in WidgetSpans.
80+
/// Traverses the InlineSpan tree and depth-first collects the list of
81+
/// child widgets that are created in WidgetSpans.
82+
// TODO(zmtzawqlp): _extractChildren has replace with WidgetSpan.extractFromInlineSpan
8283
static List<Widget> _extractChildren(
8384
InlineSpan span,
8485
TextOverflowWidget? overflowWidget,
85-
double textScaleFactor,
86+
TextScaler textScaler,
8687
) {
87-
int index = 0;
8888
final List<Widget> result = <Widget>[
89-
...WidgetSpan.extractFromInlineSpan(span, textScaleFactor)
89+
...WidgetSpan.extractFromInlineSpan(span, textScaler)
9090
];
9191

9292
if (overflowWidget != null) {
9393
result.add(Semantics(
94-
tagForChildren: PlaceholderSpanIndexSemanticsTag(index++),
94+
tagForChildren: PlaceholderSpanIndexSemanticsTag(result.length),
9595
child: overflowWidget,
9696
));
9797
}

0 commit comments

Comments
 (0)