From 6db39fe95be42b5b74d0188dbecc7d628211ce43 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Fri, 20 Nov 2015 13:15:32 -0800 Subject: [PATCH] Rename LabeledGlobalKey's argument to debugLabel The old name was confusing. Fixes #462 --- examples/address_book/lib/main.dart | 12 ++++++------ packages/flutter/lib/src/material/dropdown.dart | 2 +- packages/flutter/lib/src/widgets/framework.dart | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/address_book/lib/main.dart b/examples/address_book/lib/main.dart index e1066a1142..18359b60b6 100644 --- a/examples/address_book/lib/main.dart +++ b/examples/address_book/lib/main.dart @@ -48,12 +48,12 @@ class AddressBookHome extends StatelessComponent { ); } - static final GlobalKey nameKey = new GlobalKey(label: 'name field'); - static final GlobalKey phoneKey = new GlobalKey(label: 'phone field'); - static final GlobalKey emailKey = new GlobalKey(label: 'email field'); - static final GlobalKey addressKey = new GlobalKey(label: 'address field'); - static final GlobalKey ringtoneKey = new GlobalKey(label: 'ringtone field'); - static final GlobalKey noteKey = new GlobalKey(label: 'note field'); + static final GlobalKey nameKey = new GlobalKey(debugLabel: 'name field'); + static final GlobalKey phoneKey = new GlobalKey(debugLabel: 'phone field'); + static final GlobalKey emailKey = new GlobalKey(debugLabel: 'email field'); + static final GlobalKey addressKey = new GlobalKey(debugLabel: 'address field'); + static final GlobalKey ringtoneKey = new GlobalKey(debugLabel: 'ringtone field'); + static final GlobalKey noteKey = new GlobalKey(debugLabel: 'note field'); Widget buildBody(BuildContext context) { return new Block([ diff --git a/packages/flutter/lib/src/material/dropdown.dart b/packages/flutter/lib/src/material/dropdown.dart index 3b2aff9240..f5fc386276 100644 --- a/packages/flutter/lib/src/material/dropdown.dart +++ b/packages/flutter/lib/src/material/dropdown.dart @@ -239,7 +239,7 @@ class DropdownButton extends StatelessComponent { } Widget build(BuildContext context) { - GlobalKey indexedStackKey = new GlobalKey(label: 'DropdownButton.IndexedStack'); + GlobalKey indexedStackKey = new GlobalKey(debugLabel: 'DropdownButton.IndexedStack'); int selectedIndex = 0; for (int itemIndex = 0; itemIndex < items.length; itemIndex++) { if (items[itemIndex].value == value) { diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index d40d660773..b3a88626ec 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -75,7 +75,7 @@ abstract class GlobalKey> extends Key { /// Constructs a LabeledGlobalKey, which is a GlobalKey with a label used for debugging. /// The label is not used for comparing the identity of the key. - factory GlobalKey({ String label }) => new LabeledGlobalKey(label); // the label is purely for debugging purposes and is otherwise ignored + factory GlobalKey({ String debugLabel }) => new LabeledGlobalKey(debugLabel); // the label is purely for debugging purposes and is otherwise ignored static final Map _registry = new Map(); static final Map _debugDuplicates = new Map(); @@ -175,9 +175,9 @@ abstract class GlobalKey> extends Key { /// The optional label can be used for documentary purposes. It does not affect /// the key's identity. class LabeledGlobalKey> extends GlobalKey { - const LabeledGlobalKey(this._label) : super.constructor(); - final String _label; - String toString() => '[GlobalKey ${_label != null ? _label : hashCode}]'; + const LabeledGlobalKey(this._debugLabel) : super.constructor(); + final String _debugLabel; + String toString() => '[GlobalKey ${_debugLabel != null ? _debugLabel : hashCode}]'; } /// A kind of [GlobalKey] that takes its identity from the object used as its value.