diff --git a/packages/flutter/lib/src/widgets/implicit_animations.dart b/packages/flutter/lib/src/widgets/implicit_animations.dart index 562f68682ad..99757bef8bc 100644 --- a/packages/flutter/lib/src/widgets/implicit_animations.dart +++ b/packages/flutter/lib/src/widgets/implicit_animations.dart @@ -2,8 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'dart:ui' as ui show TextHeightBehavior; + import 'package:flutter/animation.dart'; import 'package:flutter/foundation.dart'; +import 'package:flutter/painting.dart'; import 'package:flutter/rendering.dart'; import 'package:vector_math/vector_math_64.dart'; @@ -1502,8 +1505,9 @@ class _SliverAnimatedOpacityState extends ImplicitlyAnimatedWidgetState 0), + assert(textWidthBasis != null), super(key: key, curve: curve, duration: duration, onEnd: onEnd); /// The widget below this widget in the tree. @@ -1575,6 +1582,14 @@ class AnimatedDefaultTextStyle extends ImplicitlyAnimatedWidget { /// See [DefaultTextStyle.maxLines] for more details. final int maxLines; + /// The strategy to use when calculating the width of the Text. + /// + /// See [TextWidthBasis] for possible values and their implications. + final TextWidthBasis textWidthBasis; + + /// {@macro flutter.dart:ui.textHeightBehavior} + final ui.TextHeightBehavior textHeightBehavior; + @override _AnimatedDefaultTextStyleState createState() => _AnimatedDefaultTextStyleState(); @@ -1586,6 +1601,8 @@ class AnimatedDefaultTextStyle extends ImplicitlyAnimatedWidget { properties.add(FlagProperty('softWrap', value: softWrap, ifTrue: 'wrapping at box width', ifFalse: 'no wrapping except at line break characters', showName: true)); properties.add(EnumProperty('overflow', overflow, defaultValue: null)); properties.add(IntProperty('maxLines', maxLines, defaultValue: null)); + properties.add(EnumProperty('textWidthBasis', textWidthBasis, defaultValue: TextWidthBasis.parent)); + properties.add(DiagnosticsProperty('textHeightBehavior', textHeightBehavior, defaultValue: null)); } } @@ -1605,6 +1622,8 @@ class _AnimatedDefaultTextStyleState extends AnimatedWidgetBaseState