@@ -11,7 +11,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.MyApp(),
|
||||
body: example.ActionIconThemeExampleApp(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
testWidgets('BottomNavigationBar Updates Screen Content', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.BottomNavigationBarExampleApp(),
|
||||
);
|
||||
|
||||
expect(find.widgetWithText(AppBar, 'BottomNavigationBar Sample'), findsOneWidget);
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Card has clip applied', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(const example.MyApp());
|
||||
await tester.pumpWidget(const example.CardExampleApp());
|
||||
|
||||
final Card card = tester.firstWidget(find.byType(Card));
|
||||
expect(card.clipBehavior, Clip.hardEdge);
|
||||
|
||||
@@ -12,7 +12,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
testWidgets('showing and hiding the custom context menu in the whole app', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.ContextMenuControllerExampleApp(),
|
||||
);
|
||||
|
||||
expect(BrowserContextMenu.enabled, !kIsWeb);
|
||||
|
||||
@@ -12,7 +12,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
testWidgets('showing and hiding the context menu in TextField with custom buttons', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.EditableTextToolbarBuilderExampleApp(),
|
||||
);
|
||||
|
||||
expect(BrowserContextMenu.enabled, !kIsWeb);
|
||||
|
||||
@@ -12,7 +12,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
testWidgets('showing and hiding the custom context menu in TextField with a specific selection', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.EditableTextToolbarBuilderExampleApp(),
|
||||
);
|
||||
|
||||
expect(BrowserContextMenu.enabled, !kIsWeb);
|
||||
|
||||
@@ -12,7 +12,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
testWidgets('showing and hiding the context menu in TextField with a custom toolbar', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.EditableTextToolbarBuilderExampleApp(),
|
||||
);
|
||||
|
||||
expect(BrowserContextMenu.enabled, !kIsWeb);
|
||||
|
||||
@@ -12,7 +12,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
testWidgets('showing and hiding the custom context menu on SelectionArea', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.SelectableRegionToolbarBuilderExampleApp(),
|
||||
);
|
||||
|
||||
expect(BrowserContextMenu.enabled, !kIsWeb);
|
||||
|
||||
@@ -12,7 +12,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.MyApp(),
|
||||
body: example.AlertDialogExampleApp(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -12,7 +12,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.MyApp(),
|
||||
body: example.AlertDialogExampleApp(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.MyApp(),
|
||||
body: example.DialogExampleApp(),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -35,7 +35,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.MyApp(),
|
||||
body: example.DialogExampleApp(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -12,7 +12,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.MyApp(),
|
||||
body: example.ShowDialogExampleApp(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -12,7 +12,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.MyApp(),
|
||||
body: example.ShowDialogExampleApp(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -12,7 +12,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.MyApp(),
|
||||
body: example.ShowDialogExampleApp(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -11,7 +11,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.MyApp(),
|
||||
body: example.DividerExampleApp(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -11,7 +11,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.MyApp(),
|
||||
body: example.DividerExampleApp(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -11,7 +11,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.MyApp(),
|
||||
body: example.VerticalDividerExampleApp(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -11,7 +11,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.MyApp(),
|
||||
body: example.VerticalDividerExampleApp(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
testWidgets('FloatingActionButton', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.FloatingActionButtonExampleApp(),
|
||||
);
|
||||
|
||||
expect(find.byType(FloatingActionButton), findsOneWidget);
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
testWidgets('FloatingActionButton.extended', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.FloatingActionButtonExampleApp(),
|
||||
);
|
||||
|
||||
expect(find.byType(FloatingActionButton), findsOneWidget);
|
||||
|
||||
@@ -13,7 +13,7 @@ void main() {
|
||||
return tester.widget<RawMaterialButton>(finder);
|
||||
}
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.FloatingActionButtonExampleApp(),
|
||||
);
|
||||
|
||||
expect(find.byType(FloatingActionButton), findsOneWidget);
|
||||
|
||||
@@ -14,7 +14,7 @@ void main() {
|
||||
}
|
||||
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.FloatingActionButtonExampleApp(),
|
||||
);
|
||||
|
||||
final ThemeData theme = ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true);
|
||||
|
||||
@@ -21,7 +21,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.MyStatelessWidget(
|
||||
body: example.ImageClipExample(
|
||||
image: MemoryImage(Uint8List.fromList(kTransparentImage)),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -21,7 +21,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.MyStatelessWidget(
|
||||
body: example.ImageClipExample(
|
||||
image: MemoryImage(Uint8List.fromList(kTransparentImage)),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
testWidgets('InputDecorator label uses error color', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.FloatingLabelStyleErrorExampleApp(),
|
||||
);
|
||||
final Theme theme = tester.firstWidget(find.byType(Theme));
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
testWidgets('InputDecorator label uses error color', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.LabelStyleErrorExampleApp(),
|
||||
);
|
||||
final Theme theme = tester.firstWidget(find.byType(Theme));
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
testWidgets('InputDecorator prefixIcon alignment', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.PrefixIconExampleApp(),
|
||||
);
|
||||
expect(tester.getCenter(find.byIcon(Icons.person)).dy, 28.0);
|
||||
});
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
testWidgets('InputDecorator suffixIcon alignment', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.SuffixIconExampleApp(),
|
||||
);
|
||||
expect(tester.getCenter(find.byIcon(Icons.remove_red_eye)).dy, 28.0);
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@ void main() {
|
||||
testWidgets('Navigation rail updates destination on tap',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.NavigationRailExampleApp(),
|
||||
);
|
||||
final NavigationRail navigationRailWidget =
|
||||
tester.firstWidget(find.byType(NavigationRail));
|
||||
@@ -37,7 +37,7 @@ void main() {
|
||||
|
||||
testWidgets('Navigation rail updates label type', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.NavigationRailExampleApp(),
|
||||
);
|
||||
|
||||
// initial label type set to all.
|
||||
@@ -56,7 +56,7 @@ void main() {
|
||||
|
||||
testWidgets('Navigation rail updates group alignment', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.NavigationRailExampleApp(),
|
||||
);
|
||||
|
||||
// initial group alignment set top top.
|
||||
@@ -75,7 +75,7 @@ void main() {
|
||||
|
||||
testWidgets('Navigation rail shows leading/trailing widgets', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.NavigationRailExampleApp(),
|
||||
);
|
||||
|
||||
// Initially leading/trailing widgets are hidden.
|
||||
|
||||
@@ -11,7 +11,7 @@ void main() {
|
||||
testWidgets('Navigation rail updates destination on tap',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.NavigationRailExampleApp(),
|
||||
);
|
||||
final NavigationRail navigationRailWidget =
|
||||
tester.firstWidget(find.byType(NavigationRail));
|
||||
@@ -37,7 +37,7 @@ void main() {
|
||||
|
||||
testWidgets('Navigation rail updates label type', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.NavigationRailExampleApp(),
|
||||
);
|
||||
|
||||
// initial label type set to all.
|
||||
@@ -56,7 +56,7 @@ void main() {
|
||||
|
||||
testWidgets('Navigation rail updates group alignment', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.NavigationRailExampleApp(),
|
||||
);
|
||||
|
||||
// initial group alignment set top top.
|
||||
@@ -75,7 +75,7 @@ void main() {
|
||||
|
||||
testWidgets('Navigation rail shows leading/trailing widgets', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.NavigationRailExampleApp(),
|
||||
);
|
||||
|
||||
// Initially leading/trailing widgets are hidden.
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
testWidgets('Trigger RefreshIndicator - Pull from top', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.RefreshIndicatorExampleApp(),
|
||||
);
|
||||
|
||||
await tester.fling(find.text('Item 1'), const Offset(0.0, 300.0), 1000.0);
|
||||
@@ -22,7 +22,7 @@ void main() {
|
||||
|
||||
testWidgets('Trigger RefreshIndicator - Button', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.RefreshIndicatorExampleApp(),
|
||||
);
|
||||
|
||||
await tester.tap(find.byType(FloatingActionButton));
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
testWidgets('Pulling from nested scroll view triggers refresh indicator', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.RefreshIndicatorExampleApp(),
|
||||
);
|
||||
|
||||
// Pull from the upper scroll view.
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('TextField is obscured and has "Password" as labelText', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(const example.MyApp());
|
||||
await tester.pumpWidget(const example.TextFieldExampleApp());
|
||||
|
||||
expect(find.byType(TextField), findsOneWidget);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.MyApp(),
|
||||
body: example.ToggleButtonsExampleApp(),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -50,7 +50,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.MyApp(),
|
||||
body: example.ToggleButtonsExampleApp(),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -86,7 +86,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.MyApp(),
|
||||
body: example.ToggleButtonsExampleApp(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -12,7 +12,7 @@ void main() {
|
||||
const String tooltipText = 'I am a Tooltip';
|
||||
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.TooltipExampleApp(),
|
||||
);
|
||||
|
||||
TestGesture? gesture = await tester.createGesture(kind: PointerDeviceKind.mouse);
|
||||
|
||||
@@ -12,7 +12,7 @@ void main() {
|
||||
const String tooltipText = 'I am a Tooltip';
|
||||
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.TooltipExampleApp(),
|
||||
);
|
||||
|
||||
TestGesture? gesture = await tester.createGesture(kind: PointerDeviceKind.mouse);
|
||||
|
||||
@@ -12,7 +12,7 @@ void main() {
|
||||
const String tooltipText = 'I am a rich tooltip. I am another span of this rich tooltip';
|
||||
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.TooltipExampleApp(),
|
||||
);
|
||||
|
||||
TestGesture? gesture = await tester.createGesture(kind: PointerDeviceKind.mouse);
|
||||
|
||||
@@ -11,7 +11,7 @@ void main() {
|
||||
const String tooltipText = 'I am a Tooltip';
|
||||
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.TooltipExampleApp(),
|
||||
);
|
||||
|
||||
// Tooltip is not visible before tapping the button.
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
testWidgets('Uses Text Cursor', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.MouseCursorExampleApp(),
|
||||
);
|
||||
|
||||
expect(find.byType(MouseRegion), findsNWidgets(2)); // There's one in the MaterialApp
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Enter text using the VKB', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(const example.MyApp());
|
||||
await tester.pumpWidget(const example.TextInputControlExampleApp());
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
await tester.tap(find.descendant(
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
testWidgets('WidgetsApp test', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.WidgetsAppExampleApp(),
|
||||
);
|
||||
|
||||
expect(find.text('Hello World'), findsOneWidget);
|
||||
|
||||
@@ -18,7 +18,7 @@ void main() {
|
||||
}
|
||||
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.WidgetBindingObserverExampleApp(),
|
||||
);
|
||||
|
||||
expect(find.text('There are no AppLifecycleStates to show.'), findsOneWidget);
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
testWidgets('has two containers when wide', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.LayoutBuilderExampleApp(),
|
||||
);
|
||||
|
||||
final Finder containerFinder = find.byType(Container);
|
||||
@@ -19,7 +19,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 400),
|
||||
child: const example.MyApp(),
|
||||
child: const example.LayoutBuilderExampleApp(),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('should update magnifier position on drag', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(const example.MyApp());
|
||||
await tester.pumpWidget(const example.MagnifierExampleApp());
|
||||
|
||||
Matcher isPositionedAt(Offset at) {
|
||||
return isA<Positioned>().having(
|
||||
@@ -40,7 +40,7 @@ void main() {
|
||||
});
|
||||
|
||||
testWidgets('should match golden', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(const example.MyApp());
|
||||
await tester.pumpWidget(const example.MagnifierExampleApp());
|
||||
|
||||
final Offset centerOfFlutterLogo = tester.getCenter(find.byType(Positioned));
|
||||
const Offset dragDistance = Offset(10, 10);
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
const String tooltipText = 'tooltip';
|
||||
testWidgets('Tooltip is shown on press', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(const example.MyApp());
|
||||
await tester.pumpWidget(const example.OverlayPortalExampleApp());
|
||||
expect(find.text(tooltipText), findsNothing);
|
||||
|
||||
await tester.tap(find.byType(example.ClickableTooltipWidget));
|
||||
@@ -22,11 +22,11 @@ void main() {
|
||||
});
|
||||
|
||||
testWidgets('Tooltip is shown at the right location', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(const example.MyApp());
|
||||
await tester.pumpWidget(const example.OverlayPortalExampleApp());
|
||||
await tester.tap(find.byType(example.ClickableTooltipWidget));
|
||||
await tester.pump();
|
||||
|
||||
final Size canvasSize = tester.getSize(find.byType(example.MyApp));
|
||||
final Size canvasSize = tester.getSize(find.byType(example.OverlayPortalExampleApp));
|
||||
expect(
|
||||
tester.getBottomRight(find.text(tooltipText)),
|
||||
canvasSize - const Size(50, 50),
|
||||
@@ -34,7 +34,7 @@ void main() {
|
||||
});
|
||||
|
||||
testWidgets('Tooltip is shown with the right font size', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(const example.MyApp());
|
||||
await tester.pumpWidget(const example.OverlayPortalExampleApp());
|
||||
await tester.tap(find.byType(example.ClickableTooltipWidget));
|
||||
await tester.pump();
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_api_samples/widgets/scroll_view/listview_select.1.dart'
|
||||
import 'package:flutter_api_samples/widgets/scroll_view/list_view.0.dart'
|
||||
as example;
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
@@ -11,7 +11,7 @@ void main() {
|
||||
testWidgets('long press ListTile should enable edit mode',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.ListViewExampleApp(),
|
||||
);
|
||||
|
||||
final Finder listView = find.byType(ListView);
|
||||
@@ -29,7 +29,7 @@ void main() {
|
||||
testWidgets('Pressing cross button should disable edit mode',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.ListViewExampleApp(),
|
||||
);
|
||||
|
||||
final Finder listView = find.byType(ListView);
|
||||
@@ -52,7 +52,7 @@ void main() {
|
||||
testWidgets('tapping ListTile or checkBox should toggle ListTile state',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.ListViewExampleApp(),
|
||||
);
|
||||
|
||||
final Finder listView = find.byType(ListView);
|
||||
@@ -10,7 +10,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
testWidgets('SliverOpacity example', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.SliverOpacityExampleApp(),
|
||||
);
|
||||
|
||||
final Finder button = find.byType(FloatingActionButton);
|
||||
|
||||
@@ -84,13 +84,13 @@ void main() {
|
||||
}
|
||||
|
||||
testWidgets('should show custom magnifier on drag', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(const example.MyApp(text: defaultText));
|
||||
await tester.pumpWidget(const example.TextMagnifierExampleApp(text: defaultText));
|
||||
|
||||
await showMagnifier(tester, 'e');
|
||||
expect(find.byType(example.CustomMagnifier), findsOneWidget);
|
||||
|
||||
await expectLater(
|
||||
find.byType(example.MyApp),
|
||||
find.byType(example.TextMagnifierExampleApp),
|
||||
matchesGoldenFile('text_magnifier.0_test.png'),
|
||||
);
|
||||
}, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.android }));
|
||||
@@ -101,7 +101,7 @@ void main() {
|
||||
final String text = textDirection == TextDirection.rtl ? 'أثارت زر' : defaultText;
|
||||
final String textToTapOn = textDirection == TextDirection.rtl ? 'ت' : 'e';
|
||||
|
||||
await tester.pumpWidget(example.MyApp(textDirection: textDirection, text: text));
|
||||
await tester.pumpWidget(example.TextMagnifierExampleApp(textDirection: textDirection, text: text));
|
||||
|
||||
await showMagnifier(tester, textToTapOn);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
testWidgets('pressing shouldPop button changes shouldPop', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.WillPopScopeExampleApp(),
|
||||
);
|
||||
|
||||
final Finder buttonFinder = find.text('shouldPop: true');
|
||||
@@ -19,14 +19,14 @@ void main() {
|
||||
});
|
||||
testWidgets('pressing Push button pushes route', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.MyApp(),
|
||||
const example.WillPopScopeExampleApp(),
|
||||
);
|
||||
|
||||
final Finder buttonFinder = find.text('Push');
|
||||
expect(buttonFinder, findsOneWidget);
|
||||
expect(find.byType(example.MyStatefulWidget), findsOneWidget);
|
||||
expect(find.byType(example.WillPopScopeExample), findsOneWidget);
|
||||
await tester.tap(buttonFinder);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(example.MyStatefulWidget, skipOffstage: false), findsNWidgets(2));
|
||||
expect(find.byType(example.WillPopScopeExample, skipOffstage: false), findsNWidgets(2));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user