File tree Expand file tree Collapse file tree
lib/presentation/schedule_create/components
test/presentation/schedule_create/components Expand file tree Collapse file tree Original file line number Diff line number Diff 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,
Original file line number Diff line number Diff line change @@ -3,6 +3,28 @@ import 'package:flutter_test/flutter_test.dart';
33import 'package:on_time_front/presentation/schedule_create/components/keyboard_backed_bottom_sheet.dart' ;
44
55void 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 {
You can’t perform that action at this time.
0 commit comments