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

feat: mobile support #227

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

DenserMeerkat
Copy link
Contributor

@DenserMeerkat DenserMeerkat commented Feb 28, 2024

PR Description

Implementing the Figma Link design with maximum (almost all) available components, to discuss the design decisions.

demo.mp4

Related Issues

Checklist

  • I have gone through the contributing guide
  • I have run the tests (flutter test) and all tests are passing

Added/updated tests?

  • Yes
  • No, and this is why: the features are still in implementation phase.
  • I need help with writing tests

@DenserMeerkat
Copy link
Contributor Author

DenserMeerkat commented Feb 28, 2024

Currently, I have tried to make the most of existing widgets by adding kIsMobile conditions. Are we supposed to go full on this much or can we create some second level layout widgets(widgets that composite low level widgets) specific to mobile?
Expample: RequestEditor()

@animator
Copy link
Member

@DenserMeerkat Thanks for the PR. We will review it and get back.

@animator
Copy link
Member

animator commented Mar 13, 2024

@DenserMeerkat You are going in the right direction. I recommend you to continue thinking about the end user and improve the UI/UX to make his life easier and the app more intuitive to use.

Some feedback points:

  • Click on rename button. Enter nothing and press OK. You get an error screen.
    227 rename
    227 error

  • Type something in the body text field. click outside the textfield. You will not be able to unfocus and hide the keyboard to access the send button.

227 textbox

  • Add a lot of header rows now scroll. A strange error happens. Investigate.
227.header.rangeerror.mov
  • Click on URL field. Click outside. keyboard still visible (unable to unfocus)
  • Appbar: Chat symbol for response is not intuitive. Appbar title should be the name of the request (with edit/delete options) rather than just a generic name Requests.
  • Rethink the buttons at the bottom of the request page from UX perspective. The send button is smaller than View Code button

227 appbar

  • In the collection pane (drawer) clicking on a request does not transition to the request page until the user explicitly swipes left.

227 collection pane

@DenserMeerkat
Copy link
Contributor Author

DenserMeerkat commented Mar 14, 2024

@animator Thanks for taking the time to review my implementation! I appreciate you pointing out the scrolling and focus problems in the widgets. I too noticed these and I'm already working on solutions to ensure these widgets work flawlessly with touch interactions and deliver the intended functionality.


Response Icon

I spent some time trying to find an icon which represents API Response but couldn't find a particular one so settled with the Comment icon. Will try finding alternatives.

View Code button

Initially just had the "< >" icon in button for a clean layout and clear button hierarchy, but added "View Code" label for user's clarity of the button's function. Happy to revert based on your feedback.


Will get back to you if I have any updates/doubts on fixes.

@DenserMeerkat
Copy link
Contributor Author

(with edit/delete options)

@animator
If I understood it right, users should be able to perform all below actions from Appbar?
more_options

@ashitaprasad
Copy link
Member

Yes, all three should be there.

@DenserMeerkat DenserMeerkat marked this pull request as draft March 29, 2024 21:19
@DenserMeerkat DenserMeerkat marked this pull request as ready for review June 1, 2024 14:28
@DenserMeerkat DenserMeerkat changed the title feat: mobile support (WIP) feat: mobile support Jun 2, 2024

final mobileDrawerKeyProvider = Provider<GlobalKey<InnerDrawerState>>(
Copy link
Member

Choose a reason for hiding this comment

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

Use StateProvider

@@ -72,7 +72,6 @@ class CollectionPane extends ConsumerWidget {
),
kVSpacer10,
Container(
height: 30,
margin: const EdgeInsets.only(right: 8),
Copy link
Member

Choose a reason for hiding this comment

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

Why this height was removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

  • Having a fixed height caused this offset due to TextField's internal contentPadding in the mobile device I tested.
  • The height of the field was very narrow and difficult to focus on tap.
    Hence for a fair tap target size I removed the height.
    ( Also I couldn't find any difference on removing the height in desktop devices too, so felt it was redundant and let the textfield itself take suitable height )

@@ -143,14 +142,21 @@ class _RequestListState extends ConsumerState<RequestList> {
final alwaysShowCollectionPaneScrollbar = ref.watch(settingsProvider
.select((value) => value.alwaysShowCollectionPaneScrollbar));
final filterQuery = ref.watch(searchQueryProvider).trim();
final isMobile =
kIsMobile && MediaQuery.sizeOf(context).width < kMinWindowSize.width;
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to create an extension over context like context.isMobile

context.isMobile = kIsMobile && MediaQuery.sizeOf(context).width < kMinWindowSize.width

as this code will be used in a lot of places

@@ -166,6 +172,19 @@ class _RequestListState extends ConsumerState<RequestList> {
},
itemBuilder: (context, index) {
var id = requestSequence[index];
if (kIsMobile) {
return ReorderableDelayedDragStartListener(
Copy link
Member

Choose a reason for hiding this comment

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

Why used ReorderableDelayedDragStartListener

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Having ReorderableDragStartListener in touch devices causes drag event to reorder request which collides with the scroll functionality required if there are a large number of requests in the request list. Hence used the ReorderableDelayedDragStartListener to avoid this collision of gestures.

Copy link
Member

Choose a reason for hiding this comment

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

Create a widgets folder inside mobile for mobile related widgets. All Stateful & Stateless widgets will go there.

Copy link
Member

Choose a reason for hiding this comment

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

What is the purpose of this folder requests_page?

Copy link
Member

Choose a reason for hiding this comment

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

In desktop version there is no such folder.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

Initially wanted to segregate widgets into

  • Request page widgets :
    • request list (left menu)
    • reqquest editor
    • response viewer
  • Environment page widgets
    • environment list (left menu)
    • environment editor

but as you mentioned since we are gonna have a separate folder for environments, yes, it doesn't make sense to have it inside the requests_page folder

Copy link
Member

Choose a reason for hiding this comment

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

Why is ResponseDrawer inside requests_page?

@@ -7,14 +7,14 @@ import '../models/models.dart';
import 'convert_utils.dart' show rowsToMap;
import '../consts.dart';

String getRequestTitleFromUrl(String? url) {
String getRequestTitleFromUrl(String? url, {bool capitalize = false}) {
if (url == null || url.trim() == "") {
Copy link
Member

Choose a reason for hiding this comment

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

Why this unnecessary change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Felt the lowercase 'untitled' Appbar title didn't look nice, but as you said, yes, it was an unnecessary change will remove it.

child: Text(
value.name.toUpperCase(),
style: kCodeStyle.copyWith(
fontSize: isMobile ? 13 : null,
Copy link
Member

Choose a reason for hiding this comment

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

Why font size is being hard coded here just for dropdown .. it should properly flow from consts.dart?

@@ -23,6 +23,8 @@ class IntroMessage extends StatelessWidget {
return FutureBuilder(
future: introData(),
builder: (BuildContext context, AsyncSnapshot<void> snapshot) {
final isMobile = kIsMobile &&
MediaQuery.sizeOf(context).width < kMinWindowSize.width;
Copy link
Member

Choose a reason for hiding this comment

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

again .. needs to be shortened everywhere by defining an extension over context.

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.

Mobile Android/ iOS Support
3 participants