Skip to content

Update dual scrollbar constructor to support corner space #122345

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

Open
Piinks opened this issue Mar 9, 2023 · 4 comments
Open

Update dual scrollbar constructor to support corner space #122345

Piinks opened this issue Mar 9, 2023 · 4 comments
Labels
c: new feature Nothing broken; request for a new capability f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. P3 Issues that are less important to the Flutter project team-framework Owned by Framework team triaged-framework Triaged by Framework team

Comments

@Piinks
Copy link
Contributor

Piinks commented Mar 9, 2023


Part of the 2D scrolling proposal: flutter.dev/go/2D-Foundation

#122349 adds a factory constructor that creates two scrollbars for scrolling in two dimensions. This change is proposed as a lead up to TwoDimensionalScrollable etc.

The dual factory constructor works almost perfectly when plugged into TwoDimensionalScrollable, except for the small overlap in the joining corner.

Screenshot 2023-02-09 at 5 00 33 PM

While investigating this, I found multiple native behaviors. Most common:

Image Description
Screenshot 2023-02-09 at 11 38 02 AM (2) The scrollbars operate on a first-come-first-serve rule for the corner space. Here the horizontal bar got there first, the vertical is not allowed to overlap. Observed on MacOS as default behavior.
Screenshot 2023-02-09 at 11 39 17 AM Empty space. No scrollbar enters the corner space.

Both of these should be supported.

I have investigated this a fair bit, and I think the best way for this to work (instead of creating two instances of the scrollbar widget) is to have the .dual constructor instead create two instances of ScrollPainter internal to the single scrollbar widget.

This is because in order to properly avoid overlapping each other, the painters need to know about the state of each other since the scrollbar size and visibility can change based on hovering, dragging, whether or not scrolling is happening, etc.

@Piinks Piinks added c: new feature Nothing broken; request for a new capability framework flutter/packages/flutter repository. See also f: labels. f: scrolling Viewports, list views, slivers, etc. entertaining new contributor project P3 Issues that are less important to the Flutter project labels Mar 9, 2023
@Piinks Piinks changed the title Make dual scrollbar constructor and support 2D behaviors Update dual scrollbar constructor and support 2D behaviors Mar 10, 2023
@Piinks Piinks moved this to Todo in 2D Scrolling Mar 10, 2023
@Piinks Piinks changed the title Update dual scrollbar constructor and support 2D behaviors Update dual scrollbar constructor to support corner space Mar 10, 2023
@dleyba042
Copy link
Contributor

I was looking into this as part of a school project (I have no experience contributing to open source) and I was wondering if this issue needs to be updated. I noticed that the dual factory method for the Cupertino Scrollbar was never merged into main so was not sure how to proceed since I can't add to that. Just curious.

@flutter-triage-bot flutter-triage-bot bot added the good first issue Relatively approachable for first-time contributors label Jul 6, 2023
@MhouneyLH
Copy link

MhouneyLH commented Jul 7, 2023

Hey @Piinks, do you have a sample app for this problem? I by myself was not even able to get the two scrollbars 😓

My code example ```dart

import 'package:flutter/material.dart';

void main() {
runApp(const MainApp());
}

class MainApp extends StatelessWidget {
const MainApp({super.key});

@OverRide
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: TwoDimensionalScrollable(
horizontalDetails: const ScrollableDetails.horizontal(),
verticalDetails: const ScrollableDetails.vertical(),
viewportBuilder: (context, verticalPosition, horizontalPosition) {
return DataTable(columns: const [
DataColumn(label: Text('col label 1')),
DataColumn(label: Text('col label 2')),
DataColumn(label: Text('col label 3')),
DataColumn(label: Text('col label 3')),
DataColumn(label: Text('col label 3')),
DataColumn(label: Text('col label 3')),
], rows: const [
DataRow(cells: [
DataCell(Text('#100')),
DataCell(Text('Flutter Basics')),
DataCell(Text('David John')),
DataCell(Text('#100')),
DataCell(Text('Flutter Basics')),
DataCell(Text('David John')),
]),
DataRow(cells: [
DataCell(Text('#101')),
DataCell(Text('Dart Internals')),
DataCell(Text('Alex Wick')),
DataCell(Text('#100')),
DataCell(Text('Flutter Basics')),
DataCell(Text('David John')),
]),
DataRow(cells: [
DataCell(Text('#101')),
DataCell(Text('Dart Internals')),
DataCell(Text('Alex Wick')),
DataCell(Text('#100')),
DataCell(Text('Flutter Basics')),
DataCell(Text('David John')),
]),
]);
},
),
),
);
}
}

</details> 

@flutter-triage-bot flutter-triage-bot bot added team-framework Owned by Framework team triaged-framework Triaged by Framework team labels Jul 8, 2023
@0304ajay
Copy link

Hello I am Ajay, I am new to open-source contribution, But I am very interested in resolving issues Can you please explain to me briefly How to resolve good first issues

@Piinks Piinks removed the good first issue Relatively approachable for first-time contributors label Jul 25, 2024
@NatanAmorim
Copy link

Sorry to bother, I'm aware the Flutter teams has their hands full right now, but I have been waiting for this since 2D scrolling was announced, I would like to ask, is there any development about corner spaces so far?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: new feature Nothing broken; request for a new capability f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. P3 Issues that are less important to the Flutter project team-framework Owned by Framework team triaged-framework Triaged by Framework team
Projects
Status: Todo
Development

No branches or pull requests

6 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy