Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Stop welcome screen overflowing #2595

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions mobile/lib/common/scrollable_safe_area.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ import 'package:flutter/cupertino.dart';
class ScrollableSafeArea extends StatelessWidget {
const ScrollableSafeArea({
required this.child,
this.bottom = true,
Key? key,
}) : super(key: key);

final bool bottom;
final Widget child;

@override
Widget build(BuildContext context) {
return SafeArea(
bottom: bottom,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ what is this doing?

Copy link
Contributor Author

@Restioson Restioson Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to pass it through from this.bottom. The reason I did bottom: bottom instead of bottom: this.bottom is because the IDE recommended that it was less redundant/better style. It's set in the welcome screen. If it's not needed there though it could be removed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to know what the bottom flag is telling the SafeArea widget, but I've looked it up now.

Whether to avoid system intrusions on the bottom side of the screen.

Do we need this if the area is anyways scrollable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this if the area is anyways scrollable?

I simply kept it as it was in the original and I was not sure what behaviour or display may change with removing it. I'm happy to remove it if you'd like.

FWIW the page did not fit on my phone as-is so it's probably good that it's scrollable now 😅

child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints viewportConstraints) =>
SingleChildScrollView(
Expand Down
3 changes: 2 additions & 1 deletion mobile/lib/features/welcome/welcome_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get_10101/common/application/switch.dart';
import 'package:get_10101/common/color.dart';
import 'package:get_10101/common/scrollable_safe_area.dart';
import 'package:get_10101/features/welcome/loading_screen.dart';
import 'package:get_10101/ffi.dart';
import 'package:get_10101/logger/logger.dart';
Expand Down Expand Up @@ -34,7 +35,7 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
value: SystemUiOverlayStyle.dark,
child: Scaffold(
backgroundColor: Colors.white,
body: SafeArea(
body: ScrollableSafeArea(
bottom: false,
child: Container(
color: Colors.white,
Expand Down
Loading