Skip to content

Commit 16b6991

Browse files
committed
fix: extend schedule sheet into bottom safe area
1 parent 57c3d71 commit 16b6991

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

lib/presentation/schedule_create/components/keyboard_backed_bottom_sheet.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class KeyboardBackedBottomSheet extends StatelessWidget {
1010
});
1111

1212
static const keyboardBackplateKey = Key('keyboard_backed_bottom_sheet_plate');
13+
static const sheetKey = Key('keyboard_backed_bottom_sheet');
1314

1415
final Widget child;
1516
final double heightFactor;
@@ -30,6 +31,7 @@ class KeyboardBackedBottomSheet extends StatelessWidget {
3031
return Material(
3132
color: Colors.transparent,
3233
child: SafeArea(
34+
bottom: false,
3335
child: Stack(
3436
alignment: Alignment.bottomCenter,
3537
children: [
@@ -51,6 +53,7 @@ class KeyboardBackedBottomSheet extends StatelessWidget {
5153
child: FractionallySizedBox(
5254
heightFactor: heightFactor,
5355
child: Container(
56+
key: sheetKey,
5457
decoration: BoxDecoration(
5558
color: backgroundColor,
5659
borderRadius: borderRadius,

test/presentation/schedule_create/components/keyboard_backed_bottom_sheet_test.dart

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,28 @@ import 'package:flutter_test/flutter_test.dart';
33
import 'package:on_time_front/presentation/schedule_create/components/keyboard_backed_bottom_sheet.dart';
44

55
void main() {
6+
testWidgets('fills the bottom safe area while keyboard is hidden', (
7+
tester,
8+
) async {
9+
tester.view.devicePixelRatio = 1;
10+
tester.view.physicalSize = const Size(390, 844);
11+
tester.view.padding = FakeViewPadding(bottom: 34);
12+
addTearDown(tester.view.resetDevicePixelRatio);
13+
addTearDown(tester.view.resetPhysicalSize);
14+
addTearDown(tester.view.resetPadding);
15+
16+
await tester.pumpWidget(
17+
const MaterialApp(
18+
home: KeyboardBackedBottomSheet(child: SizedBox.expand()),
19+
),
20+
);
21+
22+
expect(
23+
tester.getBottomLeft(find.byKey(KeyboardBackedBottomSheet.sheetKey)).dy,
24+
844,
25+
);
26+
});
27+
628
testWidgets('paints a white backplate behind the iOS keyboard inset', (
729
tester,
830
) async {

0 commit comments

Comments
 (0)