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

Feature/#336 base screen #351

Open
wants to merge 6 commits into
base: feature/#349-add-remote-config
Choose a base branch
from

Conversation

jorre127
Copy link
Contributor

fixes #336

@jorre127 jorre127 self-assigned this Oct 16, 2024
@@ -0,0 +1,153 @@
import 'package:flutter/foundation.dart';
Copy link
Collaborator

Choose a reason for hiding this comment

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

rename folder to base_screen instead of simple_screen


class BaseScreen extends StatelessWidget {
final bool isScrollable;
final bool useSlivers;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good idea to add more functionality, we can do even better imo
Add the ability to show an error by having a String and/or a onRetryPressed. But do make the visualisation a separate widget like you do with _content and _header


if (children.isNotEmpty) {
if (useSlivers) {
content = CustomScrollView(
Copy link
Collaborator

Choose a reason for hiding this comment

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

just return here

padding: padding,
children: children,
);
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

if you return, no need for the } else { here

actions: trailingItems,
child: titleWidget,
),
]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Cheeky , missing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants