Unverified Commit 724c0eb6 authored by Viren Khatri's avatar Viren Khatri Committed by GitHub

Changing ElevatedButton.child to be non-nullable (#87901)

parent 7d76a827
...@@ -96,7 +96,7 @@ class ElevatedButton extends ButtonStyleButton { ...@@ -96,7 +96,7 @@ class ElevatedButton extends ButtonStyleButton {
FocusNode? focusNode, FocusNode? focusNode,
bool autofocus = false, bool autofocus = false,
Clip clipBehavior = Clip.none, Clip clipBehavior = Clip.none,
required Widget? child, required Widget child,
}) : super( }) : super(
key: key, key: key,
onPressed: onPressed, onPressed: onPressed,
......
...@@ -7157,7 +7157,7 @@ class IgnorePointer extends SingleChildRenderObjectWidget { ...@@ -7157,7 +7157,7 @@ class IgnorePointer extends SingleChildRenderObjectWidget {
/// height: 100.0, /// height: 100.0,
/// child: ElevatedButton( /// child: ElevatedButton(
/// onPressed: () {}, /// onPressed: () {},
/// child: null, /// child: const Text('Lower'),
/// ), /// ),
/// ), /// ),
/// SizedBox( /// SizedBox(
...@@ -7170,7 +7170,7 @@ class IgnorePointer extends SingleChildRenderObjectWidget { ...@@ -7170,7 +7170,7 @@ class IgnorePointer extends SingleChildRenderObjectWidget {
/// primary: Colors.blue.shade200, /// primary: Colors.blue.shade200,
/// ), /// ),
/// onPressed: () {}, /// onPressed: () {},
/// child: null, /// child: const Text('Upper'),
/// ), /// ),
/// ), /// ),
/// ), /// ),
......
...@@ -244,7 +244,7 @@ void main() { ...@@ -244,7 +244,7 @@ void main() {
onPressed: () { onPressed: () {
pressed = true; pressed = true;
}, },
child: null, child: const Text('Button'),
), ),
const Material( const Material(
type: MaterialType.transparency, type: MaterialType.transparency,
......
...@@ -287,7 +287,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { ...@@ -287,7 +287,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
final GlobalKey topButtonKey = GlobalKey(); final GlobalKey topButtonKey = GlobalKey();
Widget selectButtonBuilder(BuildContext context, VoidCallback onPressed) { Widget selectButtonBuilder(BuildContext context, VoidCallback onPressed) {
return Material(child: ElevatedButton(onPressed: onPressed, key: selectButtonKey, child: null)); return Material(child: ElevatedButton(onPressed: onPressed, key: selectButtonKey, child: const Text('Button')));
} }
// State type is private, hence using dynamic. // State type is private, hence using dynamic.
dynamic getInspectorState() => inspectorKey.currentState; dynamic getInspectorState() => inspectorKey.currentState;
...@@ -390,7 +390,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { ...@@ -390,7 +390,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
final GlobalKey inspectorKey = GlobalKey(); final GlobalKey inspectorKey = GlobalKey();
Widget selectButtonBuilder(BuildContext context, VoidCallback onPressed) { Widget selectButtonBuilder(BuildContext context, VoidCallback onPressed) {
return Material(child: ElevatedButton(onPressed: onPressed, key: selectButtonKey, child: null)); return Material(child: ElevatedButton(onPressed: onPressed, key: selectButtonKey, child: const Text('Button')));
} }
// State type is private, hence using dynamic. // State type is private, hence using dynamic.
dynamic getInspectorState() => inspectorKey.currentState; dynamic getInspectorState() => inspectorKey.currentState;
...@@ -590,7 +590,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { ...@@ -590,7 +590,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
InspectorSelectButtonBuilder selectButtonBuilder(Key key) { InspectorSelectButtonBuilder selectButtonBuilder(Key key) {
return (BuildContext context, VoidCallback onPressed) { return (BuildContext context, VoidCallback onPressed) {
return Material(child: ElevatedButton(onPressed: onPressed, key: key, child: null)); return Material(child: ElevatedButton(onPressed: onPressed, key: key, child: const Text('Button')));
}; };
} }
......
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