Rename Sample classes (#124080)

Rename Sample classes
This commit is contained in:
Greg Spencer
2023-04-04 13:34:29 -07:00
committed by GitHub
parent c8a3dbaf06
commit e3bc8efd39
480 changed files with 3125 additions and 3816 deletions

View File

@@ -11,7 +11,7 @@ void main() {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: example.MyApp(),
body: example.ActionIconThemeExampleApp(),
),
),
);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -12,7 +12,7 @@ void main() {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: example.MyApp(),
body: example.AlertDialogExampleApp(),
),
),
);

View File

@@ -12,7 +12,7 @@ void main() {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: example.MyApp(),
body: example.AlertDialogExampleApp(),
),
),
);

View File

@@ -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(),
),
),
);

View File

@@ -12,7 +12,7 @@ void main() {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: example.MyApp(),
body: example.ShowDialogExampleApp(),
),
),
);

View File

@@ -12,7 +12,7 @@ void main() {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: example.MyApp(),
body: example.ShowDialogExampleApp(),
),
),
);

View File

@@ -12,7 +12,7 @@ void main() {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: example.MyApp(),
body: example.ShowDialogExampleApp(),
),
),
);

View File

@@ -11,7 +11,7 @@ void main() {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: example.MyApp(),
body: example.DividerExampleApp(),
),
),
);

View File

@@ -11,7 +11,7 @@ void main() {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: example.MyApp(),
body: example.DividerExampleApp(),
),
),
);

View File

@@ -11,7 +11,7 @@ void main() {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: example.MyApp(),
body: example.VerticalDividerExampleApp(),
),
),
);

View File

@@ -11,7 +11,7 @@ void main() {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: example.MyApp(),
body: example.VerticalDividerExampleApp(),
),
),
);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -21,7 +21,7 @@ void main() {
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
body: example.MyStatelessWidget(
body: example.ImageClipExample(
image: MemoryImage(Uint8List.fromList(kTransparentImage)),
),
),

View File

@@ -21,7 +21,7 @@ void main() {
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
body: example.MyStatelessWidget(
body: example.ImageClipExample(
image: MemoryImage(Uint8List.fromList(kTransparentImage)),
),
),

View File

@@ -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));

View File

@@ -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));

View File

@@ -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);
});

View File

@@ -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);
});

View File

@@ -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.

View File

@@ -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.

View File

@@ -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));

View File

@@ -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.

View File

@@ -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);

View File

@@ -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(),
),
),
);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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.