v0.10.0
High-level API changes
- Breaking
spotText('dash')
can now return multiple widgets - New:
.atLeast(n)
and.atMost(n)
and.amount(n)
to force the number of expected widgets.
.atMost(0)
can be used to test that a widget does not exist! - Deprecated:
spotSingle<W>()
is now deprecated. Usespot<W>()
instead, orspot<W>().atMost(1)
to indicate that only a single widget is expected. - Fix:
.first()
and.last()
- New:
.atIndex(n)
allows to get the widget at a specific index (when multiple are found) - Deprecate:
allWidgets
in favor ofspotAllWidgets()
to avoid conflicts with local variables - New:
getDiagnosticProp<T>('name')
for easy access to the values of a diagnostic property #40 - New:
hasEffectiveTextStyle
,withEffectiveTextStyleMatching()
,withEffectiveTextStyle()
#36, #38 - Improve:
WidgetSelector.toString()
has been improved, has now separators for stages and adds braces.
Example:Center with child SizedBox ❯ with parent (Scaffold ᗕ Row)
- Added tons of documentation and examples
Advanced API changes
Those changes can be breaking for packages that depend on spot
or advanced usages, but should not affect most users.
- Breaking
WidgetSelector
now hasList<ElementFilter> stages
, replacing the previousprops
,parents
,children
andelementFilters
. - Breaking
WidgetSelector
constructor andcopyWith
signature changed, reflecting the new properties.
createElementFilters()
,createCandidateGenerator()
andtoStringWithoutParents()
have been removed. WidgetSelector
now has aquantityConstraint
property (deprecatesexpectedQuantity
) that allows setting themin
andmax
number of expected widgets.WidgetSelector
replacesSingleWidgetSelector
andMultiWidgetSelector
- Breaking Quantity assertions like
.doesNotExist()
or.existsOnce()
now returnWidgetMatcher
/MultiWidgetMatcher
instead ofWidgetSnapshot
.
To get theWidgetSnapshot
usesnapshot()
instead. - Breaking Remove
WidgetSelector.cast
because it lost information and was untested - Breaking
PropFilter
has been renamed toPredicateFilter
- Breaking
PredicateWithDescription
has been removed - Breaking
CandidateGenerator
has been removed - Explicitly export all classes/extensions/functions to prevent accidental leaks of internal APIs