@@ -1262,10 +1262,13 @@ class Transform extends SingleChildRenderObjectWidget {
...
@@ -1262,10 +1262,13 @@ class Transform extends SingleChildRenderObjectWidget {
alignment=null,
alignment=null,
super(key:key,child:child);
super(key:key,child:child);
/// Creates a widget that scales its child uniformly.
/// Creates a widget that scales its child along the 2D plane.
///
///
/// The `scale` argument must not be null. It gives the scalar by which
/// The `scaleX` argument provides the scalar by which to multiply the `x` axis, and the `scaleY` argument provides the scalar by which to multiply the `y` axis. Either may be omitted, in which case that axis defaults to 1.0.
/// to multiply the `x` and `y` axes.
///
/// For convenience, to scale the child uniformly, instead of providing `scaleX` and `scaleY`, the `scale` parameter may be used.
///
/// At least one of `scale`, `scaleX`, and `scaleY` must be non-null. If `scale` is provided, the other two must be null; similarly, if it is not provided, one of the other two must be provided.
///
///
/// The [alignment] controls the origin of the scale; by default, this is
/// The [alignment] controls the origin of the scale; by default, this is
/// the center of the box.
/// the center of the box.
...
@@ -1293,14 +1296,18 @@ class Transform extends SingleChildRenderObjectWidget {
...
@@ -1293,14 +1296,18 @@ class Transform extends SingleChildRenderObjectWidget {
testWidgets("Transform.scale() does not accept all three 'scale', 'scaleX' and 'scaleY' parameters to be non-null",(WidgetTestertester)async{
awaitexpectLater((){
tester.pumpWidget(Directionality(
textDirection:TextDirection.ltr,
child:Center(
child:Transform.scale(
scale:1.0,
scaleX:1.0,
scaleY:1.0,
child:constSizedBox(
height:100,
width:100,
),
),
)));
},throwsAssertionError);
});
testWidgets("Transform.scale() needs at least one of 'scale', 'scaleX' and 'scaleY' to be non-null, otherwise throws AssertionError",(WidgetTestertester)async{
awaitexpectLater((){
tester.pumpWidget(Directionality(
textDirection:TextDirection.ltr,
child:Center(
child:Transform.scale(
child:constSizedBox(
height:100,
width:100,
),
),
)));
},throwsAssertionError);
});
testWidgets("Transform.scale() scales widget uniformly with 'scale' parameter",(WidgetTestertester)async{