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