Repository navigation
Closed
Description
hi, thanks for great package
I am using ReorderableWrap of 'reorderables' package.
I found feedback's location is wrong when using responsive_framework package.
More generally, there are same problem when using Draggable widget.
following is minimal reproducible application.
import 'package:flutter/material.dart';
import 'package:responsive_framework/responsive_framework.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
builder: (context, widget) {
return ResponsiveWrapper.builder(
BouncingScrollWrapper.builder(context, widget),
maxWidth: 1200,
minWidth: 350,
debugLog: false,
defaultScale: true,
breakpoints: [
ResponsiveBreakpoint.resize(350, name: MOBILE, scaleFactor: 0.8),
ResponsiveBreakpoint.autoScale(800, name: TABLET, scaleFactor: 1.4),
ResponsiveBreakpoint.autoScale(1000, name: TABLET, scaleFactor: 1.4),
const ResponsiveBreakpoint.resize(1200, name: DESKTOP),
const ResponsiveBreakpoint.autoScale(2460, name: "4K"),
],
mediaQueryData: MediaQuery.of(context).copyWith(textScaleFactor: 1),
background: Container(),
);
},
home: DraggableExample(),
);
}
}
class DraggableExample extends StatefulWidget {
@override
DraggableExampleState createState() => DraggableExampleState();
}
class DraggableExampleState extends State<DraggableExample> with SingleTickerProviderStateMixin {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
Spacer(),
Row(
children: [
Spacer(),
Draggable(
feedback: Container(
width: 60,
height: 60,
color: Colors.red,
),
child: Container(
width: 60,
height: 60,
color: Colors.red,
),
),
],
),
SizedBox(height: MediaQuery.of(context).padding.bottom,),
],
)
);
}
}
If item is on top-left, there are no or small difference, on right-bottom there are big difference.
I intentionally put scale factor apart from 1.0
Can you help me?
Reacted by Gabriel Costa, cyrilOrderoo and ed-oo
Metadata
Metadata
Assignees
Labels
No labels
Activity
rayliverified commentedon Sep 1, 2020
Thanks for reporting this issue.
I'm going to look into if it is possible to overwrite the root level MediaQuery parameters.
Some framework widgets fetch their layout from the root screen metrics directly which means they are not getting the right metrics.
gcostaapps commentedon Sep 19, 2020
Could you try using this build with the MediaQuery parameter? It was used to fix MediaQuery for entire app.
wph144 commentedon Sep 19, 2020
I tried below, but I still have same problem.
It seems that I already used MediaData on MaterialApp level with 'mediaQueryData parameter of ResponsiveWrapper.builder method'.
DevicePreview is just helper and not related to this issue, right?
(i have compile error, so I cannot try right now, aloisdeniel/flutter_device_preview#67)
Thanks for reply :)
bounty1342 commentedon Sep 23, 2020
@searchy2 Might be related to this one, but I have issue with ReorderableListView. Should I open a new issue ?
Depending on the location of the click, it throw the widget off.
rayliverified commentedon Sep 23, 2020
It's most likely related to this issue.
The problem/solution is in passing a transformed composited tap target.
Not sure on the exact implementation but I can point you in the right direction if you are interested in taking a look.
bounty1342 commentedon Sep 24, 2020
Found this :
https://medium.com/flutter/how-to-float-an-overlay-widget-over-a-possibly-transformed-ui-widget-1d15ca7667b6
So wrapping the parent widget with a CompositedTransformTarget to get reference to the cordinate sytem and then wrap the child with CompositedTransformFollower to follow it.
This seems way to easy to actually work 😁
cyrilOrderoo commentedon Nov 30, 2020
Same problem, very complicated to use draggable on tablet. When moving, the draggable is moved away from the cursor. I have the problem only on iOS, everything works on android. Do you have any news on the issue ? Thanks
bounty1342 commentedon Dec 29, 2020
Hi @searchy2,
Having issues with dragg and drop, but also with other package like flutter_intro.
Do you have any update on a fix ?
wph144 commentedon Jan 22, 2021
any progress?
wph144 commentedon Jan 24, 2021
I resolved with workaround (simple but some boilerplate codes)
If you use the widget that internally use OverlayEntry to make draggable feedback, Responsive framework package can generate coordination problem. e.g., ReorderableWrap, Draggable, LongPressDraggable, etc.
That widget may have parameter onDragStarted, onDragEnded, feedback. (or other name)
infobkm commentedon Mar 15, 2022
no updates for this issue for over a year? I really like this plugin but I can't use it because my app is based on a form with a reorderable list..
gozluc84 commentedon May 21, 2022
0.2.0 version released but issue still present.. :( no workaround?
TimBaumgart commentedon Jan 11, 2023
Any updates on this? I was trying to find a workaround by disabling autoscaling for some widgets where I use ReorderableListView, but could not get it to work. Does anyone know how to do this? Just wrapping my widget with another ResponsiveWrapper did not work.
TimBaumgart commentedon Jan 12, 2023
I found a solution that is working for me. I am calculating a transform-matrix, which depends on the current pointer location, and apply it to the proxy decorator. Here is my Code:
This approach is not 100% correct, I think, but it fits my needs. It might break, if your draggable has a variable x-offset.
WillianSalceda commentedon May 18, 2023
@rayliverified Why this issue is being closed, even though it still unfixed?
@TimBaumgart is a workaround, not a fix. But still, it does not work with the current newest version of the package. scaledWidth and scaledHeight doesn't exist, for instance.
Eerey commentedon Jan 29, 2024
It also seems to conflict with
Draggable.Similar issue with that. It seems like the
globalToLocal-calculation or something like that is not correct.egonbeermat commentedon Feb 22, 2024
Same issue here, when using
LongPressDraggableinsideResponsiveScaledBox, theDraggableDetails.offsetreturned fromonDragEndare not in the correct scaled coordinate system. Whilst it might not be possible to override or alter this, a workaround or an additional method inside responsive_framework to convert would be handy.elkSal commentedon Mar 6, 2024
Facing same issue with ReorderableListView, when dragging, the item overflows and become bigger than original size.
Quick dirty solution is to use internal padding as follows
This puts some padding around the list view item so that on drag, it doesn't overflow screen width.
No solution yet?
LosDanieloss commentedon Jul 23, 2025
For anyone interested issues is still present mid 2025.
reorder_problem_example.mp4
My minimal repro sample can be found at: https://github.com/LosDanieloss/responsive_framework_reorder_problem_example
My repro sample uses
CustomScrollView&SliverReorderableListbut same applies when usingReorderableListViewI saw that Flutter team did some changes to how draggable position is calculated.
I'm referencing flutter/flutter#145647 which was reverted and merged once again in flutter/flutter#149040.
Everything suggests that those changes were introduced in Flutter v3.22.0 but I'm running v3.29.0 and still have problems. That's why I'm here.
reactive_framework v1.5.1
PS. since this one is close l'll create a new one