Skip to content

draggable feedback location #17

@wph144

Description

@wph144

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions