Unverified Commit 2856d663 authored by Darren Austin's avatar Darren Austin Committed by GitHub

Updated the framework tests to use the new button API. (#62220)

parent 0beda0e7
...@@ -208,7 +208,7 @@ void main() { ...@@ -208,7 +208,7 @@ void main() {
child: Center( child: Center(
child: Builder( child: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return RaisedButton( return ElevatedButton(
child: const Text('X'), child: const Text('X'),
onPressed: () { onPressed: () {
showTimePicker( showTimePicker(
......
...@@ -23,7 +23,7 @@ void main() { ...@@ -23,7 +23,7 @@ void main() {
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[
FlatButton( TextButton(
child: const Text('TapHere'), child: const Text('TapHere'),
onPressed: onButtonPressed, onPressed: onButtonPressed,
), ),
......
...@@ -270,7 +270,7 @@ void main() { ...@@ -270,7 +270,7 @@ void main() {
child: ListView( child: ListView(
children: <Widget>[ children: <Widget>[
const Text('drawer'), const Text('drawer'),
FlatButton( TextButton(
child: const Text('close'), child: const Text('close'),
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
), ),
...@@ -278,7 +278,7 @@ void main() { ...@@ -278,7 +278,7 @@ void main() {
), ),
), ),
body: Container( body: Container(
child: FlatButton( child: TextButton(
child: const Text('button'), child: const Text('button'),
onPressed: () { buttonPressed = true; }, onPressed: () { buttonPressed = true; },
), ),
......
...@@ -5344,7 +5344,7 @@ class _TransformedEditableTextState extends State<TransformedEditableText> { ...@@ -5344,7 +5344,7 @@ class _TransformedEditableTextState extends State<TransformedEditableText> {
backgroundCursorColor: Colors.grey, backgroundCursorColor: Colors.grey,
), ),
), ),
RaisedButton( ElevatedButton(
key: widget.transformButtonKey, key: widget.transformButtonKey,
onPressed: () { onPressed: () {
setState(() { setState(() {
......
...@@ -49,15 +49,15 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ ...@@ -49,15 +49,15 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
child: Container(height: 100.0, width: 100.0, key: firstKey), child: Container(height: 100.0, width: 100.0, key: firstKey),
)), )),
const SizedBox(height: 100.0, width: 100.0), const SizedBox(height: 100.0, width: 100.0),
FlatButton( TextButton(
child: const Text('two'), child: const Text('two'),
onPressed: () { Navigator.pushNamed(context, '/two'); }, onPressed: () { Navigator.pushNamed(context, '/two'); },
), ),
FlatButton( TextButton(
child: const Text('twoInset'), child: const Text('twoInset'),
onPressed: () { Navigator.pushNamed(context, '/twoInset'); }, onPressed: () { Navigator.pushNamed(context, '/twoInset'); },
), ),
FlatButton( TextButton(
child: const Text('simple'), child: const Text('simple'),
onPressed: () { Navigator.pushNamed(context, '/simple'); }, onPressed: () { Navigator.pushNamed(context, '/simple'); },
), ),
...@@ -68,7 +68,7 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ ...@@ -68,7 +68,7 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
child: ListView( child: ListView(
key: routeTwoKey, key: routeTwoKey,
children: <Widget>[ children: <Widget>[
FlatButton( TextButton(
child: const Text('pop'), child: const Text('pop'),
onPressed: () { Navigator.pop(context); }, onPressed: () { Navigator.pop(context); },
), ),
...@@ -79,7 +79,7 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ ...@@ -79,7 +79,7 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
child: Container(height: 150.0, width: 150.0, key: secondKey), child: Container(height: 150.0, width: 150.0, key: secondKey),
)), )),
const SizedBox(height: 150.0, width: 150.0), const SizedBox(height: 150.0, width: 150.0),
FlatButton( TextButton(
child: const Text('three'), child: const Text('three'),
onPressed: () { Navigator.push(context, ThreeRoute()); }, onPressed: () { Navigator.push(context, ThreeRoute()); },
), ),
...@@ -94,7 +94,7 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ ...@@ -94,7 +94,7 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
child: ListView( child: ListView(
key: routeTwoKey, key: routeTwoKey,
children: <Widget>[ children: <Widget>[
FlatButton( TextButton(
child: const Text('pop'), child: const Text('pop'),
onPressed: () { Navigator.pop(context); }, onPressed: () { Navigator.pop(context); },
), ),
...@@ -110,7 +110,7 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ ...@@ -110,7 +110,7 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
), ),
), ),
const SizedBox(height: 150.0, width: 150.0), const SizedBox(height: 150.0, width: 150.0),
FlatButton( TextButton(
child: const Text('three'), child: const Text('three'),
onPressed: () { Navigator.push(context, ThreeRoute()); }, onPressed: () { Navigator.push(context, ThreeRoute()); },
), ),
...@@ -433,7 +433,7 @@ Future<void> main() async { ...@@ -433,7 +433,7 @@ Future<void> main() async {
children: <Widget>[ children: <Widget>[
const Hero(tag: 'a', child: Text('foo')), const Hero(tag: 'a', child: Text('foo')),
Builder(builder: (BuildContext context) { Builder(builder: (BuildContext context) {
return FlatButton(child: const Text('two'), onPressed: () => Navigator.push(context, route)); return TextButton(child: const Text('two'), onPressed: () => Navigator.push(context, route));
}), }),
], ],
), ),
...@@ -618,7 +618,7 @@ Future<void> main() async { ...@@ -618,7 +618,7 @@ Future<void> main() async {
const Hero(tag: 'a', child: Text('a too')), const Hero(tag: 'a', child: Text('a too')),
Builder( Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return FlatButton( return TextButton(
child: const Text('push'), child: const Text('push'),
onPressed: () { onPressed: () {
Navigator.push(context, PageRouteBuilder<void>( Navigator.push(context, PageRouteBuilder<void>(
...@@ -821,7 +821,7 @@ Future<void> main() async { ...@@ -821,7 +821,7 @@ Future<void> main() async {
); );
}, },
), ),
FlatButton( TextButton(
child: const Text('POP'), child: const Text('POP'),
onPressed: () { Navigator.pop(context); }, onPressed: () { Navigator.pop(context); },
), ),
...@@ -842,7 +842,7 @@ Future<void> main() async { ...@@ -842,7 +842,7 @@ Future<void> main() async {
Card( Card(
child: Hero(tag: 'H', child: Container(key: homeHeroKey, height: 100.0, width: 100.0)), child: Hero(tag: 'H', child: Container(key: homeHeroKey, height: 100.0, width: 100.0)),
), ),
FlatButton( TextButton(
child: const Text('PUSH'), child: const Text('PUSH'),
onPressed: () { Navigator.push(context, route); }, onPressed: () { Navigator.push(context, route); },
), ),
...@@ -919,7 +919,7 @@ Future<void> main() async { ...@@ -919,7 +919,7 @@ Future<void> main() async {
key: routeContainerKey, key: routeContainerKey,
child: Hero(tag: 'H', child: Container(key: routeHeroKey, height: 200.0, width: 200.0)), child: Hero(tag: 'H', child: Container(key: routeHeroKey, height: 200.0, width: 200.0)),
), ),
FlatButton( TextButton(
child: const Text('POP'), child: const Text('POP'),
onPressed: () { Navigator.pop(context); }, onPressed: () { Navigator.pop(context); },
), ),
...@@ -950,7 +950,7 @@ Future<void> main() async { ...@@ -950,7 +950,7 @@ Future<void> main() async {
Container( Container(
child: Hero(tag: 'H', child: Container(key: homeHeroKey, height: 100.0, width: 100.0)), child: Hero(tag: 'H', child: Container(key: homeHeroKey, height: 100.0, width: 100.0)),
), ),
FlatButton( TextButton(
child: const Text('PUSH'), child: const Text('PUSH'),
onPressed: () { Navigator.push(context, route); }, onPressed: () { Navigator.push(context, route); },
), ),
...@@ -1029,7 +1029,7 @@ Future<void> main() async { ...@@ -1029,7 +1029,7 @@ Future<void> main() async {
Container( Container(
child: Hero(tag: 'H', child: Container(key: homeHeroKey, height: 100.0, width: 100.0)), child: Hero(tag: 'H', child: Container(key: homeHeroKey, height: 100.0, width: 100.0)),
), ),
FlatButton( TextButton(
child: const Text('PUSH'), child: const Text('PUSH'),
onPressed: () { Navigator.push(context, route); }, onPressed: () { Navigator.push(context, route); },
), ),
...@@ -1117,7 +1117,7 @@ Future<void> main() async { ...@@ -1117,7 +1117,7 @@ Future<void> main() async {
), ),
), ),
), ),
FlatButton( TextButton(
child: const Text('PUSH C'), child: const Text('PUSH C'),
onPressed: () { Navigator.push(context, routeC); }, onPressed: () { Navigator.push(context, routeC); },
), ),
...@@ -1157,7 +1157,7 @@ Future<void> main() async { ...@@ -1157,7 +1157,7 @@ Future<void> main() async {
), ),
), ),
), ),
FlatButton( TextButton(
child: const Text('PUSH B'), child: const Text('PUSH B'),
onPressed: () { Navigator.push(context, routeB); }, onPressed: () { Navigator.push(context, routeB); },
), ),
...@@ -1230,7 +1230,7 @@ Future<void> main() async { ...@@ -1230,7 +1230,7 @@ Future<void> main() async {
), ),
), ),
), ),
FlatButton( TextButton(
child: const Text('POP'), child: const Text('POP'),
onPressed: () { Navigator.pop(context); }, onPressed: () { Navigator.pop(context); },
), ),
...@@ -1256,7 +1256,7 @@ Future<void> main() async { ...@@ -1256,7 +1256,7 @@ Future<void> main() async {
), ),
), ),
), ),
FlatButton( TextButton(
child: const Text('PUSH'), child: const Text('PUSH'),
onPressed: () { Navigator.push(context, route); }, onPressed: () { Navigator.push(context, route); },
), ),
...@@ -1314,7 +1314,7 @@ Future<void> main() async { ...@@ -1314,7 +1314,7 @@ Future<void> main() async {
createRectTween: createRectTween, createRectTween: createRectTween,
child: Container(height: 100.0, width: 100.0, key: firstKey), child: Container(height: 100.0, width: 100.0, key: firstKey),
), ),
FlatButton( TextButton(
child: const Text('two'), child: const Text('two'),
onPressed: () { Navigator.pushNamed(context, '/two'); }, onPressed: () { Navigator.pushNamed(context, '/two'); },
), ),
...@@ -1327,7 +1327,7 @@ Future<void> main() async { ...@@ -1327,7 +1327,7 @@ Future<void> main() async {
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 200.0, height: 200.0,
child: FlatButton( child: TextButton(
child: const Text('pop'), child: const Text('pop'),
onPressed: () { Navigator.pop(context); }, onPressed: () { Navigator.pop(context); },
), ),
...@@ -1429,7 +1429,7 @@ Future<void> main() async { ...@@ -1429,7 +1429,7 @@ Future<void> main() async {
createRectTween: createRectTween, createRectTween: createRectTween,
child: Container(height: 100.0, width: 100.0, key: firstKey), child: Container(height: 100.0, width: 100.0, key: firstKey),
), ),
FlatButton( TextButton(
child: const Text('two'), child: const Text('two'),
onPressed: () { Navigator.pushNamed(context, '/two'); }, onPressed: () { Navigator.pushNamed(context, '/two'); },
), ),
...@@ -1442,7 +1442,7 @@ Future<void> main() async { ...@@ -1442,7 +1442,7 @@ Future<void> main() async {
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 200.0, height: 200.0,
child: FlatButton( child: TextButton(
child: const Text('pop'), child: const Text('pop'),
onPressed: () { Navigator.pop(context); }, onPressed: () { Navigator.pop(context); },
), ),
...@@ -1634,7 +1634,7 @@ Future<void> main() async { ...@@ -1634,7 +1634,7 @@ Future<void> main() async {
children: <Widget>[ children: <Widget>[
const Hero(tag: 'a', child: Text('foo')), const Hero(tag: 'a', child: Text('foo')),
Builder(builder: (BuildContext context) { Builder(builder: (BuildContext context) {
return FlatButton( return TextButton(
child: const Text('two'), child: const Text('two'),
onPressed: () => Navigator.push<void>(context, MaterialPageRoute<void>( onPressed: () => Navigator.push<void>(context, MaterialPageRoute<void>(
builder: (BuildContext context) { builder: (BuildContext context) {
...@@ -1684,7 +1684,7 @@ Future<void> main() async { ...@@ -1684,7 +1684,7 @@ Future<void> main() async {
}, },
), ),
Builder(builder: (BuildContext context) { Builder(builder: (BuildContext context) {
return FlatButton( return TextButton(
child: const Text('two'), child: const Text('two'),
onPressed: () => Navigator.push<void>(context, MaterialPageRoute<void>( onPressed: () => Navigator.push<void>(context, MaterialPageRoute<void>(
builder: (BuildContext context) { builder: (BuildContext context) {
......
...@@ -111,7 +111,7 @@ void main() { ...@@ -111,7 +111,7 @@ void main() {
showB, showB,
showC, showC,
showABC, showABC,
RaisedButton( ElevatedButton(
child: const Text('Increment a'), child: const Text('Increment a'),
onPressed: () { onPressed: () {
// Rebuilds the ABCModel which triggers a rebuild // Rebuilds the ABCModel which triggers a rebuild
...@@ -120,7 +120,7 @@ void main() { ...@@ -120,7 +120,7 @@ void main() {
setState(() { _a += 1; }); setState(() { _a += 1; });
}, },
), ),
RaisedButton( ElevatedButton(
child: const Text('Increment b'), child: const Text('Increment b'),
onPressed: () { onPressed: () {
// Rebuilds the ABCModel which triggers a rebuild // Rebuilds the ABCModel which triggers a rebuild
...@@ -129,7 +129,7 @@ void main() { ...@@ -129,7 +129,7 @@ void main() {
setState(() { _b += 1; }); setState(() { _b += 1; });
}, },
), ),
RaisedButton( ElevatedButton(
child: const Text('Increment c'), child: const Text('Increment c'),
onPressed: () { onPressed: () {
// Rebuilds the ABCModel which triggers a rebuild // Rebuilds the ABCModel which triggers a rebuild
...@@ -254,19 +254,19 @@ void main() { ...@@ -254,19 +254,19 @@ void main() {
const SizedBox(height: 24.0), const SizedBox(height: 24.0),
showABC, showABC,
const SizedBox(height: 24.0), const SizedBox(height: 24.0),
RaisedButton( ElevatedButton(
child: const Text('Increment a'), child: const Text('Increment a'),
onPressed: () { onPressed: () {
setState(() { _a += 1; }); setState(() { _a += 1; });
}, },
), ),
RaisedButton( ElevatedButton(
child: const Text('Increment b'), child: const Text('Increment b'),
onPressed: () { onPressed: () {
setState(() { _b += 1; }); setState(() { _b += 1; });
}, },
), ),
RaisedButton( ElevatedButton(
child: const Text('Increment c'), child: const Text('Increment c'),
onPressed: () { onPressed: () {
setState(() { _c += 1; }); setState(() { _c += 1; });
...@@ -371,25 +371,25 @@ void main() { ...@@ -371,25 +371,25 @@ void main() {
const SizedBox(height: 24.0), const SizedBox(height: 24.0),
showABC, showABC,
const SizedBox(height: 24.0), const SizedBox(height: 24.0),
RaisedButton( ElevatedButton(
child: const Text('Increment a'), child: const Text('Increment a'),
onPressed: () { onPressed: () {
setState(() { _a += 1; }); setState(() { _a += 1; });
}, },
), ),
RaisedButton( ElevatedButton(
child: const Text('Increment b'), child: const Text('Increment b'),
onPressed: () { onPressed: () {
setState(() { _b += 1; }); setState(() { _b += 1; });
}, },
), ),
RaisedButton( ElevatedButton(
child: const Text('Increment c'), child: const Text('Increment c'),
onPressed: () { onPressed: () {
setState(() { _c += 1; }); setState(() { _c += 1; });
}, },
), ),
RaisedButton( ElevatedButton(
child: const Text('rebuild'), child: const Text('rebuild'),
onPressed: () { onPressed: () {
setState(() { setState(() {
......
...@@ -203,13 +203,13 @@ void main() { ...@@ -203,13 +203,13 @@ void main() {
if (settings.name == '/') { if (settings.name == '/') {
return MaterialPageRoute<void>( return MaterialPageRoute<void>(
builder: (BuildContext context) { builder: (BuildContext context) {
return RaisedButton( return ElevatedButton(
child: const Text('Next'), child: const Text('Next'),
onPressed: () { onPressed: () {
Navigator.of(context).push( Navigator.of(context).push(
MaterialPageRoute<void>( MaterialPageRoute<void>(
builder: (BuildContext context) { builder: (BuildContext context) {
return RaisedButton( return ElevatedButton(
child: const Text('Inner page'), child: const Text('Inner page'),
onPressed: () { onPressed: () {
Navigator.of(context, rootNavigator: true).push( Navigator.of(context, rootNavigator: true).push(
...@@ -1063,19 +1063,19 @@ void main() { ...@@ -1063,19 +1063,19 @@ void main() {
await tester.pumpWidget(MaterialApp( await tester.pumpWidget(MaterialApp(
navigatorKey: key, navigatorKey: key,
navigatorObservers: <NavigatorObserver>[observer], navigatorObservers: <NavigatorObserver>[observer],
home: FlatButton( home: TextButton(
child: const Text('A'), child: const Text('A'),
onPressed: () { onPressed: () {
key.currentState.push<void>(routeB = MaterialPageRoute<void>( key.currentState.push<void>(routeB = MaterialPageRoute<void>(
settings: const RouteSettings(name: 'B'), settings: const RouteSettings(name: 'B'),
builder: (BuildContext context) { builder: (BuildContext context) {
return FlatButton( return TextButton(
child: const Text('B'), child: const Text('B'),
onPressed: () { onPressed: () {
key.currentState.push<void>(MaterialPageRoute<int>( key.currentState.push<void>(MaterialPageRoute<int>(
settings: const RouteSettings(name: 'C'), settings: const RouteSettings(name: 'C'),
builder: (BuildContext context) { builder: (BuildContext context) {
return FlatButton( return TextButton(
child: const Text('C'), child: const Text('C'),
onPressed: () { onPressed: () {
key.currentState.replace( key.currentState.replace(
...@@ -1157,14 +1157,14 @@ void main() { ...@@ -1157,14 +1157,14 @@ void main() {
}, },
), ),
), ),
home: FlatButton( home: TextButton(
child: const Text('A'), child: const Text('A'),
onPressed: () { onPressed: () {
key.currentState.push<void>(routeB = MaterialPageRoute<void>( key.currentState.push<void>(routeB = MaterialPageRoute<void>(
settings: const RouteSettings(name: 'B'), settings: const RouteSettings(name: 'B'),
builder: (BuildContext context) { builder: (BuildContext context) {
log.add('building B'); log.add('building B');
return FlatButton( return TextButton(
child: const Text('B'), child: const Text('B'),
onPressed: () { onPressed: () {
key.currentState.push<void>(MaterialPageRoute<int>( key.currentState.push<void>(MaterialPageRoute<int>(
...@@ -1172,7 +1172,7 @@ void main() { ...@@ -1172,7 +1172,7 @@ void main() {
builder: (BuildContext context) { builder: (BuildContext context) {
log.add('building C'); log.add('building C');
log.add('found ${ModalRoute.of(context).settings.name}'); log.add('found ${ModalRoute.of(context).settings.name}');
return FlatButton( return TextButton(
child: const Text('C'), child: const Text('C'),
onPressed: () { onPressed: () {
key.currentState.replace( key.currentState.replace(
......
...@@ -40,7 +40,7 @@ class _ExpandingBoxState extends State<ExpandingBox> with AutomaticKeepAliveClie ...@@ -40,7 +40,7 @@ class _ExpandingBoxState extends State<ExpandingBox> with AutomaticKeepAliveClie
color: Colors.green, color: Colors.green,
child: Align( child: Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: FlatButton( child: TextButton(
child: const Text('Collapse'), child: const Text('Collapse'),
onPressed: toggleSize, onPressed: toggleSize,
), ),
...@@ -68,7 +68,7 @@ void main() { ...@@ -68,7 +68,7 @@ void main() {
expect(position.minScrollExtent, 0.0); expect(position.minScrollExtent, 0.0);
expect(position.maxScrollExtent, 100.0); expect(position.maxScrollExtent, 100.0);
expect(position.pixels, 0.0); expect(position.pixels, 0.0);
await tester.tap(find.byType(FlatButton)); await tester.tap(find.byType(TextButton));
await tester.pump(); await tester.pump();
final TestGesture drag1 = await tester.startGesture(const Offset(10.0, 500.0)); final TestGesture drag1 = await tester.startGesture(const Offset(10.0, 500.0));
...@@ -91,7 +91,7 @@ void main() { ...@@ -91,7 +91,7 @@ void main() {
expect(position.pixels, moreOrLessEquals(900.0)); expect(position.pixels, moreOrLessEquals(900.0));
await tester.pump(); await tester.pump();
await tester.tap(find.byType(FlatButton)); await tester.tap(find.byType(TextButton));
await tester.pump(); await tester.pump();
expect(position.minScrollExtent, 0.0); expect(position.minScrollExtent, 0.0);
expect(position.maxScrollExtent, 100.0); expect(position.maxScrollExtent, 100.0);
...@@ -113,7 +113,7 @@ void main() { ...@@ -113,7 +113,7 @@ void main() {
expect(position.minScrollExtent, 0.0); expect(position.minScrollExtent, 0.0);
expect(position.maxScrollExtent, 100.0); expect(position.maxScrollExtent, 100.0);
expect(position.pixels, 0.0); expect(position.pixels, 0.0);
await tester.tap(find.byType(FlatButton)); await tester.tap(find.byType(TextButton));
await tester.pump(); // start button animation await tester.pump(); // start button animation
await tester.pump(const Duration(seconds: 1)); // finish button animation await tester.pump(const Duration(seconds: 1)); // finish button animation
expect(position.minScrollExtent, 0.0); expect(position.minScrollExtent, 0.0);
......
...@@ -1073,7 +1073,7 @@ void main() { ...@@ -1073,7 +1073,7 @@ void main() {
await tester.pumpWidget(MaterialApp( await tester.pumpWidget(MaterialApp(
home: Builder( home: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return RaisedButton( return ElevatedButton(
onPressed: () { onPressed: () {
showGeneralDialog<void>( showGeneralDialog<void>(
context: context, context: context,
...@@ -1093,7 +1093,7 @@ void main() { ...@@ -1093,7 +1093,7 @@ void main() {
)); ));
// Open the dialog. // Open the dialog.
await tester.tap(find.byType(RaisedButton)); await tester.tap(find.byType(ElevatedButton));
await tester.pump(); await tester.pump();
expect(find.byType(ModalBarrier), findsNWidgets(2)); expect(find.byType(ModalBarrier), findsNWidgets(2));
...@@ -1107,7 +1107,7 @@ void main() { ...@@ -1107,7 +1107,7 @@ void main() {
await tester.pumpWidget(MaterialApp( await tester.pumpWidget(MaterialApp(
home: Builder( home: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return RaisedButton( return ElevatedButton(
onPressed: () { onPressed: () {
showGeneralDialog<void>( showGeneralDialog<void>(
context: context, context: context,
...@@ -1125,7 +1125,7 @@ void main() { ...@@ -1125,7 +1125,7 @@ void main() {
)); ));
// Open the dialog. // Open the dialog.
await tester.tap(find.byType(RaisedButton)); await tester.tap(find.byType(ElevatedButton));
await tester.pump(); await tester.pump();
expect(find.byType(ModalBarrier), findsNWidgets(2)); expect(find.byType(ModalBarrier), findsNWidgets(2));
final ModalBarrier barrier = find.byType(ModalBarrier).evaluate().last.widget as ModalBarrier; final ModalBarrier barrier = find.byType(ModalBarrier).evaluate().last.widget as ModalBarrier;
...@@ -1150,7 +1150,7 @@ void main() { ...@@ -1150,7 +1150,7 @@ void main() {
onGenerateRoute: (RouteSettings settings) { onGenerateRoute: (RouteSettings settings) {
return MaterialPageRoute<dynamic>( return MaterialPageRoute<dynamic>(
builder: (BuildContext context) { builder: (BuildContext context) {
return RaisedButton( return ElevatedButton(
onPressed: () { onPressed: () {
showGeneralDialog<void>( showGeneralDialog<void>(
context: context, context: context,
...@@ -1170,7 +1170,7 @@ void main() { ...@@ -1170,7 +1170,7 @@ void main() {
)); ));
// Open the dialog. // Open the dialog.
await tester.tap(find.byType(RaisedButton)); await tester.tap(find.byType(ElevatedButton));
expect(rootObserver.dialogCount, 1); expect(rootObserver.dialogCount, 1);
expect(nestedObserver.dialogCount, 0); expect(nestedObserver.dialogCount, 0);
...@@ -1187,7 +1187,7 @@ void main() { ...@@ -1187,7 +1187,7 @@ void main() {
onGenerateRoute: (RouteSettings settings) { onGenerateRoute: (RouteSettings settings) {
return MaterialPageRoute<dynamic>( return MaterialPageRoute<dynamic>(
builder: (BuildContext context) { builder: (BuildContext context) {
return RaisedButton( return ElevatedButton(
onPressed: () { onPressed: () {
showGeneralDialog<void>( showGeneralDialog<void>(
useRootNavigator: false, useRootNavigator: false,
...@@ -1208,7 +1208,7 @@ void main() { ...@@ -1208,7 +1208,7 @@ void main() {
)); ));
// Open the dialog. // Open the dialog.
await tester.tap(find.byType(RaisedButton)); await tester.tap(find.byType(ElevatedButton));
expect(rootObserver.dialogCount, 0); expect(rootObserver.dialogCount, 0);
expect(nestedObserver.dialogCount, 1); expect(nestedObserver.dialogCount, 1);
...@@ -1223,7 +1223,7 @@ void main() { ...@@ -1223,7 +1223,7 @@ void main() {
onGenerateRoute: (RouteSettings settings) { onGenerateRoute: (RouteSettings settings) {
return MaterialPageRoute<dynamic>( return MaterialPageRoute<dynamic>(
builder: (BuildContext context) { builder: (BuildContext context) {
return RaisedButton( return ElevatedButton(
onPressed: () { onPressed: () {
showGeneralDialog<void>( showGeneralDialog<void>(
context: context, context: context,
...@@ -1241,7 +1241,7 @@ void main() { ...@@ -1241,7 +1241,7 @@ void main() {
)); ));
// Open the dialog. // Open the dialog.
await tester.tap(find.byType(RaisedButton)); await tester.tap(find.byType(ElevatedButton));
expect(rootObserver.dialogRoutes.length, equals(1)); expect(rootObserver.dialogRoutes.length, equals(1));
final ModalRoute<dynamic> route = rootObserver.dialogRoutes.last; final ModalRoute<dynamic> route = rootObserver.dialogRoutes.last;
expect(route.barrierDismissible, isNotNull); expect(route.barrierDismissible, isNotNull);
...@@ -1257,7 +1257,7 @@ void main() { ...@@ -1257,7 +1257,7 @@ void main() {
onGenerateRoute: (RouteSettings settings) { onGenerateRoute: (RouteSettings settings) {
return MaterialPageRoute<dynamic>( return MaterialPageRoute<dynamic>(
builder: (BuildContext context) { builder: (BuildContext context) {
return RaisedButton( return ElevatedButton(
onPressed: () { onPressed: () {
Navigator.of(context).push<void>( Navigator.of(context).push<void>(
MaterialPageRoute<void>( MaterialPageRoute<void>(
...@@ -1278,7 +1278,7 @@ void main() { ...@@ -1278,7 +1278,7 @@ void main() {
)); ));
// Open the new route. // Open the new route.
await tester.tap(find.byType(RaisedButton)); await tester.tap(find.byType(ElevatedButton));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(find.text('Open page'), findsNothing); expect(find.text('Open page'), findsNothing);
expect(find.byKey(containerKey), findsOneWidget); expect(find.byKey(containerKey), findsOneWidget);
...@@ -1307,7 +1307,7 @@ void main() { ...@@ -1307,7 +1307,7 @@ void main() {
onGenerateRoute: (RouteSettings settings) { onGenerateRoute: (RouteSettings settings) {
return MaterialPageRoute<dynamic>( return MaterialPageRoute<dynamic>(
builder: (BuildContext context) { builder: (BuildContext context) {
return RaisedButton( return ElevatedButton(
onPressed: () { onPressed: () {
Navigator.of(context).push<void>( Navigator.of(context).push<void>(
ModifiedReverseTransitionDurationRoute<void>( ModifiedReverseTransitionDurationRoute<void>(
...@@ -1330,7 +1330,7 @@ void main() { ...@@ -1330,7 +1330,7 @@ void main() {
)); ));
// Open the new route. // Open the new route.
await tester.tap(find.byType(RaisedButton)); await tester.tap(find.byType(ElevatedButton));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(find.text('Open page'), findsNothing); expect(find.text('Open page'), findsNothing);
expect(find.byKey(containerKey), findsOneWidget); expect(find.byKey(containerKey), findsOneWidget);
...@@ -1366,7 +1366,7 @@ void main() { ...@@ -1366,7 +1366,7 @@ void main() {
onGenerateRoute: (RouteSettings settings) { onGenerateRoute: (RouteSettings settings) {
return MaterialPageRoute<dynamic>( return MaterialPageRoute<dynamic>(
builder: (BuildContext context) { builder: (BuildContext context) {
return RaisedButton( return ElevatedButton(
onPressed: () { onPressed: () {
Navigator.of(context).push<void>( Navigator.of(context).push<void>(
ModifiedReverseTransitionDurationRoute<void>( ModifiedReverseTransitionDurationRoute<void>(
...@@ -1389,7 +1389,7 @@ void main() { ...@@ -1389,7 +1389,7 @@ void main() {
)); ));
// Open the new route. // Open the new route.
await tester.tap(find.byType(RaisedButton)); await tester.tap(find.byType(ElevatedButton));
await tester.pump(); await tester.pump();
await tester.pump(const Duration(milliseconds: 200)); // jump partway through the forward transition await tester.pump(const Duration(milliseconds: 200)); // jump partway through the forward transition
expect(find.byKey(containerKey), findsOneWidget); expect(find.byKey(containerKey), findsOneWidget);
...@@ -1427,7 +1427,7 @@ void main() { ...@@ -1427,7 +1427,7 @@ void main() {
child: Builder( child: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return Center( return Center(
child: RaisedButton( child: ElevatedButton(
child: const Text('X'), child: const Text('X'),
onPressed: () { onPressed: () {
Navigator.of(context).push<void>( Navigator.of(context).push<void>(
...@@ -1489,7 +1489,7 @@ void main() { ...@@ -1489,7 +1489,7 @@ void main() {
child: Builder( child: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return Center( return Center(
child: RaisedButton( child: ElevatedButton(
child: const Text('X'), child: const Text('X'),
onPressed: () { onPressed: () {
Navigator.of(context).push<void>( Navigator.of(context).push<void>(
...@@ -1554,7 +1554,7 @@ void main() { ...@@ -1554,7 +1554,7 @@ void main() {
child: Builder( child: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return Center( return Center(
child: RaisedButton( child: ElevatedButton(
child: const Text('X'), child: const Text('X'),
onPressed: () { onPressed: () {
Navigator.of(context).push<void>( Navigator.of(context).push<void>(
......
...@@ -13,7 +13,7 @@ void main() { ...@@ -13,7 +13,7 @@ void main() {
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material( child: Material(
child: RaisedButton( child: ElevatedButton(
onPressed: () { onPressed: () {
runApp(const Center(child: Text('Done', textDirection: TextDirection.ltr,))); runApp(const Center(child: Text('Done', textDirection: TextDirection.ltr,)));
}, },
......
...@@ -161,13 +161,13 @@ void main() { ...@@ -161,13 +161,13 @@ void main() {
child: Material( child: Material(
child: ListView( child: ListView(
children: <Widget>[ children: <Widget>[
RaisedButton( ElevatedButton(
onPressed: () { onPressed: () {
log.add('top'); log.add('top');
}, },
child: const Text('TOP'), child: const Text('TOP'),
), ),
RaisedButton( ElevatedButton(
onPressed: () { onPressed: () {
log.add('bottom'); log.add('bottom');
}, },
...@@ -199,14 +199,14 @@ void main() { ...@@ -199,14 +199,14 @@ void main() {
child: Material( child: Material(
child: ListView( child: ListView(
children: <Widget>[ children: <Widget>[
RaisedButton( ElevatedButton(
onPressed: () { onPressed: () {
log.add('top'); log.add('top');
}, },
child: const Text('TOP', textDirection: TextDirection.ltr), child: const Text('TOP', textDirection: TextDirection.ltr),
), ),
ExcludeSemantics( ExcludeSemantics(
child: RaisedButton( child: ElevatedButton(
onPressed: () { onPressed: () {
log.add('bottom'); log.add('bottom');
}, },
......
...@@ -188,7 +188,7 @@ void main() { ...@@ -188,7 +188,7 @@ void main() {
color: Colors.blue, color: Colors.blue,
child: Align( child: Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: RaisedButton( child: ElevatedButton(
child: const Text('bottomCenter button'), child: const Text('bottomCenter button'),
onPressed: () {}, onPressed: () {},
), ),
...@@ -203,7 +203,7 @@ void main() { ...@@ -203,7 +203,7 @@ void main() {
); );
// Also check that the button alignment is true to expectations // Also check that the button alignment is true to expectations
final Finder button = find.byType(RaisedButton); final Finder button = find.byType(ElevatedButton);
expect(tester.getBottomLeft(button).dy, equals(600.0)); expect(tester.getBottomLeft(button).dy, equals(600.0));
expect(tester.getCenter(button).dx, equals(400.0)); expect(tester.getCenter(button).dx, equals(400.0));
...@@ -261,7 +261,7 @@ void main() { ...@@ -261,7 +261,7 @@ void main() {
alignment: Alignment.center, alignment: Alignment.center,
child: Padding( child: Padding(
padding: const EdgeInsets.all(50.0), padding: const EdgeInsets.all(50.0),
child: RaisedButton( child: ElevatedButton(
child: const Text('center button'), child: const Text('center button'),
onPressed: () {}, onPressed: () {},
), ),
...@@ -279,7 +279,7 @@ void main() { ...@@ -279,7 +279,7 @@ void main() {
); );
// Also check that the button alignment is true to expectations // Also check that the button alignment is true to expectations
final Finder button = find.byType(RaisedButton); final Finder button = find.byType(ElevatedButton);
expect(tester.getBottomLeft(button).dy, equals(550.0)); expect(tester.getBottomLeft(button).dy, equals(550.0));
expect(tester.getCenter(button).dx, equals(400.0)); expect(tester.getCenter(button).dx, equals(400.0));
}); });
...@@ -298,7 +298,7 @@ void main() { ...@@ -298,7 +298,7 @@ void main() {
child: Center(child: FlutterLogo(size: 100)), child: Center(child: FlutterLogo(size: 100)),
fit: FlexFit.loose, fit: FlexFit.loose,
), ),
RaisedButton( ElevatedButton(
child: const Text('Bottom'), child: const Text('Bottom'),
onPressed: () {}, onPressed: () {},
), ),
...@@ -322,7 +322,7 @@ void main() { ...@@ -322,7 +322,7 @@ void main() {
expect(tester.getCenter(logo), const Offset(400.0, 351.0)); expect(tester.getCenter(logo), const Offset(400.0, 351.0));
// Also check that the button alignment is true to expectations // Also check that the button alignment is true to expectations
final Finder button = find.byType(RaisedButton); final Finder button = find.byType(ElevatedButton);
expect( expect(
tester.renderObject<RenderBox>(button).size, tester.renderObject<RenderBox>(button).size,
const Size(116.0, 48.0), const Size(116.0, 48.0),
...@@ -390,7 +390,7 @@ void main() { ...@@ -390,7 +390,7 @@ void main() {
color: Colors.blue, color: Colors.blue,
child: Align( child: Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: RaisedButton( child: ElevatedButton(
child: const Text('bottomCenter button'), child: const Text('bottomCenter button'),
onPressed: () {}, onPressed: () {},
), ),
...@@ -413,7 +413,7 @@ void main() { ...@@ -413,7 +413,7 @@ void main() {
// Also check that the button alignment is true to expectations, even with // Also check that the button alignment is true to expectations, even with
// child stretching to fill overscroll // child stretching to fill overscroll
final Finder button = find.byType(RaisedButton); final Finder button = find.byType(ElevatedButton);
expect(tester.getBottomLeft(button).dy, equals(600.0)); expect(tester.getBottomLeft(button).dy, equals(600.0));
expect(tester.getCenter(button).dx, equals(400.0)); expect(tester.getCenter(button).dx, equals(400.0));
...@@ -447,7 +447,7 @@ void main() { ...@@ -447,7 +447,7 @@ void main() {
alignment: Alignment.center, alignment: Alignment.center,
child: Padding( child: Padding(
padding: const EdgeInsets.all(50.0), padding: const EdgeInsets.all(50.0),
child: RaisedButton( child: ElevatedButton(
child: const Text('center button'), child: const Text('center button'),
onPressed: () {}, onPressed: () {},
), ),
...@@ -466,7 +466,7 @@ void main() { ...@@ -466,7 +466,7 @@ void main() {
equals(148.0), equals(148.0),
); );
// Check that the button alignment is true to expectations // Check that the button alignment is true to expectations
final Finder button = find.byType(RaisedButton); final Finder button = find.byType(ElevatedButton);
expect(tester.getBottomLeft(button).dy, equals(550.0)); expect(tester.getBottomLeft(button).dy, equals(550.0));
expect(tester.getCenter(button).dx, equals(400.0)); expect(tester.getCenter(button).dx, equals(400.0));
...@@ -567,7 +567,7 @@ void main() { ...@@ -567,7 +567,7 @@ void main() {
child: Center(child: FlutterLogo(size: 100)), child: Center(child: FlutterLogo(size: 100)),
fit: FlexFit.loose, fit: FlexFit.loose,
), ),
RaisedButton( ElevatedButton(
child: const Text('Bottom'), child: const Text('Bottom'),
onPressed: () {}, onPressed: () {},
), ),
...@@ -591,7 +591,7 @@ void main() { ...@@ -591,7 +591,7 @@ void main() {
expect(tester.getCenter(logo), const Offset(400.0, 351.0)); expect(tester.getCenter(logo), const Offset(400.0, 351.0));
// Also check that the button alignment is true to expectations. // Also check that the button alignment is true to expectations.
final Finder button = find.byType(RaisedButton); final Finder button = find.byType(ElevatedButton);
expect( expect(
tester.renderObject<RenderBox>(button).size, tester.renderObject<RenderBox>(button).size,
const Size(116.0, 48.0), const Size(116.0, 48.0),
...@@ -674,7 +674,7 @@ void main() { ...@@ -674,7 +674,7 @@ void main() {
color: Colors.blue, color: Colors.blue,
child: Align( child: Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: RaisedButton( child: ElevatedButton(
child: const Text('bottomCenter button'), child: const Text('bottomCenter button'),
onPressed: () {}, onPressed: () {},
), ),
...@@ -696,7 +696,7 @@ void main() { ...@@ -696,7 +696,7 @@ void main() {
); );
// Also check that the button alignment is true to expectations // Also check that the button alignment is true to expectations
final Finder button = find.byType(RaisedButton); final Finder button = find.byType(ElevatedButton);
expect(tester.getBottomLeft(button).dy, equals(600.0)); expect(tester.getBottomLeft(button).dy, equals(600.0));
expect(tester.getCenter(button).dx, equals(400.0)); expect(tester.getCenter(button).dx, equals(400.0));
}); });
...@@ -723,7 +723,7 @@ void main() { ...@@ -723,7 +723,7 @@ void main() {
alignment: Alignment.center, alignment: Alignment.center,
child: Padding( child: Padding(
padding: const EdgeInsets.all(50.0), padding: const EdgeInsets.all(50.0),
child: RaisedButton( child: ElevatedButton(
child: const Text('center button'), child: const Text('center button'),
onPressed: () {}, onPressed: () {},
), ),
...@@ -743,7 +743,7 @@ void main() { ...@@ -743,7 +743,7 @@ void main() {
); );
// Check that the button alignment is true to expectations // Check that the button alignment is true to expectations
final Finder button = find.byType(RaisedButton); final Finder button = find.byType(ElevatedButton);
expect(tester.getBottomLeft(button).dy, equals(550.0)); expect(tester.getBottomLeft(button).dy, equals(550.0));
expect(tester.getCenter(button).dx, equals(400.0)); expect(tester.getCenter(button).dx, equals(400.0));
......
...@@ -276,7 +276,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { ...@@ -276,7 +276,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: RaisedButton(onPressed: onPressed, key: selectButtonKey)); return Material(child: ElevatedButton(onPressed: onPressed, key: selectButtonKey, child: null));
} }
// State type is private, hence using dynamic. // State type is private, hence using dynamic.
dynamic getInspectorState() => inspectorKey.currentState; dynamic getInspectorState() => inspectorKey.currentState;
...@@ -294,14 +294,14 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { ...@@ -294,14 +294,14 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
child: Material( child: Material(
child: ListView( child: ListView(
children: <Widget>[ children: <Widget>[
RaisedButton( ElevatedButton(
key: topButtonKey, key: topButtonKey,
onPressed: () { onPressed: () {
log.add('top'); log.add('top');
}, },
child: const Text('TOP'), child: const Text('TOP'),
), ),
RaisedButton( ElevatedButton(
onPressed: () { onPressed: () {
log.add('bottom'); log.add('bottom');
}, },
...@@ -376,7 +376,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { ...@@ -376,7 +376,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: RaisedButton(onPressed: onPressed, key: selectButtonKey)); return Material(child: ElevatedButton(onPressed: onPressed, key: selectButtonKey, child: null));
} }
// State type is private, hence using dynamic. // State type is private, hence using dynamic.
dynamic getInspectorState() => inspectorKey.currentState; dynamic getInspectorState() => inspectorKey.currentState;
......
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