The flutter_test package sometimes imports material.dart (example) and cupertino.dart (example). In the course of decoupling, it should be migrated to material_ui and cupertino_ui, or decoupled entirely.
Possible complications
It's risky for both material.dart and material_ui to depend on flutter_test while it uses only one of them. For example, find.byTooltip does a type comparison using a type it imports from material.dart:
This comparison will always return false when called from material_ui, because material_ui has its own Tooltip implementation that is not treated as equivalent to the material.dart implementation.
I've hacked around this particular problem in the main decoupling PR (flutter/packages#11669) by duplicating this finder. I'm unaware of other immediate complications, but we should watch out!
What to do about it
- Option 1: Wait for material.dart and cupertino.dart to be deprecated, then migrate flutter_test to material_ui and cupertino_ui. Hope there are no other complications in the meantime.
- Option 2: Decouple flutter_test from Material and Cupertino altogether.
I recommend we go with Option 2 if we have the bandwidth to do it. There are only two material imports in the actual flutter_test code (rg "material.dart" packages/flutter_test/lib) and one cupertino import (rg "cupertino.dart" packages/flutter_test/lib). After decoupling, we should deprecate byTooltip and any other APIs that depend on Material/Cupertino, and move them into material_ui/cupertino_ui themselves.
The flutter_test package sometimes imports material.dart (example) and cupertino.dart (example). In the course of decoupling, it should be migrated to material_ui and cupertino_ui, or decoupled entirely.
Possible complications
It's risky for both material.dart and material_ui to depend on flutter_test while it uses only one of them. For example,
find.byTooltipdoes a type comparison using a type it imports from material.dart:flutter/packages/flutter_test/lib/src/finders.dart
Line 404 in cc7a86d
This comparison will always return false when called from material_ui, because material_ui has its own Tooltip implementation that is not treated as equivalent to the material.dart implementation.
I've hacked around this particular problem in the main decoupling PR (flutter/packages#11669) by duplicating this finder. I'm unaware of other immediate complications, but we should watch out!
What to do about it
I recommend we go with Option 2 if we have the bandwidth to do it. There are only two material imports in the actual flutter_test code (
rg "material.dart" packages/flutter_test/lib) and one cupertino import (rg "cupertino.dart" packages/flutter_test/lib). After decoupling, we should deprecate byTooltip and any other APIs that depend on Material/Cupertino, and move them into material_ui/cupertino_ui themselves.