From 616c6d7918f79416accb6d8fa978c598c8a36a49 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Sat, 5 Dec 2015 09:06:36 -0800 Subject: [PATCH] LayoutId should default to using its id as its key This default seems likely to be benefitial because typically the LayoutIds coorespond to semantic slots in a bespoke layout. --- packages/flutter/lib/src/widgets/basic.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index d4f047e9cf1..e9c2b01f029 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -304,9 +304,10 @@ class LayoutId extends ParentDataWidget { LayoutId({ Key key, Widget child, - this.id - }) : super(key: key, child: child) { + Object id + }) : id = id, super(key: key ?? new ValueKey(id), child: child) { assert(child != null); + assert(id != null); } final Object id;