Unverified Commit 73ce3f21 authored by Hans Muller's avatar Hans Muller Committed by GitHub

Updated old button references in packages/flutter_test (#63230)

parent 61349ca6
......@@ -583,9 +583,11 @@ void main() {
theme: ThemeData.light(),
home: Scaffold(
backgroundColor: Colors.white,
body: RaisedButton(
color: const Color(0xFFFBBC04),
elevation: 0,
body: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: const Color(0xFFFBBC04),
elevation: 0,
),
onPressed: () {},
child: const Text('Button', style: TextStyle(color: Colors.black)),
),
......
......@@ -10,11 +10,13 @@ void main() {
tester.binding.window.devicePixelRatioTestValue = 1.2;
tester.binding.window.physicalSizeTestValue = const Size(250, 300);
final RaisedButton invalidButton = RaisedButton(
final Widget invalidButton = ElevatedButton(
onPressed: () {},
style: ElevatedButton.styleFrom(
primary: Colors.orangeAccent, // background fill color
onPrimary: Colors.orange, // text foreground color
),
child: const Text('Button'),
textColor: Colors.orange,
color: Colors.orangeAccent,
);
await tester.pumpWidget(MaterialApp(home: Scaffold(body: invalidButton)));
......@@ -26,15 +28,17 @@ void main() {
tester.binding.window.devicePixelRatioTestValue = 4.2;
tester.binding.window.physicalSizeTestValue = const Size(2500, 3000);
final RaisedButton invalidButton = RaisedButton(
final Widget invalidButton = ElevatedButton(
onPressed: () {},
style: ElevatedButton.styleFrom(
primary: Colors.orangeAccent, // background fill color
onPrimary: Colors.orange, // text foreground color
),
child: const Text('Button'),
textColor: Colors.orange,
color: Colors.orangeAccent,
);
await tester.pumpWidget(MaterialApp(home: Scaffold(body: invalidButton)));
final Evaluation result = await textContrastGuideline.evaluate(tester);
expect(result.passed, false);
});
}
\ No newline at end of file
}
......@@ -63,7 +63,7 @@ void main() {
MaterialApp(
home: Scaffold(
body: Container(
child: OutlineButton(
child: OutlinedButton(
onPressed: () { },
child: const Text('hello'),
),
......@@ -85,7 +85,7 @@ void main() {
MaterialApp(
home: Scaffold(
body: Container(
child: OutlineButton(
child: OutlinedButton(
onPressed: () { },
child: const Text('hello'),
),
......
......@@ -41,7 +41,7 @@ void main() {
Semantics(
label: 'Add',
button: true,
child: const FlatButton(
child: const TextButton(
child: Text('+'),
onPressed: null,
),
......
......@@ -18,7 +18,7 @@ class _CountButtonState extends State<CountButton> {
int counter = 0;
@override
Widget build(BuildContext context) {
return RaisedButton(
return ElevatedButton(
child: Text('Counter $counter'),
onPressed: () {
setState(() {
......
......@@ -375,7 +375,7 @@ void main() {
home: Center(
child: Builder(
builder: (BuildContext context) {
return RaisedButton(
return ElevatedButton(
child: const Text('Next'),
onPressed: () {
Navigator.push<void>(context, MaterialPageRoute<void>(
......
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