[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].

<!-- Links -->
[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
pull/2721/head
Manaf Halimeh 4 weeks ago committed by GitHub
parent 2ea903a323
commit 0aa5415d5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -50,38 +50,40 @@ class _LoginScreenState extends State<LoginScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
body: Column( body: SingleChildScrollView(
crossAxisAlignment: CrossAxisAlignment.center, child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.center,
children: [ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
const TiltedCards(), children: [
Padding( const TiltedCards(),
padding: Dimens.of(context).edgeInsetsScreenSymmetric, Padding(
child: Column( padding: Dimens.of(context).edgeInsetsScreenSymmetric,
crossAxisAlignment: CrossAxisAlignment.stretch, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.stretch,
TextField(controller: _email), children: [
const SizedBox(height: Dimens.paddingVertical), TextField(controller: _email),
TextField(controller: _password, obscureText: true), const SizedBox(height: Dimens.paddingVertical),
const SizedBox(height: Dimens.paddingVertical), TextField(controller: _password, obscureText: true),
ListenableBuilder( const SizedBox(height: Dimens.paddingVertical),
listenable: widget.viewModel.login, ListenableBuilder(
builder: (context, _) { listenable: widget.viewModel.login,
return FilledButton( builder: (context, _) {
onPressed: () { return FilledButton(
widget.viewModel.login.execute(( onPressed: () {
_email.value.text, widget.viewModel.login.execute((
_password.value.text, _email.value.text,
)); _password.value.text,
}, ));
child: Text(AppLocalization.of(context).login), },
); child: Text(AppLocalization.of(context).login),
}, );
), },
], ),
],
),
), ),
), ],
], ),
), ),
); );
} }

Loading…
Cancel
Save