Listener will be binded twice while its parent rebuild
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- dart
- Domain
- desktop-dev
Research direction
Start from the FileDropBox example and inspect DropTarget's listener lifecycle, especially how its onDragDone callback is registered when the parent rebuilds. Reproduce the example across rebuilds and verify that dropping a file invokes the callback only once, then check the relevant plugin tests if available.
Written by the indexing model from the issue text.
Description
class FileDropBox extends StatelessWidget {
FileDropBox({super.key});
final controller = Get.put(FileDropController());
@override
Widget build(BuildContext context) {
return DropTarget(
onDragDone: (details) {
final paths = details.files.map((file) => file.path).toList();
debugPrint("onDragDone!!!");
controller.onFilesDropped(paths);
},
child: const SizedBox.expand(),
);
}
}
For example, when the stateless widget FileDropBox rebuild, DropTarget will add a new onDragDone listener.
Which Means when I drop file to this widget, it will run onDragDone twice.
When FileDropBox rebuild again, onDragDone will run for three times.
- Dominant language
- C
- Stars
- 512
- Forks
- 292
- Avg merge
- 15h 8m
- Merged PRs (30d)
- 7
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MixinNetwork/flutter-plugins
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
MixinNetwork/flutter-plugins#413 · 8 reactions ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
MixinNetwork/flutter-plugins#401 · 2 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
MixinNetwork/flutter-plugins#504 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 76/100
MixinNetwork/flutter-plugins#502 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 76/100
MixinNetwork/flutter-plugins#497 ·
All issues in MixinNetwork/flutter-plugins
Similar issues
-
task
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
vsanthanam/JBird#429 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
bug documentation
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
es-ude/OnDeviceTraining#459 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
bilelmoussaoui/gobject-linter#199 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
bradcypert/plum#53 ·