forked from firka/flutter
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user