Coming from #186898
WidgetController from packages/flutter_test/lib/src/controller.dart is using a static variable _nextPointer as a counter
|
/// The next available pointer identifier. |
|
/// |
|
/// This is the default pointer identifier that will be used the next time the |
|
/// [startGesture] method is called without an explicit pointer identifier. |
|
int get nextPointer => _nextPointer; |
|
|
|
static int _nextPointer = 1; |
|
|
|
static int _getNextPointer() { |
|
final int result = _nextPointer; |
|
_nextPointer += 1; |
|
return result; |
|
} |
to set the pointer ID of a new gesture.
This design introduces hidden dependencies between tests. When running a file with multiple tests under random seeds, the test order changes based on the seed, which in turn alters the gesture IDs. As a result, gestures may receive different IDs across runs, leading to conflicts and inconsistent behavior in certain scenarios.
Coming from #186898
WidgetControllerfrompackages/flutter_test/lib/src/controller.dartis using a static variable_nextPointeras a counterflutter/packages/flutter_test/lib/src/controller.dart
Lines 1831 to 1843 in 764a079
to set the pointer ID of a new gesture.
This design introduces hidden dependencies between tests. When running a file with multiple tests under random seeds, the test order changes based on the seed, which in turn alters the gesture IDs. As a result, gestures may receive different IDs across runs, leading to conflicts and inconsistent behavior in certain scenarios.