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