From 0aa5415d5e08a60822dde85c71855d5cc894adda Mon Sep 17 00:00:00 2001 From: Manaf Halimeh <43894077+Halimeh-manaf@users.noreply.github.com> Date: Fri, 8 Aug 2025 17:23:34 +0200 Subject: [PATCH] [compass_app] fixing pixel overflowed (#2669) *- use SingleChildScrollView in the auth screen to fix pixel overflowed.* ![after](https://github.com/user-attachments/assets/4e346892-0260-443f-aa34-4fa3e3a57a42) ![before](https://github.com/user-attachments/assets/27484520-9342-4084-a83c-8dec43f02434) *Fix for: https://github.com/flutter/samples/issues/2668.* ## Pre-launch Checklist - [x] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I read the [Contributors Guide]. - [x] I have added sample code updates to the [changelog]. - [x] I updated/added relevant documentation (doc comments with `///`). If you need help, consider asking for advice on the #hackers-devrel channel on [Discord]. [Flutter Style Guide]: https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md [Contributors Guide]: https://github.com/flutter/samples/blob/main/CONTRIBUTING.md [changelog]: ../CHANGELOG.md --- .../ui/auth/login/widgets/login_screen.dart | 64 ++++++++++--------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/compass_app/app/lib/ui/auth/login/widgets/login_screen.dart b/compass_app/app/lib/ui/auth/login/widgets/login_screen.dart index fb8ed14eb..fd62b591b 100644 --- a/compass_app/app/lib/ui/auth/login/widgets/login_screen.dart +++ b/compass_app/app/lib/ui/auth/login/widgets/login_screen.dart @@ -50,38 +50,40 @@ class _LoginScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( - body: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - const TiltedCards(), - Padding( - padding: Dimens.of(context).edgeInsetsScreenSymmetric, - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - TextField(controller: _email), - const SizedBox(height: Dimens.paddingVertical), - TextField(controller: _password, obscureText: true), - const SizedBox(height: Dimens.paddingVertical), - ListenableBuilder( - listenable: widget.viewModel.login, - builder: (context, _) { - return FilledButton( - onPressed: () { - widget.viewModel.login.execute(( - _email.value.text, - _password.value.text, - )); - }, - child: Text(AppLocalization.of(context).login), - ); - }, - ), - ], + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + const TiltedCards(), + Padding( + padding: Dimens.of(context).edgeInsetsScreenSymmetric, + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + TextField(controller: _email), + const SizedBox(height: Dimens.paddingVertical), + TextField(controller: _password, obscureText: true), + const SizedBox(height: Dimens.paddingVertical), + ListenableBuilder( + listenable: widget.viewModel.login, + builder: (context, _) { + return FilledButton( + onPressed: () { + widget.viewModel.login.execute(( + _email.value.text, + _password.value.text, + )); + }, + child: Text(AppLocalization.of(context).login), + ); + }, + ), + ], + ), ), - ), - ], + ], + ), ), ); }