From 6574484fc2a86cc835b8c2daabe276b1ea5df4a4 Mon Sep 17 00:00:00 2001 From: "Lasse R.H. Nielsen" Date: Wed, 24 Jul 2024 00:14:13 +0200 Subject: [PATCH] Fix the type of `RenderTable.get rowDecorations`. (#151886) This changes the return type from `List` to `List`, matching the corresponding setter. As such it is a breaking change. I believe the current type is a *bug*, and this is the correct fix. The underlying value has a nullable element type, and the setter accepts a list which can contain `null`, but the getter tries to create a list with non-nullable elements from the stored value. Calling this getter while the list contains `null` will throw. (If this fix is too simplistic, I'll file a bug for the issue instead.) --- packages/flutter/lib/src/rendering/table.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/flutter/lib/src/rendering/table.dart b/packages/flutter/lib/src/rendering/table.dart index 33fd5490f9..b15d941adb 100644 --- a/packages/flutter/lib/src/rendering/table.dart +++ b/packages/flutter/lib/src/rendering/table.dart @@ -535,7 +535,7 @@ class RenderTable extends RenderBox { /// Row decorations fill the horizontal and vertical extent of each row in /// the table, unlike decorations for individual cells, which might not fill /// either. - List get rowDecorations => List.unmodifiable(_rowDecorations ?? const []); + List get rowDecorations => List.unmodifiable(_rowDecorations ?? const []); // _rowDecorations and _rowDecorationPainters need to be in sync. They have to // either both be null or have same length. List? _rowDecorations;