Repository: flutter
Issue: [Proposal]`DragTarget.onWillAccept` should trigger when the widget appears under a dragged item (similar to`MouseRegion.onEnter`)
Labels: framework,c: proposal,P3,team-framework,triaged-framework

# Problem
I am currently implementing a "drag-file-to-change-directory" kind of UI like in MacOS:

https://user-images.githubusercontent.com/24209580/184374376-4b5dc77f-d41f-4b9a-af50-8f3b01d39c5f.mov

For this i am using `DragTarget.onWillAccept` to detect a dragged file (`Draggable`) entering a folder (`DragTarget`), and triggering a "change directory" based on that.

The video above shows two "change directory" actions without moving the pointer in between.
This is not currently possible to replicate with flutter `DragTarget`.

Instead the user must first move the pointer a tiny bit for `DragTarget.onWillAccept` to be triggered for the second time.

# `MouseRegion` can already detect non moving pointers in `onEnter` that were at their location before the widget existed
`MouseRegion.onEnter`s doc states:
```
[...]
/// This callback is triggered when the pointer, with or without buttons
/// pressed, has started to be contained by the region of this widget. More
/// specifically, the callback is triggered by the following cases:
///
///  * This widget has appeared under a pointer.
///  * This widget has moved to under a pointer.
///  * A new pointer has been added to somewhere within this widget.
///  * An existing pointer has moved into this widget.
[...]
```
With the important bit being `This widget has appeared under a pointer.`.

`DragTarget.onWillAccept` states:
```
[...]
/// Called when a piece of data enters the target. [...]
```

# Steps to reproduce
I have created two minimal examples, one for `MouseRegion.onEnter`, and one for `DragTarget.onWillAccept`

## `MouseRegion.onEnter`

1) click on the grey background
2) wait one second and dont move your cursor at all
3) a new widget is inserted that has a `MouseRegion.onEnter` to set a boolean
4) the background turns blue, meaning the `MouseRegion.onEnter` was triggered
(If you instead move the mouse out of the window before the one second has passed, the background will be red)

https://user-images.githubusercontent.com/24209580/184377551-ef1cb0d3-e3d9-493d-ba98-e8b47745f3cf.mov

<details>

```dart

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: "Application",
      home: Scaffold(
        body: MyWidget(),
      ),
    );
  }
}

class MyWidget extends StatefulWidget {
  const MyWidget({Key? key}) : super(key: key);

  @override
  State<MyWidget> createState() => _MyWidgetState();
}

class _MyWidgetState extends State<MyWidget> {
  bool isVisible = false;
  bool isEntered = false;

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Positioned.fill(
          child: InkWell(
            onTap: () => Future.delayed(
              const Duration(seconds: 1),
              () => setState(() {
                isVisible = true;
              }),
            ),
            child: Container(
              color: Colors.grey,
            ),
          ),
        ),
        if (isVisible)
          Positioned.fill(
            child: MouseRegion(
              onEnter: (_) => setState(() {
                isEntered = true;
              }),
              child: Container(
                color: isEntered ? Colors.blue : Colors.red,
                width: double.infinity,
                height: double.infinity,
              ),
            ),
          ),
      ],
    );
  }
}

```

</details>

## `DragTarget.onWillAccept`

1) click on the grey background
2) this will start a drag, DONT move your pointer at all
3) a new widget is inserted that has a `DragTarget.onWillAccept` to set a boolean
4) the background stays red, meaning the `DragTarget.onWillAccept` was not yet triggered
5) now move your pointer
5) the background turns blue, meaning the `DragTarget.onWillAccept` was now triggered after the movement

https://user-images.githubusercontent.com/24209580/184379109-c270b502-4c3d-4e0a-9c26-d23885c00ca3.mov

<details>

```dart

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: "Application",
      home: Scaffold(
        body: MyWidget(),
      ),
    );
  }
}

class MyWidget extends StatefulWidget {
  const MyWidget({Key? key}) : super(key: key);

  @override
  State<MyWidget> createState() => _MyWidgetState();
}

class _MyWidgetState extends State<MyWidget> {
  bool isVisible = false;
  bool isEntered = false;

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Positioned.fill(
          child: Draggable<int>(
            data: 0,
            feedback: Container(
              width: 100,
              height: 100,
              color: Colors.black,
            ),
            onDragStarted: () => setState(() {
              isVisible = true;
            }),
            child: Container(
              color: Colors.grey,
            ),
          ),
        ),
        if (isVisible)
          Positioned.fill(
            child: DragTarget<int>(
              onWillAccept: (data) {
                setState(() {
                  isEntered = true;
                });
                return true;
              },
              builder: (_, __, ___) => Container(
                color: isEntered ? Colors.blue : Colors.red,
                width: double.infinity,
                height: double.infinity,
              ),
            ),
          ),
      ],
    );
  }
}

```

</details>


# Expected vs Actual Behaviour
- Expected: `DragTarget.onWillAccept` triggers when the widget appears under a dragged item (like `MouseRegion.onEnter`)
- Actual: `DragTarget.onWillAccept` does not trigger when the widget appears under a dragged item. Instead it triggers only after the pointer has moved inside the widget