Revert "[showModalBottomSheet] fix: showModalBottomSheet does not move along keyboard (#71636)" (#77286)
This commit is contained in:
parent
431f1143ce
commit
a5262560d7
@ -374,24 +374,21 @@ class _ModalBottomSheetState<T> extends State<_ModalBottomSheet<T>> {
|
|||||||
|
|
||||||
return AnimatedBuilder(
|
return AnimatedBuilder(
|
||||||
animation: widget.route!.animation!,
|
animation: widget.route!.animation!,
|
||||||
child: Padding(
|
child: BottomSheet(
|
||||||
padding: MediaQuery.of(context).viewInsets,
|
animationController: widget.route!._animationController,
|
||||||
child: BottomSheet(
|
onClosing: () {
|
||||||
animationController: widget.route!._animationController,
|
if (widget.route!.isCurrent) {
|
||||||
onClosing: () {
|
Navigator.pop(context);
|
||||||
if (widget.route!.isCurrent) {
|
}
|
||||||
Navigator.pop(context);
|
},
|
||||||
}
|
builder: widget.route!.builder!,
|
||||||
},
|
backgroundColor: widget.backgroundColor,
|
||||||
builder: widget.route!.builder!,
|
elevation: widget.elevation,
|
||||||
backgroundColor: widget.backgroundColor,
|
shape: widget.shape,
|
||||||
elevation: widget.elevation,
|
clipBehavior: widget.clipBehavior,
|
||||||
shape: widget.shape,
|
enableDrag: widget.enableDrag,
|
||||||
clipBehavior: widget.clipBehavior,
|
onDragStart: handleDragStart,
|
||||||
enableDrag: widget.enableDrag,
|
onDragEnd: handleDragEnd,
|
||||||
onDragStart: handleDragStart,
|
|
||||||
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
|
||||||
|
@ -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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user