Skip to content

Commit 4aace54

Browse files
authored
Make SceneBuilder.push* not return nullable objects (flutter#25991)
1 parent 3d73e06 commit 4aace54

File tree

3 files changed

+29
-29
lines changed

3 files changed

+29
-29
lines changed

lib/ui/compositing.dart

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
283283
/// {@endtemplate}
284284
///
285285
/// See [pop] for details about the operation stack.
286-
TransformEngineLayer? pushTransform(
286+
TransformEngineLayer pushTransform(
287287
Float64List matrix4, {
288288
TransformEngineLayer? oldLayer,
289289
}) {
@@ -308,7 +308,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
308308
/// {@macro dart.ui.sceneBuilder.oldLayerVsRetained}
309309
///
310310
/// See [pop] for details about the operation stack.
311-
OffsetEngineLayer? pushOffset(
311+
OffsetEngineLayer pushOffset(
312312
double dx,
313313
double dy, {
314314
OffsetEngineLayer? oldLayer,
@@ -334,7 +334,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
334334
///
335335
/// See [pop] for details about the operation stack, and [Clip] for different clip modes.
336336
/// By default, the clip will be anti-aliased (clip = [Clip.antiAlias]).
337-
ClipRectEngineLayer? pushClipRect(
337+
ClipRectEngineLayer pushClipRect(
338338
Rect rect, {
339339
Clip clipBehavior = Clip.antiAlias,
340340
ClipRectEngineLayer? oldLayer,
@@ -363,7 +363,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
363363
///
364364
/// See [pop] for details about the operation stack, and [Clip] for different clip modes.
365365
/// By default, the clip will be anti-aliased (clip = [Clip.antiAlias]).
366-
ClipRRectEngineLayer? pushClipRRect(
366+
ClipRRectEngineLayer pushClipRRect(
367367
RRect rrect, {
368368
Clip clipBehavior = Clip.antiAlias,
369369
ClipRRectEngineLayer? oldLayer,
@@ -391,7 +391,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
391391
///
392392
/// See [pop] for details about the operation stack. See [Clip] for different clip modes.
393393
/// By default, the clip will be anti-aliased (clip = [Clip.antiAlias]).
394-
ClipPathEngineLayer? pushClipPath(
394+
ClipPathEngineLayer pushClipPath(
395395
Path path, {
396396
Clip clipBehavior = Clip.antiAlias,
397397
ClipPathEngineLayer? oldLayer,
@@ -421,7 +421,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
421421
/// {@macro dart.ui.sceneBuilder.oldLayerVsRetained}
422422
///
423423
/// See [pop] for details about the operation stack.
424-
OpacityEngineLayer? pushOpacity(
424+
OpacityEngineLayer pushOpacity(
425425
int alpha, {
426426
Offset? offset = Offset.zero,
427427
OpacityEngineLayer? oldLayer,
@@ -447,7 +447,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
447447
/// {@macro dart.ui.sceneBuilder.oldLayerVsRetained}
448448
///
449449
/// See [pop] for details about the operation stack.
450-
ColorFilterEngineLayer? pushColorFilter(
450+
ColorFilterEngineLayer pushColorFilter(
451451
ColorFilter filter, {
452452
ColorFilterEngineLayer? oldLayer,
453453
}) {
@@ -475,7 +475,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
475475
/// {@macro dart.ui.sceneBuilder.oldLayerVsRetained}
476476
///
477477
/// See [pop] for details about the operation stack.
478-
ImageFilterEngineLayer? pushImageFilter(
478+
ImageFilterEngineLayer pushImageFilter(
479479
ImageFilter filter, {
480480
ImageFilterEngineLayer? oldLayer,
481481
}) {
@@ -504,7 +504,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
504504
/// {@macro dart.ui.sceneBuilder.oldLayerVsRetained}
505505
///
506506
/// See [pop] for details about the operation stack.
507-
BackdropFilterEngineLayer? pushBackdropFilter(
507+
BackdropFilterEngineLayer pushBackdropFilter(
508508
ImageFilter filter, {
509509
BlendMode blendMode = BlendMode.srcOver,
510510
BackdropFilterEngineLayer? oldLayer,
@@ -530,7 +530,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
530530
/// {@macro dart.ui.sceneBuilder.oldLayerVsRetained}
531531
///
532532
/// See [pop] for details about the operation stack.
533-
ShaderMaskEngineLayer? pushShaderMask(
533+
ShaderMaskEngineLayer pushShaderMask(
534534
Shader shader,
535535
Rect maskRect,
536536
BlendMode blendMode, {
@@ -582,7 +582,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
582582
/// {@macro dart.ui.sceneBuilder.oldLayerVsRetained}
583583
///
584584
/// See [pop] for details about the operation stack, and [Clip] for different clip modes.
585-
PhysicalShapeEngineLayer? pushPhysicalShape({
585+
PhysicalShapeEngineLayer pushPhysicalShape({
586586
required Path path,
587587
required double elevation,
588588
required Color color,

lib/web_ui/lib/src/engine/canvaskit/layer_scene_builder.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class LayerSceneBuilder implements ui.SceneBuilder {
9898
}
9999

100100
@override
101-
BackdropFilterEngineLayer? pushBackdropFilter(
101+
BackdropFilterEngineLayer pushBackdropFilter(
102102
ui.ImageFilter filter, {
103103
ui.BlendMode blendMode = ui.BlendMode.srcOver,
104104
ui.EngineLayer? oldLayer,
@@ -110,7 +110,7 @@ class LayerSceneBuilder implements ui.SceneBuilder {
110110
}
111111

112112
@override
113-
ClipPathEngineLayer? pushClipPath(
113+
ClipPathEngineLayer pushClipPath(
114114
ui.Path path, {
115115
ui.Clip clipBehavior = ui.Clip.antiAlias,
116116
ui.EngineLayer? oldLayer,
@@ -119,7 +119,7 @@ class LayerSceneBuilder implements ui.SceneBuilder {
119119
}
120120

121121
@override
122-
ClipRRectEngineLayer? pushClipRRect(
122+
ClipRRectEngineLayer pushClipRRect(
123123
ui.RRect rrect, {
124124
ui.Clip? clipBehavior,
125125
ui.EngineLayer? oldLayer,
@@ -128,7 +128,7 @@ class LayerSceneBuilder implements ui.SceneBuilder {
128128
}
129129

130130
@override
131-
ClipRectEngineLayer? pushClipRect(
131+
ClipRectEngineLayer pushClipRect(
132132
ui.Rect rect, {
133133
ui.Clip clipBehavior = ui.Clip.antiAlias,
134134
ui.EngineLayer? oldLayer,
@@ -137,15 +137,15 @@ class LayerSceneBuilder implements ui.SceneBuilder {
137137
}
138138

139139
@override
140-
ColorFilterEngineLayer? pushColorFilter(
140+
ColorFilterEngineLayer pushColorFilter(
141141
ui.ColorFilter filter, {
142142
ui.ColorFilterEngineLayer? oldLayer,
143143
}) {
144144
assert(filter != null); // ignore: unnecessary_null_comparison
145145
return pushLayer<ColorFilterEngineLayer>(ColorFilterEngineLayer(filter));
146146
}
147147

148-
ImageFilterEngineLayer? pushImageFilter(
148+
ImageFilterEngineLayer pushImageFilter(
149149
ui.ImageFilter filter, {
150150
ui.ImageFilterEngineLayer? oldLayer,
151151
}) {
@@ -202,7 +202,7 @@ class LayerSceneBuilder implements ui.SceneBuilder {
202202
}
203203

204204
@override
205-
TransformEngineLayer? pushTransform(
205+
TransformEngineLayer pushTransform(
206206
Float64List matrix4, {
207207
ui.EngineLayer? oldLayer,
208208
}) {

lib/web_ui/lib/src/ui/compositing.dart

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,56 +39,56 @@ abstract class SceneBuilder {
3939
return engine.SurfaceSceneBuilder();
4040
}
4141
}
42-
OffsetEngineLayer? pushOffset(
42+
OffsetEngineLayer pushOffset(
4343
double dx,
4444
double dy, {
4545
OffsetEngineLayer? oldLayer,
4646
});
47-
TransformEngineLayer? pushTransform(
47+
TransformEngineLayer pushTransform(
4848
Float64List matrix4, {
4949
TransformEngineLayer? oldLayer,
5050
});
51-
ClipRectEngineLayer? pushClipRect(
51+
ClipRectEngineLayer pushClipRect(
5252
Rect rect, {
5353
Clip clipBehavior = Clip.antiAlias,
5454
ClipRectEngineLayer? oldLayer,
5555
});
56-
ClipRRectEngineLayer? pushClipRRect(
56+
ClipRRectEngineLayer pushClipRRect(
5757
RRect rrect, {
5858
required Clip clipBehavior,
5959
ClipRRectEngineLayer? oldLayer,
6060
});
61-
ClipPathEngineLayer? pushClipPath(
61+
ClipPathEngineLayer pushClipPath(
6262
Path path, {
6363
Clip clipBehavior = Clip.antiAlias,
6464
ClipPathEngineLayer? oldLayer,
6565
});
66-
OpacityEngineLayer? pushOpacity(
66+
OpacityEngineLayer pushOpacity(
6767
int alpha, {
6868
Offset offset = Offset.zero,
6969
OpacityEngineLayer? oldLayer,
7070
});
71-
ColorFilterEngineLayer? pushColorFilter(
71+
ColorFilterEngineLayer pushColorFilter(
7272
ColorFilter filter, {
7373
ColorFilterEngineLayer? oldLayer,
7474
});
75-
ImageFilterEngineLayer? pushImageFilter(
75+
ImageFilterEngineLayer pushImageFilter(
7676
ImageFilter filter, {
7777
ImageFilterEngineLayer? oldLayer,
7878
});
79-
BackdropFilterEngineLayer? pushBackdropFilter(
79+
BackdropFilterEngineLayer pushBackdropFilter(
8080
ImageFilter filter, {
8181
BlendMode blendMode = BlendMode.srcOver,
8282
BackdropFilterEngineLayer? oldLayer,
8383
});
84-
ShaderMaskEngineLayer? pushShaderMask(
84+
ShaderMaskEngineLayer pushShaderMask(
8585
Shader shader,
8686
Rect maskRect,
8787
BlendMode blendMode, {
8888
ShaderMaskEngineLayer? oldLayer,
8989
FilterQuality filterQuality = FilterQuality.low,
9090
});
91-
PhysicalShapeEngineLayer? pushPhysicalShape({
91+
PhysicalShapeEngineLayer pushPhysicalShape({
9292
required Path path,
9393
required double elevation,
9494
required Color color,

0 commit comments

Comments
 (0)