Rename defaultFocus to initialFocus.

This commit is contained in:
Hixie
2015-07-23 08:43:29 -07:00
parent 4da276710f
commit 3aa0437ff2
3 changed files with 5 additions and 5 deletions

View File

@@ -112,7 +112,7 @@ class AddressBookApp extends App {
child: new TaskDescription(
label: 'Address Book',
child: new Focus(
defaultFocus: nameKey,
initialFocus: nameKey,
child: buildMain()
)
)

View File

@@ -322,7 +322,7 @@ class StockHome extends StatefulComponent {
];
addMenuToOverlays(overlays);
return new Focus(
defaultFocus: searchFieldKey,
initialFocus: searchFieldKey,
child: new Stack(overlays)
);
}

View File

@@ -14,17 +14,17 @@ class Focus extends Inherited {
Focus({
GlobalKey key,
GlobalKey defaultFocus,
GlobalKey initialFocus,
Widget child
}) : super(key: key, child: child);
GlobalKey defaultFocus;
GlobalKey initialFocus;
GlobalKey _currentlyFocusedKey;
GlobalKey get currentlyFocusedKey {
if (_currentlyFocusedKey != null)
return _currentlyFocusedKey;
return defaultFocus;
return initialFocus;
}
void set currentlyFocusedKey(GlobalKey value) {
if (value != _currentlyFocusedKey) {