-
Notifications
You must be signed in to change notification settings - Fork 151
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
Unable to scroll horizontally ? #106
Comments
Please share flutter doctor output and provide more detail (env, steps to reproduce, code snippet, video or screenshot etc) |
Doctor summary (to see all details, run flutter doctor -v): |
`
|
I can reproduce the bug, thanks for submitting the issue. It's related to the addition of fixed columns in 2.3.0 Could you please for the time-being revert to lower version?
|
Have the same issue . |
I've just pushed a fix to the
|
The git reference worked. Thanks |
Great! Will close the issue once the changes are pushed to pub.dev |
Hi @maxim-saplin, I have the same issue, Dependency: dependencies:
data_table_2: ^2.2.3 Error: Error: Cannot hit test a render box with no size.
The hitTest() method was called on this RenderBox: RenderFlex#0766f:
needs compositing
creator: Column ← FutureBuilder<PaginateResponse<Archive>?> ← ArchivesPage ← RepaintBoundary ← IndexedSemantics ← NotificationListener<KeepAliveNotification> ← KeepAlive ← AutomaticKeepAlive ← KeyedSubtree ← _SliverFillViewportRenderObjectWidget ← _SliverFractionalPadding ← SliverFillViewport ← ⋯
parentData: <none> (can use size)
constraints: BoxConstraints(w=1840.0, h=672.0)
size: MISSING
direction: vertical
mainAxisAlignment: start
mainAxisSize: max
crossAxisAlignment: center
verticalDirection: down
Although this node is not marked as needing layout, its size is not set.
A RenderBox object must have an explicit size before it can be hit-tested. Make sure that the RenderBox in question sets its size during layout. Code: Column(
children: [
Expanded(
child: ScrollShadow(
controller: scrollControllerHorizontal,
scrollDirection: Axis.horizontal,
size: AppSize.paddingLarge,
color: AppColors.accent,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
controller: scrollControllerHorizontal,
child: AppCard(
child: DataTable2(
scrollController: scrollController,
dataRowHeight: 60,
columns: TableColumns.getHeader(
context,
context.read<MachineTypeAndDetails>().machineType,
widget.filters),
rows: snapshot.data!.docs
.mapIndexed((index, e) => TableColumns.getDataRow(
context,
context
.read<MachineTypeAndDetails>()
.machineType,
e,
index,
widget.filters))
.toList(),
),
),
),
),
),
...
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.0.2, on Microsoft Windows [Versione 10.0.19043.1766], locale it-IT)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.9.0)
[√] Android Studio (version 2020.3)
[√] Android Studio (version 2021.2)
[√] VS Code (version 1.67.0)
[√] Connected device (3 available)
[√] HTTP Host Availability
• No issues found! Today i try with new dependency but the issue persists: dependencies:
data_table_2: ^2.3.2 Thanks. |
Might be the cause, DataTable2 won't work in parent with infinite dimensions. |
Yes, i read documentation
And i edited my implementation:
But i have this error ======== Exception caught by widgets library =======================================================
The following assertion was thrown building LayoutBuilder:
Assertion failed: file:///C:/tool/flutter-sdk/.pub-cache/hosted/pub.dartlang.org/data_table_2-2.3.2/lib/src/data_table_2.dart:1184:12
totalFixedWidth < totalColAvailableWidth
"DataTable2, combined width of columns of fixed width is greater than availble parent width. Table will be clipped" |
That's not an error but an assertion - the widget is supposed to be rendered just fine. It hints of a bad state situation when there're fixed width columns and their total width is greater than the available width. I supposed that somewhere in your code there're columns with |
Yes, all my columns are with |
Set |
Thanks @maxim-saplin , I have set |
Please record the video and post here |
Where is the app started (OS, kind of device)? |
This is Web platform. |
Can you please provide the complete info on the environment where the video is recorded (browser, device, OS etc.)? |
If you happen to be using Chrome Dev Tool and mobile device emulation on desktop browser - that won't work and not supposed to work. |
Nono, my app is only web! |
What is the browser? Do you run the browswrr (where you open the app) on PC, Mac or some Android phone? |
Browser is Chrome Versione 102.0.5005.115 (Build ufficiale) (a 64 bit) On Windows machine |
Check that issue #100 |
Ok, i have try with Edge and Firefox (On Windows) and I have the same issue! |
Do you try to scroll via mouse or trackpad? Or do you try to scroll via taping down and then moving the cursor? |
Hi @maxim-saplin , The isses is when tap on datatable e moving the cursor or without mouse when tap on screen (with touchscreen) e move finger. with mouse scroll wheel or scrollbar the datatable scrolling correctly |
Scrolling with mouse taps on desktop with mouse inputs doesn't make sense... That is not supposed to work |
That is interesting. Please provide details (device model, environment where the issue is present) |
Yes, it working, because i have enabled this:
|
I have try on Browser (Chrome/Firefox/Edge) installed on linux(Ubuntu 20.04) and windows(Windows 10) machines. |
So you don't have an actual touch device, the issue you have is you want to be able to scroll the table via mouse with the above overrides enabling mouse behaviour to be treated as touch events... |
No, the production devices have a 15-inch capacitive touch screen, the functionality to use the mouse is only used in the development phase. The problem, however, occurs both with the mouse and with the touch. |
I see... The best I can suggest you now is trying to fork the package, play with |
This is the exception when i try to scroll
|
solved by just added
|
awesome , |
after updating to the new version i am unable to scroll horizontally , before it was working fine scrolling on both directions flawlessly , using the datatable2 , do it need any other property to be used .
The text was updated successfully, but these errors were encountered: