Rationalise the Key API.
Add a way of having keys based on numeric types or DateTimes by having a ValueKey<T> class. Remove the redundant ways of declaring things, except for leaving one shorthand -- you can say `new Key(s)` instead of `new ValueKey<String>(s)`.
This commit is contained in:
@@ -13,7 +13,7 @@ void main() {
|
||||
new Mimicable(
|
||||
key: globalKey,
|
||||
child: new Container(
|
||||
key: new Key.stringify('inner'),
|
||||
key: new Key('inner'),
|
||||
height: 10.0,
|
||||
width: 10.0
|
||||
)
|
||||
@@ -50,13 +50,13 @@ void main() {
|
||||
tester.pumpFrame(() {
|
||||
return new Flex([
|
||||
new Container(
|
||||
key: new Key.stringify('outer'),
|
||||
key: new Key('outer'),
|
||||
height: 10.0,
|
||||
width: 10.0,
|
||||
child: new Mimicable(
|
||||
key: globalKey,
|
||||
child: new Container(
|
||||
key: new Key.stringify('inner'),
|
||||
key: new Key('inner'),
|
||||
height: 10.0,
|
||||
width: 10.0
|
||||
)
|
||||
|
||||
@@ -14,7 +14,7 @@ void main() {
|
||||
|
||||
Widget buildPage(int page) {
|
||||
return new Container(
|
||||
key: new StringKey(page.toString()),
|
||||
key: new ValueKey<int>(page),
|
||||
width: pageSize.width,
|
||||
height: pageSize.height,
|
||||
child: new Text(page.toString())
|
||||
|
||||
Reference in New Issue
Block a user