Updated the About dialog to use the new button API. (#62075)
This commit is contained in:
parent
9bf1793a10
commit
76c7ca5433
@ -19,7 +19,6 @@ import 'card.dart';
|
|||||||
import 'constants.dart';
|
import 'constants.dart';
|
||||||
import 'debug.dart';
|
import 'debug.dart';
|
||||||
import 'dialog.dart';
|
import 'dialog.dart';
|
||||||
import 'flat_button.dart';
|
|
||||||
import 'floating_action_button.dart';
|
import 'floating_action_button.dart';
|
||||||
import 'floating_action_button_location.dart';
|
import 'floating_action_button_location.dart';
|
||||||
import 'ink_decoration.dart';
|
import 'ink_decoration.dart';
|
||||||
@ -31,6 +30,7 @@ import 'page_transitions_theme.dart';
|
|||||||
import 'progress_indicator.dart';
|
import 'progress_indicator.dart';
|
||||||
import 'scaffold.dart';
|
import 'scaffold.dart';
|
||||||
import 'scrollbar.dart';
|
import 'scrollbar.dart';
|
||||||
|
import 'text_button.dart';
|
||||||
import 'text_theme.dart';
|
import 'text_theme.dart';
|
||||||
import 'theme.dart';
|
import 'theme.dart';
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ import 'theme.dart';
|
|||||||
/// ),
|
/// ),
|
||||||
/// ),
|
/// ),
|
||||||
/// body: Center(
|
/// body: Center(
|
||||||
/// child: RaisedButton(
|
/// child: ElevatedButton(
|
||||||
/// child: Text('Show About Example'),
|
/// child: Text('Show About Example'),
|
||||||
/// onPressed: () {
|
/// onPressed: () {
|
||||||
/// showAboutDialog(
|
/// showAboutDialog(
|
||||||
@ -406,7 +406,7 @@ class AboutDialog extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text(MaterialLocalizations.of(context).viewLicensesButtonLabel),
|
child: Text(MaterialLocalizations.of(context).viewLicensesButtonLabel),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
showLicensePage(
|
showLicensePage(
|
||||||
@ -418,7 +418,7 @@ class AboutDialog extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text(MaterialLocalizations.of(context).closeButtonLabel),
|
child: Text(MaterialLocalizations.of(context).closeButtonLabel),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
|
@ -358,7 +358,7 @@ void main() {
|
|||||||
onGenerateRoute: (RouteSettings settings) {
|
onGenerateRoute: (RouteSettings settings) {
|
||||||
return PageRouteBuilder<dynamic>(
|
return PageRouteBuilder<dynamic>(
|
||||||
pageBuilder: (BuildContext context, _, __) {
|
pageBuilder: (BuildContext context, _, __) {
|
||||||
return RaisedButton(
|
return ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
showLicensePage(
|
showLicensePage(
|
||||||
context: context,
|
context: context,
|
||||||
@ -376,7 +376,7 @@ void main() {
|
|||||||
));
|
));
|
||||||
|
|
||||||
// Open the dialog.
|
// Open the dialog.
|
||||||
await tester.tap(find.byType(RaisedButton));
|
await tester.tap(find.byType(ElevatedButton));
|
||||||
|
|
||||||
expect(rootObserver.licensePageCount, 0);
|
expect(rootObserver.licensePageCount, 0);
|
||||||
expect(nestedObserver.licensePageCount, 1);
|
expect(nestedObserver.licensePageCount, 1);
|
||||||
@ -396,7 +396,7 @@ void main() {
|
|||||||
onGenerateRoute: (RouteSettings settings) {
|
onGenerateRoute: (RouteSettings settings) {
|
||||||
return PageRouteBuilder<dynamic>(
|
return PageRouteBuilder<dynamic>(
|
||||||
pageBuilder: (BuildContext context, _, __) {
|
pageBuilder: (BuildContext context, _, __) {
|
||||||
return RaisedButton(
|
return ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
showLicensePage(
|
showLicensePage(
|
||||||
context: context,
|
context: context,
|
||||||
@ -415,7 +415,7 @@ void main() {
|
|||||||
));
|
));
|
||||||
|
|
||||||
// Open the dialog.
|
// Open the dialog.
|
||||||
await tester.tap(find.byType(RaisedButton));
|
await tester.tap(find.byType(ElevatedButton));
|
||||||
|
|
||||||
expect(rootObserver.licensePageCount, 1);
|
expect(rootObserver.licensePageCount, 1);
|
||||||
expect(nestedObserver.licensePageCount, 0);
|
expect(nestedObserver.licensePageCount, 0);
|
||||||
@ -432,7 +432,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: () {
|
||||||
showAboutDialog(
|
showAboutDialog(
|
||||||
context: context,
|
context: context,
|
||||||
@ -448,7 +448,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);
|
||||||
@ -465,7 +465,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: () {
|
||||||
showAboutDialog(
|
showAboutDialog(
|
||||||
context: context,
|
context: context,
|
||||||
@ -482,7 +482,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);
|
||||||
@ -515,7 +515,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: () {
|
||||||
showAboutDialog(
|
showAboutDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user