Unverified Commit 925ff2dc authored by Kate Lovett's avatar Kate Lovett Committed by GitHub

Remove deprecated StatefulElement.inheritFromElement (#72901)

parent ed66037f
...@@ -11,6 +11,17 @@ ...@@ -11,6 +11,17 @@
version: 1 version: 1
transforms: transforms:
# Changes made in https://github.com/flutter/flutter/pull/44189
- title: 'Rename to dependOnInheritedElement'
date: 2020-12-23
element:
uris: [ 'material.dart', 'cupertino.dart', 'widgets.dart' ]
method: 'inheritFromElement'
inClass: 'StatefulElement'
changes:
- kind: 'rename'
newName: 'dependOnInheritedElement'
# Changes made in https://github.com/flutter/flutter/pull/15303 # Changes made in https://github.com/flutter/flutter/pull/15303
- title: 'Replace child with builder' - title: 'Replace child with builder'
date: 2020-12-17 date: 2020-12-17
...@@ -31,6 +42,7 @@ transforms: ...@@ -31,6 +42,7 @@ transforms:
value: 'arguments[child]' value: 'arguments[child]'
- kind: 'removeParameter' - kind: 'removeParameter'
name: 'child' name: 'child'
# Changes made in https://github.com/flutter/flutter/pull/28602 # Changes made in https://github.com/flutter/flutter/pull/28602
- title: 'Rename to fromMouseEvent' - title: 'Rename to fromMouseEvent'
date: 2020-12-15 date: 2020-12-15
......
...@@ -4919,16 +4919,6 @@ class StatefulElement extends ComponentElement { ...@@ -4919,16 +4919,6 @@ class StatefulElement extends ComponentElement {
state._element = null; state._element = null;
} }
// TODO(a14n): Remove this when it goes to stable, https://github.com/flutter/flutter/pull/44189
@Deprecated(
'Use dependOnInheritedElement instead. '
'This feature was deprecated after v1.12.1.'
)
@override
InheritedWidget inheritFromElement(Element ancestor, { Object? aspect }) {
return dependOnInheritedElement(ancestor, aspect: aspect);
}
@override @override
InheritedWidget dependOnInheritedElement(Element ancestor, { Object? aspect }) { InheritedWidget dependOnInheritedElement(Element ancestor, { Object? aspect }) {
assert(ancestor != null); assert(ancestor != null);
......
...@@ -8,4 +8,8 @@ void main() { ...@@ -8,4 +8,8 @@ void main() {
// Change made in https://github.com/flutter/flutter/pull/41859 // Change made in https://github.com/flutter/flutter/pull/41859
const CupertinoTextThemeData themeData = CupertinoTextThemeData(brightness: Brightness.dark); const CupertinoTextThemeData themeData = CupertinoTextThemeData(brightness: Brightness.dark);
themeData.copyWith(brightness: Brightness.light); themeData.copyWith(brightness: Brightness.light);
// Changes made in https://github.com/flutter/flutter/pull/44189
const StatefulElement statefulElement = StatefulElement(myWidget);
statefulElement.inheritFromElement(ancestor);
} }
...@@ -8,4 +8,8 @@ void main() { ...@@ -8,4 +8,8 @@ void main() {
// Change made in https://github.com/flutter/flutter/pull/41859 // Change made in https://github.com/flutter/flutter/pull/41859
const CupertinoTextThemeData themeData = CupertinoTextThemeData(); const CupertinoTextThemeData themeData = CupertinoTextThemeData();
themeData.copyWith(); themeData.copyWith();
// Changes made in https://github.com/flutter/flutter/pull/44189
const StatefulElement statefulElement = StatefulElement(myWidget);
statefulElement.dependOnInheritedElement(ancestor);
} }
...@@ -7,4 +7,8 @@ import 'package:flutter/material.dart'; ...@@ -7,4 +7,8 @@ import 'package:flutter/material.dart';
void main() { void main() {
// Change made in https://github.com/flutter/flutter/pull/15303 // Change made in https://github.com/flutter/flutter/pull/15303
showDialog(child: Text('Fix me.')); showDialog(child: Text('Fix me.'));
// Changes made in https://github.com/flutter/flutter/pull/44189
const StatefulElement statefulElement = StatefulElement(myWidget);
statefulElement.inheritFromElement(ancestor);
} }
...@@ -7,4 +7,8 @@ import 'package:flutter/material.dart'; ...@@ -7,4 +7,8 @@ import 'package:flutter/material.dart';
void main() { void main() {
// Change made in https://github.com/flutter/flutter/pull/15303 // Change made in https://github.com/flutter/flutter/pull/15303
showDialog(builder: (context) => Text('Fix me.')); showDialog(builder: (context) => Text('Fix me.'));
// Changes made in https://github.com/flutter/flutter/pull/44189
const StatefulElement statefulElement = StatefulElement(myWidget);
statefulElement.dependOnInheritedElement(ancestor);
} }
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/widgets.dart';
void main() {
// Changes made in https://github.com/flutter/flutter/pull/44189
const StatefulElement statefulElement = StatefulElement(myWidget);
statefulElement.inheritFromElement(ancestor);
}
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/widgets.dart';
void main() {
// Changes made in https://github.com/flutter/flutter/pull/44189
const StatefulElement statefulElement = StatefulElement(myWidget);
statefulElement.dependOnInheritedElement(ancestor);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment