diff --git a/lib/web_ui/lib/src/engine/canvas_pool.dart b/lib/web_ui/lib/src/engine/canvas_pool.dart index 60365b892d0e3..f997b23ac4dba 100644 --- a/lib/web_ui/lib/src/engine/canvas_pool.dart +++ b/lib/web_ui/lib/src/engine/canvas_pool.dart @@ -1011,13 +1011,10 @@ class ContextStateHandle { context.translate(shaderBounds!.left, shaderBounds.top); } } - } else if (paint.color != null) { + } else { final String? colorString = colorValueToCssString(paint.color); fillStyle = colorString; strokeStyle = colorString; - } else { - fillStyle = '#000000'; - strokeStyle = '#000000'; } final ui.MaskFilter? maskFilter = paint.maskFilter; diff --git a/lib/web_ui/lib/src/engine/html/dom_canvas.dart b/lib/web_ui/lib/src/engine/html/dom_canvas.dart index c450f744c527f..0e79b3e08baf8 100644 --- a/lib/web_ui/lib/src/engine/html/dom_canvas.dart +++ b/lib/web_ui/lib/src/engine/html/dom_canvas.dart @@ -257,8 +257,7 @@ DomHTMLElement buildDrawRectElement( ..transformOrigin = '0 0 0' ..transform = effectiveTransform; - String cssColor = - paint.color == null ? '#000000' : colorValueToCssString(paint.color)!; + String cssColor = colorValueToCssString(paint.color)!; if (paint.maskFilter != null) { final double sigma = paint.maskFilter!.webOnlySigma; @@ -352,10 +351,8 @@ SVGSVGElement pathToSvgElement(SurfacePath path, SurfacePaintData paint) { svgPath.setAttribute('stroke-linecap', '${stringForStrokeCap(paint.strokeCap)}'); } svgPath.setAttribute('fill', 'none'); - } else if (paint.color != null) { - svgPath.setAttribute('fill', colorValueToCssString(paint.color)!); } else { - svgPath.setAttribute('fill', '#000000'); + svgPath.setAttribute('fill', colorValueToCssString(paint.color)!); } if (path.fillType == ui.PathFillType.evenOdd) { svgPath.setAttribute('fill-rule', 'evenodd'); diff --git a/lib/web_ui/lib/src/engine/html/painting.dart b/lib/web_ui/lib/src/engine/html/painting.dart index cc0b2971d925f..78e5f64239f7c 100644 --- a/lib/web_ui/lib/src/engine/html/painting.dart +++ b/lib/web_ui/lib/src/engine/html/painting.dart @@ -268,9 +268,7 @@ class SurfacePaintData { if (strokeJoin != null) { buffer.write('strokeJoin = $strokeJoin; '); } - if (color != null) { - buffer.write('color = ${colorToCssString(ui.Color(color))}; '); - } + buffer.write('color = ${colorToCssString(ui.Color(color))}; '); if (shader != null) { buffer.write('shader = $shader; '); } diff --git a/lib/web_ui/lib/src/engine/semantics/semantics.dart b/lib/web_ui/lib/src/engine/semantics/semantics.dart index bc3370cbe9bf5..def6a0775a482 100644 --- a/lib/web_ui/lib/src/engine/semantics/semantics.dart +++ b/lib/web_ui/lib/src/engine/semantics/semantics.dart @@ -868,7 +868,6 @@ class SemanticsObject { void updateSelf(SemanticsNodeUpdate update) { // Update all field values and their corresponding dirty flags before // applying the updates to the DOM. - assert(update.flags != null); if (_flags != update.flags) { _flags = update.flags; _markFlagsDirty(); @@ -1613,12 +1612,7 @@ class EngineSemanticsOwner { /// the Web Engine. /// /// The default mode is [AccessibilityMode.unknown]. - AccessibilityMode get mode => _mode; - set mode(AccessibilityMode value) { - _mode = value; - } - - AccessibilityMode _mode = AccessibilityMode.unknown; + AccessibilityMode mode = AccessibilityMode.unknown; /// Currently used [GestureMode]. ///