forked from flutter/plugins
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Material 3
BottomSheet
example (#116112)
fix title
- Loading branch information
1 parent
322dd06
commit 333397a
Showing
5 changed files
with
82 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
examples/api/test/material/bottom_sheet/show_modal_bottom_sheet.0_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// 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/bottom_sheet/show_modal_bottom_sheet.0.dart' as example; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
void main() { | ||
testWidgets('BottomSheet can be opened and closed', (WidgetTester tester) async { | ||
const String titleText = 'Modal BottomSheet'; | ||
const String closeText = 'Close BottomSheet'; | ||
|
||
await tester.pumpWidget( | ||
const example.BottomSheetApp(), | ||
); | ||
|
||
expect(find.text(titleText), findsNothing); | ||
expect(find.text(closeText), findsNothing); | ||
|
||
// Open the bottom sheet. | ||
await tester.tap(find.widgetWithText(ElevatedButton, 'showModalBottomSheet')); | ||
await tester.pumpAndSettle(); | ||
|
||
// Verify that the bottom sheet is open. | ||
expect(find.text(titleText), findsOneWidget); | ||
expect(find.text(closeText), findsOneWidget); | ||
}); | ||
} |
29 changes: 29 additions & 0 deletions
29
examples/api/test/material/bottom_sheet/show_modal_bottom_sheet.1_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// 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/bottom_sheet/show_modal_bottom_sheet.1.dart' as example; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
void main() { | ||
testWidgets('BottomSheet can be opened and closed', (WidgetTester tester) async { | ||
const String titleText = 'Modal BottomSheet'; | ||
const String closeText = 'Close BottomSheet'; | ||
|
||
await tester.pumpWidget( | ||
const example.BottomSheetApp(), | ||
); | ||
|
||
expect(find.text(titleText), findsNothing); | ||
expect(find.text(closeText), findsNothing); | ||
|
||
// Open the bottom sheet. | ||
await tester.tap(find.widgetWithText(ElevatedButton, 'showModalBottomSheet')); | ||
await tester.pumpAndSettle(); | ||
|
||
// Verify that the bottom sheet is open. | ||
expect(find.text(titleText), findsOneWidget); | ||
expect(find.text(closeText), findsOneWidget); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters