diff --git a/lib/features/consultant/become_consultant/presentation/pages/become_consultant_screen.dart b/lib/features/consultant/become_consultant/presentation/pages/become_consultant_screen.dart index 2955ee09..c147d12a 100644 --- a/lib/features/consultant/become_consultant/presentation/pages/become_consultant_screen.dart +++ b/lib/features/consultant/become_consultant/presentation/pages/become_consultant_screen.dart @@ -14,6 +14,8 @@ class BecomeConsultantScreen extends StatefulWidget { class _BecomeConsultantScreenState extends State { @override Widget build(BuildContext context) { + final bottomInset = MediaQuery.paddingOf(context).bottom; + return Scaffold( appBar: AppBar( title: const Text('Стать консультантом'), @@ -24,14 +26,18 @@ class _BecomeConsultantScreenState extends State { icon: const Icon(Icons.close), ), ), - body: const Padding( - padding: EdgeInsets.all(16), - child: Text( + body: SingleChildScrollView( + physics: const BouncingScrollPhysics(), + padding: EdgeInsets.fromLTRB(16, 16, 16, 16 + 52 + 8 + bottomInset), + child: const Text( 'Чтобы стать консультантом необходимо пройти короткую регистрацию. Подготовьте свои дипломы и/или сертификаты в формате jpg, они Вам пригодятся для проверки и подтверждения. Также необходимо будет указать ссылки на Ваши соц. сети и указать тип лица (физ. лицо или юр. лицо). На данный момент доступна регистрация в качестве физ. лица.\n\nВнутри Итвио разница между обычным пользователем и консультантом заключается в дополнительных возможностях последнего создавать публичные диеты, рецепты и планы питания; участвовать в ежемесячных рейтингах.', style: TextStyle(fontSize: 16), ), ), - bottomSheet: _startRegistrationButton(), + bottomSheet: Padding( + padding: EdgeInsets.fromLTRB(16, 0, 16, 8 + bottomInset), + child: _startRegistrationButton(), + ), ); } @@ -44,7 +50,7 @@ class _BecomeConsultantScreenState extends State { borderRadius: BorderRadius.circular(20), child: Ink( height: 52, - width: MediaQuery.of(context).size.width - 32, + width: double.infinity, decoration: BoxDecoration( borderRadius: BorderRadius.circular(20), color: appTheme.blueA400, diff --git a/test/features/consultant/become_consultant/presentation/pages/become_consultant_screen_test.dart b/test/features/consultant/become_consultant/presentation/pages/become_consultant_screen_test.dart index 128c3225..5175b19a 100644 --- a/test/features/consultant/become_consultant/presentation/pages/become_consultant_screen_test.dart +++ b/test/features/consultant/become_consultant/presentation/pages/become_consultant_screen_test.dart @@ -16,5 +16,29 @@ void main() { expect(find.byType(BecomeConsultantScreen), findsOneWidget); expect(find.text('Стать консультантом'), findsOneWidget); }); + + testWidgets('keeps the bottom action above the system navigation area', (tester) async { + const bottomInset = 34.0; + + await tester.pumpWidget( + MaterialApp( + theme: ThemeHelper().themeData(), + builder: (context, child) => MediaQuery( + data: MediaQuery.of(context).copyWith(padding: const EdgeInsets.only(bottom: bottomInset)), + child: child!, + ), + home: const BecomeConsultantScreen(), + ), + ); + await tester.pumpAndSettle(); + + final buttonRect = tester.getRect( + find.ancestor(of: find.text('Начать регистрацию'), matching: find.byType(Ink)).first, + ); + final viewHeight = tester.view.physicalSize.height / tester.view.devicePixelRatio; + + expect(buttonRect.bottom, lessThanOrEqualTo(viewHeight - bottomInset)); + expect(tester.takeException(), isNull); + }); }); }