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

Responsive Builder #19

Merged
merged 4 commits into from
Feb 6, 2021
Merged

Conversation

bgoktugozdemir
Copy link
Member

Fixes #18

import 'package:flutter/material.dart';

class ResponsiveHelper {
static const double tabletMinWidth = 800;
Copy link
Contributor

Choose a reason for hiding this comment

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

Where did you get this code? From Android, I remember this value was 720.

Copy link
Member Author

Choose a reason for hiding this comment

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

It can change.

MediaQuery.of(context).size.width < desktopMinWidth;

static bool isDesktop(BuildContext context) =>
MediaQuery.of(context).size.width >= desktopMinWidth;
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure what this does. How can a width be related to desktop?

Copy link
Member Author

Choose a reason for hiding this comment

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

It checks the screen width of the device. If the width is good for our desktop width, it returns true.

@required this.mobile,
this.tablet,
@required this.desktop,
}) : assert(mobile != null, "Mobile cannot be empty."),
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use single quotes for texts.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure.

final Widget tablet;

/// 1200px
final Widget desktop;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why we have a difference between desktop and tablets. An ipad can be as big as a laptop for example.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried to use the standards like Bootstrap, Microsoft. Generally, sources use three different devices. Example

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes but that is not what we do with Flutter. We care about only the size. So let's try to keep it as small medium large etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

What is your suggestion? Should we remove the helper?

Copy link
Contributor

Choose a reason for hiding this comment

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

We should rename them to something more generic. Because a desktop can be as small as a tablet and a tablet can be as big as a Desktop

Copy link
Member Author

Choose a reason for hiding this comment

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

We can change the names to Small, Medium, Large.

@salihgueler salihgueler added this to Done in Initial Release Feb 6, 2021
@salihgueler salihgueler moved this from Done to To do in Initial Release Feb 6, 2021
@salihgueler salihgueler moved this from To do to Review in progress in Initial Release Feb 6, 2021
The descriptions of sizes updated.
Screen Names were updated.
Initial Release automation moved this from Review in progress to Reviewer approved Feb 6, 2021
@bgoktugozdemir bgoktugozdemir removed the request for review from Adem68 February 6, 2021 13:19
@bgoktugozdemir bgoktugozdemir merged commit fde8844 into main Feb 6, 2021
Initial Release automation moved this from Reviewer approved to Done Feb 6, 2021
@bgoktugozdemir bgoktugozdemir deleted the feature/FTW-18-responsivebuilder branch February 6, 2021 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Create Responsive Builder
3 participants