// Copyright 2014 The Flutter Authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.import'package:flutter/material.dart';import'package:flutter_api_samples/material/dialog/alert_dialog.0.dart'asexample;import'package:flutter_test/flutter_test.dart';voidmain(){testWidgets('Show Alert dialog',(WidgetTestertester)async{constStringdialogTitle='AlertDialog Title';awaittester.pumpWidget(constMaterialApp(home:Scaffold(body:example.MyApp(),),),);expect(find.text(dialogTitle),findsNothing);awaittester.tap(find.widgetWithText(TextButton,'Show Dialog'));awaittester.pumpAndSettle();expect(find.text(dialogTitle),findsOneWidget);awaittester.tap(find.text('OK'));awaittester.pumpAndSettle();expect(find.text(dialogTitle),findsNothing);});}