Unverified Commit a5262560 authored by Tong Mu's avatar Tong Mu Committed by GitHub

Revert "[showModalBottomSheet] fix: showModalBottomSheet does not move along...

Revert "[showModalBottomSheet] fix: showModalBottomSheet does not move along keyboard (#71636)" (#77286)
parent 431f1143
...@@ -374,8 +374,6 @@ class _ModalBottomSheetState<T> extends State<_ModalBottomSheet<T>> { ...@@ -374,8 +374,6 @@ class _ModalBottomSheetState<T> extends State<_ModalBottomSheet<T>> {
return AnimatedBuilder( return AnimatedBuilder(
animation: widget.route!.animation!, animation: widget.route!.animation!,
child: Padding(
padding: MediaQuery.of(context).viewInsets,
child: BottomSheet( child: BottomSheet(
animationController: widget.route!._animationController, animationController: widget.route!._animationController,
onClosing: () { onClosing: () {
...@@ -392,7 +390,6 @@ class _ModalBottomSheetState<T> extends State<_ModalBottomSheet<T>> { ...@@ -392,7 +390,6 @@ class _ModalBottomSheetState<T> extends State<_ModalBottomSheet<T>> {
onDragStart: handleDragStart, onDragStart: handleDragStart,
onDragEnd: handleDragEnd, onDragEnd: handleDragEnd,
), ),
),
builder: (BuildContext context, Widget? child) { builder: (BuildContext context, Widget? child) {
// Disable the initial animation when accessible navigation is on so // Disable the initial animation when accessible navigation is on so
// that the semantics are added to the tree at the correct time. // that the semantics are added to the tree at the correct time.
......
...@@ -833,41 +833,6 @@ void main() { ...@@ -833,41 +833,6 @@ void main() {
// The bottom sheet should not be showing any longer. // The bottom sheet should not be showing any longer.
expect(find.text('BottomSheet'), findsNothing); expect(find.text('BottomSheet'), findsNothing);
}); });
testWidgets('showModalBottomSheet should move along on-screen keyboard',
(WidgetTester tester) async {
late BuildContext savedContext;
// Show a keyboard (simulate by space at the bottom of the screen).
await tester.pumpWidget(
MaterialApp(
home: MediaQuery(
data: const MediaQueryData(viewInsets: EdgeInsets.only(bottom: 200)),
child: Builder(
builder: (BuildContext context) {
savedContext = context;
return Container();
},
),
),
),
);
await tester.pump();
expect(find.text('BottomSheet'), findsNothing);
showModalBottomSheet<void>(
context: savedContext,
builder: (BuildContext context) {
return const Text('BottomSheet');
},
);
await tester.pumpAndSettle();
expect(find.text('BottomSheet'), findsOneWidget);
expect(tester.getBottomLeft(find.text('BottomSheet')).dy, 600);
});
} }
class _TestPage extends StatelessWidget { class _TestPage extends StatelessWidget {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment