bloom_testing library
Testing harness, mock utilities, and widget testing extensions for Bloom applications.
Exports flutter_test, bloom.dart, and provides BloomMock for recording method
invocations and BloomWidgetTesterExtensions for pumping isolated test applications with DI overrides.
Example:
import 'package:bloom_framework/bloom_testing.dart';
void main() {
testWidgets('renders home screen with mock service', (tester) async {
final scope = await tester.pumpBloomApp(
home: const Text('Hello Bloom'),
overrides: [
BloomTestOverride<AuthService>(MockAuthService()),
],
);
expect(find.text('Hello Bloom'), findsOneWidget);
});
}
Classes
- AccessibilityGuideline
- An accessibility guideline describes a recommendation an application should meet to be considered accessible.
- ActionResult
- Result returned from a route form action handler.
- AndroidPlatform
- Android platform build configuration settings.
- AnimationSheetBuilder
- Records the frames of an animating widget, and later displays the frames as a grid in an animation sheet.
- AutomatedTestWidgetsFlutterBinding
-
A variant of TestWidgetsFlutterBinding for executing tests typically
the
flutter testenvironment, unless it is an integration test. - Bloom
- The core Bloom framework controller and global entrypoint.
- BloomAction
- Annotation marking a server-side or client form action handler for a route.
- BloomApiRouter
- High-performance server router for Bloom API routes, WebSocket gateways, and SSR endpoints.
- BloomApp
- Root application widget for Bloom applications.
- BloomAppConfig
-
Strongly typed application configuration model for
bloom.config.dart. - BloomAsyncFunction
- Metadata annotation declaring an asynchronous native function bridge.
-
BloomAuth<
U> - Reactive user session manager and persistent authentication layer.
- BloomAuthBase
- Base non-generic interface for Bloom authentication session management.
- BloomAuthGuard
- Standard authentication route guard protecting authenticated screens.
- BloomBackground
- Manages background task execution and background periodic synchronization.
- BloomBootstrapper
-
Contract for custom user bootstrapper code in
lib/app/boot.dart. - BloomBreadcrumb
- A structured breadcrumb recording a user action, network call, or state mutation.
- BloomBreadcrumbRingBuffer
- Fixed-capacity ring buffer for storing recent chronological breadcrumbs.
- BloomCamera
-
Camera capture and photo gallery interface for Bloom applications wrapping
image_picker. - BloomCapturedPhoto
- Represents an image file captured from the device camera or picked from the gallery.
- BloomConfig
-
Strongly typed configuration model mapping directly to
bloom.yaml. - BloomConstant
- Metadata annotation declaring a static constant exported by the host native platform.
- BloomContainer
- Lightweight, high-performance Dependency Injection container for Bloom.
- BloomController
- Base class for Bloom state controllers.
- BloomCorsMiddleware
- Built-in Cross-Origin Resource Sharing (CORS) middleware for Bloom API endpoints.
- BloomCrashFingerprint
- Utilities for calculating deterministic crash grouping fingerprints.
-
BloomCrudRepository<
T, ID> - Generic CRUD repository interface for typed entities composing read and write contracts.
- BloomData
- Global query cache manager for Bloom Data with automated periodic TTL garbage collection and request deduplication.
- BloomDeepLinks
- Cross-platform deep linking and Universal / App Links controller.
- BloomDeepLinksConfig
- Deep link URL scheme and universal link domain configuration.
- BloomDeploymentConfig
-
Deployment block configuration in
bloom.yaml. - BloomDev
- Developer tooling harness for simulating network latency, outages, and failure rates.
- BloomDevOverlay
- Universal in-app developer modal and diagnostics overlay for Bloom applications and Bloom Go.
- BloomDevServerDiscovery
- UDP discovery service for scanning LAN networks for active Bloom Dev Servers on port 5354.
- BloomDevToolsService
- Registers Bloom DevTools VM service extensions for live visual debugging.
- BloomDiscoveredServer
- Represents a Bloom dev server discovered on the local area network.
- BloomEnv
- Environment configuration parser, store, and type-safe reader.
- BloomEnvironmentSchema
- Abstract base class for strictly typed and validated environment variable schemas.
- BloomEvent
- Metadata annotation declaring a native event listener.
- BloomFeatureFlags
- Dynamic, reactive feature flags management engine for Bloom applications.
- BloomFeatures
-
Feature flags and subsystem toggles declared in
bloom.yaml. - BloomFlavorConfig
-
Configuration for a specific application build flavor (e.g.
staging,production). - BloomGoClient
- Client protocol handler for Bloom Go mobile applications connecting to dev servers.
- BloomGuard
- Abstract contract for route guards (e.g. authentication, role permissions, feature flags).
- BloomHttpClient
- HTTP client with environment base URL resolution, JSON codecs, Bearer auth token injection, DevTools tracing, and simulation hooks.
- BloomHttpTelemetryTransport
- Production HTTP transport that posts JSON telemetry payloads to a remote collector endpoint.
- BloomHttpUpdateAdapter
- Real HTTP and CDN network adapter for checking, downloading, and verifying OTA patches.
- BloomJsonStorage
- JSON object storage with optional TTL expiration.
- BloomLayout
- Base class for persistent shell and tab layouts.
- BloomLifecycleHook
- Metadata annotation declaring a host application lifecycle listener.
- BloomLifecycleManager
- Central manager coordinating application-wide lifecycle events.
- BloomLoader
- Annotation marking a server-side or build-time data loader for a route.
- BloomLogger
- Standardized structured logging system for Bloom servers, apps, and microservices.
- BloomLogo
-
The real Bloom five-petal gradient flower mark, matching the brand SVG
used across bloom.dev and the Cloud dashboard (
bloom-logo.tsx). - BloomMemoryTelemetryTransport
- In-memory transport storing telemetry events in a list (ideal for unit testing and debugging).
- BloomMiddleware
- Composable middleware interface for Bloom API routes, full-stack SSR servers, and gateways.
- BloomMock
- Base class for Bloom service test doubles with call recording utilities.
- BloomModule
- Metadata annotation declaring a Bloom Native Module.
- BloomModuleManifest
-
Strongly typed manifest representation of
bloom.module.yaml. - BloomModulePermission
-
Represents a permission declared in
bloom.module.yaml. - BloomModulePlatformSpec
- Platform constraints, dependencies, and native frameworks for a Bloom Native Module.
- BloomModuleRegistry
- Central singleton registry managing the lifecycle, registration, and discovery of Bloom Native Modules.
-
BloomMutation<
T, P> - Asynchronous mutation manager with automated optimistic updates, automatic rollback, and cache invalidation.
- BloomNativeModule
- Base class for all native Bloom modules bridging Dart to host iOS/Android platforms.
- BloomNativeView
- A cross-platform bridge widget for hosting hardware-accelerated native views (e.g. Camera Preview, MapKit/Google Maps, AR views, WebViews) declared in Bloom Modules.
- BloomNetworkInspector
- Central network inspection and request replay engine for Bloom DevTools.
- BloomNetworkTrace
- Recorded network request / response trace event.
- BloomNotificationChannel
- Represents an Android notification channel configuration for Android 8.0 (API 26) and newer.
- BloomNotifications
-
Cross-platform push and local notifications manager wrapping
flutter_local_notifications. - BloomObservability
- Core Error Observability, Crash Reporting, and Telemetry Engine for Bloom.
- BloomObservabilityConfig
- Configuration options for Bloom Error Observability and Telemetry SDK.
- NavigatorObserver that automatically records route transition breadcrumbs.
- BloomOTA
- Over-The-Air (OTA) update and code-push controller powered by Shorebird.
- BloomOtaPatch
- Represents an available OTA patch descriptor.
- BloomPermissions
-
Central native permissions manager for Bloom applications wrapping
permission_handler. - BloomPlatforms
-
Target platforms configuration declared in
bloom.yaml. - BloomPlugin
-
A strongly typed plugin reference declared in
bloom.config.dart. - BloomProjectManifest
- Project manifest delivered by the Bloom dev server for Bloom Go mobile apps.
-
BloomQuery<
T> - A reactive asynchronous query with automatic caching, stale-while-revalidate, and deduplication.
- BloomQueryCacheInspector
- Visual query cache inspection and management engine for Bloom DevTools.
-
BloomReadOnlyRepository<
T, ID> - Lean read-only repository interface for query-only data access (Interface Segregation Principle).
- BloomRepository
- Base repository pattern class for encapsulating API communication.
- BloomRequest
- Represents an incoming HTTP request in Bloom API routes, SSR endpoints, and middleware.
- BloomResponse
- Represents an HTTP response returned from a Bloom API route handler or middleware.
- BloomRoute
- Base class for Bloom page and screen widgets.
- BloomRouteConfig
- Annotation for declaring route metadata and guards on BloomRoute classes.
- BloomRouteContext
- Route execution context provided to loaders, actions, and metadata builders.
- BloomRouteGroup
- Represents a scoped route group in BloomApiRouter sharing a URL prefix and middleware pipeline.
- BloomRouteMatch
- Metadata match information passed to guards and route builders.
- BloomRouteMetadata
- Declarative SEO, OpenGraph, and Twitter Card metadata configuration for Bloom routes.
- BloomRouter
- Central Bloom router orchestrating declarative navigation, deep links, and route guards.
- BloomRuntimeFingerprint
- Cryptographic Runtime Fingerprint generator and validator.
- BloomSecureStorage
-
Encrypted key-value secure storage wrapping
flutter_secure_storage(iOS Keychain / Android EncryptedSharedPreferences). - BloomServerpodClient
- Official Bloom client adapter for Serverpod backend connections.
-
BloomServerpodRepository<
T> - CRUD repository adapter bridging Serverpod endpoint delegates to Bloom Data conventions.
- BloomShorebirdConfig
-
Shorebird OTA (Over-The-Air) deployment configuration declared in
bloom.yaml. - BloomSignalsInspector
- Visual inspection engine for the Bloom Signals state tree.
- BloomStorageAdapter
- Abstract storage adapter contract for key-value persistence.
- BloomStream
- Metadata annotation declaring a continuous native hardware stream.
-
BloomStreamSignal<
T> - A reactive signal bound to a real-time stream subscription with explicit lifecycle disposal.
- BloomSupabaseAuthAdapter
- Official Bloom authentication adapter for Supabase with real token refresh support.
-
BloomSupabaseTableRepository<
T> - Strongly-typed CRUD repository adapter for Supabase REST tables.
- BloomSupabaseUser
- Represents an authenticated Supabase user profile.
- BloomSyncFunction
- Metadata annotation declaring a fast synchronous native function bridge.
- BloomTelemetryEvent
- A complete structured crash / telemetry event payload.
- BloomTelemetryTransport
- Transport contract for dispatching telemetry and crash events.
-
BloomTestOverride<
T> - Represents a typed test override instance to be injected into a BloomTestScope.
- BloomTestScope
- A scoped DI harness for running unit and integration tests with isolated overrides.
- BloomUpdateBanner
- Pre-built reactive in-app update banner.
- BloomUpdateClientAdapter
- Network and platform adapter contract for fetching and applying OTA updates.
- BloomUpdateDialog
- Modal dialog for mandatory or recommended OTA updates.
- BloomUpdates
- Enterprise-grade Over-The-Air (OTA) Updates and Runtime Fingerprint Engine.
- BloomView
- Metadata annotation declaring a native platform view (e.g. Camera preview, Map, AR view).
-
BloomWriteRepository<
T, ID> - Lean write-only/mutation repository interface (Interface Segregation Principle).
- CapturedAccessibilityAnnouncement
- Accessibility announcement data passed to SemanticsService.sendAnnouncement captured in a test.
- ChainedFinder
- Applies additional filtering against a parent widget finder.
- CommonFinders
- Provides lightweight syntax for getting frequently used Finders and SemanticsFinders through semantics.
- CommonSemanticsFinders
- Provides lightweight syntax for getting frequently used semantics finders.
- CommonTextRangeFinders
- Provides lightweight syntax for getting frequently used text range finders.
- ComparisonResult
- The result of a pixel comparison test.
-
Computed<
T> -
Data is often derived from other pieces of existing data. The
computedfunction lets you combine the values of multiple signals into a new signal that can be reacted to, or even used by additional computeds. When the signals accessed from within a computed callback change, the computed callback is re-executed and its new return value becomes the computed signal's value. - CustomMatcher
- A base class for Matcher instances that match based on some feature of the value under test.
- CustomMinimumContrastGuideline
- A guideline which verifies that all elements specified by finder meet minimum contrast levels.
- DefaultTestVariant
-
The TestVariant that represents the "default" test that is run if no
variantsiterable is specified for testWidgets. - Description
- Matchers build up their error messages by appending to Description objects.
- Effect
-
The
effectfunction is the last piece that makes everything reactive. When you access a signal inside its callback function, that signal and every dependency of said signal will be activated and subscribed to. In that regard it is very similar tocomputed(fn). By default all updates are lazy, so nothing will update until you access a signal insideeffect. - Evaluation
- The result of evaluating a semantics node by a AccessibilityGuideline.
- Fake
- A stand-in for another object which cannot be used except for specifically overridden methods.
- FakeAccessibilityFeatures
- Test version of AccessibilityFeatures in which specific features may be set to arbitrary values.
- FakeViewPadding
- Used to fake insets and padding for TestFlutterViews.
- FileStorageAdapter
- File-based storage adapter providing real persistence on disk across application restarts.
- Finder
- A base class for creating finders that search the Element tree for Widgets.
-
FinderBase<
CandidateType> - Encapsulates the logic for searching a list of candidates and filtering the candidates to only those that meet the requirements defined by the finder.
-
FinderResult<
CandidateType> - The results of searching with a FinderBase.
- FrameTimingSummarizer
- This class and summarizes a list of FrameTiming for the performance metrics.
- FunctionalBloomMiddleware
- Function-based middleware implementation wrapping a standalone handler callback.
-
Future<
T> - The result of an asynchronous computation.
- GoldenFileComparator
- Compares image pixels against a golden image file.
- GoRoute Get started Configuration Redirection Transition animations Named routes
- A route that is displayed visually above the matching parent route using the Navigator.
- GoRouter Get started Upgrading Configuration Redirection Web Deep linking Named routes Error handling
- The route configuration for the app.
- GoRouterState
- The route state during routing.
- GuardResult
- The result returned by a BloomGuard when evaluating navigation access.
- InMemoryStorageAdapter
- In-memory storage adapter for testing and rapid prototyping.
- InMemoryWatchdogStorage
- In-memory default implementation of WatchdogStorage (useful for testing).
- IosPlatform
- iOS platform build configuration settings.
- KeyEventSimulator
- A class that serves as a namespace for a bunch of keyboard-key generation utilities.
- KeySimulatorTransitModeVariant
- A TestVariant that runs tests with transit modes set to different values of KeyDataTransitMode.
- LabeledTapTargetGuideline
- A guideline which enforces that all nodes with a tap or long press action also have a label.
- LiveTestWidgetsFlutterBinding
-
A variant of TestWidgetsFlutterBinding for executing tests
on a device, typically via
flutter run, or via integration tests. This is intended to allow interactive test development. - LiveWidgetController
- Variant of WidgetController that can be used in tests running on a device.
- LocalFileComparator
-
The default GoldenFileComparator implementation for
flutter test. - Matcher
- The base class for all matchers.
- MatchesGoldenFile
- The matcher created by matchesGoldenFile. This class is enabled when the test is running on a VM using conditional import.
- MatchFinder
- Searches candidates for any that match a particular pattern.
- MinimumTapTargetGuideline
- A guideline which enforces that all tappable semantics nodes have a minimum size.
- MinimumTextContrastGuideline
- A guideline which verifies that all nodes that contribute semantics via text meet minimum contrast levels.
- MinimumTextContrastGuidelineAAA
- A guideline which verifies that all nodes that contribute semantics via text meet WCAG AAA contrast levels.
- MockBloomUpdateClientAdapter
- In-memory mock client adapter used in development and tests.
- MockStreamHandler
- A mock stream handler for an EventChannel that mimics the native StreamHandler API.
- MockStreamHandlerEventSink
- A mock event sink for a MockStreamHandler that mimics the native EventSink API.
- OfflineMutationQueue
- Persistent offline mutation buffer and replay engine.
- Offset
- An immutable 2D floating-point offset.
- OnPlatform
- An annotation for platform-specific customizations for a test suite.
- OpenGraph
- OpenGraph metadata configuration for rich social media previews.
- PaintPattern
- Builder interface for patterns used to match display lists (canvas calls).
- PlatformsConfig
- Combined platforms configuration block aggregating Android, iOS, and Web settings.
- PointerEventRecord
- A record of input PointerEvent list with the timeStamp of when it is injected.
- QueryCacheDescriptor
- Visual descriptor for a cached query record displayed in DevTools.
-
QueryCacheEntry<
T> - A single cached query record containing fetched data, timestamps, and TTL settings.
- QueuedMutation
- A persisted mutation entry stored in the offline queue waiting to be synced with the server.
-
ReadonlySignal<
T> - Read only signals can just retrieve a value but not update or cause mutations
- RecordedInvocation
- An Invocation and the stack trace that led to it.
- Retry
- An annotation for marking a test suite to be retried.
- RouteBase
- The base class for GoRoute and ShellRoute.
- SemanticsController
- Class that programmatically interacts with the Semantics tree.
- SemanticsFinder
- A base class for creating finders that search the semantics tree.
- SemanticsHandle
- A reference to the semantics information generated by the framework.
- ShellRoute Configuration
- A route that displays a UI shell around the matching child route.
-
Signal<
T> -
AsyncStateis class commonly used with Future/Stream signals to represent the states the signal can be in. -
SignalBuilder<
T> - A typed builder widget that rebuilds whenever the targeted signal value changes.
- SignalDescriptor
- Visual descriptor for a tracked reactive signal displayed in DevTools.
- Skip
- An annotation for marking a test suite as skipped.
- StagedRolloutEvaluator
- Evaluates deterministic staged percentage rollouts for OTA updates.
- StartupCrashWatchdog
- Self-healing startup watchdog that detects crash loops on downloaded OTA patches and automatically falls back to the embedded base binary.
- StreamMatcher
-
A matcher that matches events from Streams or
StreamQueues. - StringDescription
- The default implementation of Description. This should rarely need substitution, although conceivably it is a place where other languages could be supported.
- Tags
- An annotation for applying a set of user-defined tags to a test suite.
- TargetPlatformVariant
- A TestVariant that runs tests with debugDefaultTargetPlatformOverride set to different values of TargetPlatform.
- TestAsyncUtils
-
Utility class for all the async APIs in the
flutter_testlibrary. - TestDefaultBinaryMessenger
- A BinaryMessenger subclass that is used as the default binary messenger under testing environment.
- TestDisplay
- A version of Display that can be modified to allow for testing various use cases.
- TestFlutterView
- A FlutterView that wraps another FlutterView and allows faking of some properties for testing purposes.
- TestGesture
- A class for performing gestures in tests.
- TestOn
- An annotation indicating which platforms a test suite supports.
- TestPlatformDispatcher
- PlatformDispatcher that wraps another PlatformDispatcher and allows faking of some properties for testing purposes.
- TestPointer
- A class for generating coherent artificial pointer events.
- TestRecordingCanvas
- A Canvas for tests that records its method calls.
- TestRecordingPaintingContext
- A PaintingContext for tests that use TestRecordingCanvas.
- TestRestorationData
- Restoration data that can be used to restore the state to the one described by this data.
- TestRestorationManager
- The RestorationManager used for tests.
- TestTextInput
- A testing stub for the system's onscreen keyboard.
-
TestVariant<
T> - An abstract base class for describing test environment variants.
- TestViewConfiguration
- A ViewConfiguration that pretends the display is of a particular size (in logical pixels).
- TestVSync
- A TickerProvider that creates a standalone ticker.
- TestWidgetsFlutterBinding
- Base class for bindings used by widgets library tests.
- TestWindow
- Deprecated. Will be removed in a future version of Flutter.
- TextEditingValue
- The current text, selection, and composing state for editing a run of text.
- TextRangeContext
-
The
CandidateTypeof finders that search for and filter substrings, within static text rendered by RenderParagraphs. - Throws
- Use the throwsA function instead.
- Timeout
- A class representing a modification to the default timeout for a test.
- TransitionDurationObserver
- Tracks the duration of the most recent page transition.
- TrivialComparator
- Placeholder comparator that is set as the value of goldenFileComparator when the initialization that happens in the test bootstrap either has not yet happened or has been bypassed.
- TwitterCard
- Twitter Card metadata for rich Twitter social previews.
-
TypeMatcher<
T> - A Matcher subclass that supports validating the Type of the target object.
- UpdateCheckResult
-
Result returned from
BloomUpdates.checkForUpdate(). - UpdateManifest
- Manifest describing a downloadable Over-The-Air (OTA) patch.
-
ValueVariant<
T> - A TestVariant that runs separate tests with each of the given values.
-
Watch<
T extends Widget> - Watch
- WatchdogStorage
- Delegate interface for persisting watchdog crash counts and active patch states across restarts.
- WebPlatform
- Web platform build configuration settings.
- WidgetController
- Class that programmatically interacts with widgets.
- WidgetTester
- Class that programmatically interacts with widgets and the test environment.
Enums
- BloomBreadcrumbLevel
- Severity level for breadcrumb events.
- BloomErrorLevel
- Severity level for telemetry and crash events.
- BloomLifecycleEvent
- Application lifecycle events forwarded to registered Bloom Native Modules.
- BloomLogLevel
- Log severity levels for Bloom applications.
- BloomOtaStatus
- Status events emitted during OTA code patch lifecycle.
- BloomPermission
- Native hardware and system permission types supported by Bloom applications.
- BloomPermissionStatus
- Permission authorization status returned by host platforms.
- BloomServerpodConnectionStatus
- Serverpod streaming connection status.
- ConflictPolicy
- Conflict resolution strategy when replaying offline mutations against the server.
- EnginePhase
- Phases that can be reached by WidgetTester.pumpWidget and TestWidgetsFlutterBinding.pump.
- LiveTestWidgetsFlutterBindingFramePolicy
- Available policies for how a LiveTestWidgetsFlutterBinding should paint frames.
- MutationStatus
- Lifecycle execution status of a BloomMutation.
- NativeMode
- Native execution mode for Bloom projects.
- NativeThread
- Execution thread model for native module operations on host platforms (iOS/Android).
- NotificationImportance
- Importance levels for notification priority and alerts.
- Plurality
- Describes how a string of text should be pluralized.
- QueryStatus
- Execution status of a BloomQuery.
- TestBindingEventSource
- Parts of the system that can generate pointer events that reach the test binding.
- TextInputAction
- An action the user has requested the text input control to perform.
Mixins
- BloomLifecycleObserver
- Mixin for classes that observe Flutter application lifecycle transitions.
-
ChainedFinderMixin<
CandidateType> - A mixin that applies additional filtering to the results of a parent Finder.
- LocalComparisonOutput
- A mixin for use in golden file comparators that run locally and provide output.
-
MatchFinderMixin<
CandidateType> - A mixin for creating finders that search candidates for those that match a given pattern.
-
SignalsMixin<
T extends StatefulWidget> - Signals mixin that will automatically rebuild the widget tree when any of the signals change and dispose of any signals and effects created locally.
- TestDefaultBinaryMessengerBinding
- Overrides the ServicesBinding's binary messenger logic to use TestDefaultBinaryMessenger.
Extensions
- BloomWidgetTesterExtensions on WidgetTester
- Testing utilities and extensions on Flutter's WidgetTester for Bloom applications.
- GoRouterHelper on BuildContext
- Dart extension to add navigation function to a BuildContext object, e.g. context.go('/');
-
TestBasicMessageChannelExtension
on BasicMessageChannel<
T> - Shim to support the obsolete setMockMessageHandler and checkMockMessageHandler methods on BasicMessageChannel in tests.
- TestBinaryMessengerExtension on BinaryMessenger
- Shim to support the obsolete setMockMessageHandler and checkMockMessageHandler methods on BinaryMessenger in tests.
- TestMethodChannelExtension on MethodChannel
- Shim to support the obsolete setMockMethodCallHandler and checkMockMethodCallHandler methods on MethodChannel in tests.
Constants
- androidTapTargetGuideline → const AccessibilityGuideline
- A guideline which requires tappable semantic nodes a minimum size of 48 by 48.
- anything → const Matcher
- A matcher that matches any value.
- canCaptureImage → const bool
- Whether or not captureImage is supported.
- clipsWithBoundingRect → const Matcher
- Asserts that a Finder locates a single object whose root RenderObject is a RenderClipRect with no clipper set, or an equivalent RenderClipPath.
- colorEpsilon → const double
- Default threshold for isSameColorAs and isSameColorSwatchAs.
- find → const CommonFinders
- Some frequently used Finders and SemanticsFinders.
- findsAny → const Matcher
- Asserts that the FinderBase locates at least one matching candidate.
- findsNothing → const Matcher
- Asserts that the FinderBase matches nothing in the available candidates.
- findsOne → const Matcher
- Asserts that the FinderBase finds exactly one matching candidate.
- findsOneWidget → const Matcher
- Asserts that the FinderBase locates at exactly one widget in the widget tree.
- findsWidgets → const Matcher
- Asserts that the FinderBase locates at least one widget in the widget tree.
- hasAGoodToStringDeep → const Matcher
- Asserts that an object's toStringDeep() is a plausible multiline description.
- hasNoImmediateClip → const Matcher
- Asserts that a Finder locates a single object whose root RenderObject is not a RenderClipRect, RenderClipRRect, RenderClipOval, or RenderClipPath.
- hasOneLineDescription → const Matcher
- Asserts that an object's toString() is a plausible one-line description.
- iOSTapTargetGuideline → const AccessibilityGuideline
- A guideline which requires tappable semantic nodes a minimum size of 44 by 44.
-
isArgumentError
→ const TypeMatcher<
ArgumentError> - A matcher for ArgumentError.
- isBrowser → const bool
- Whether the test is running in a web browser compiled to JavaScript or WebAssembly.
-
isCastError
→ const TypeMatcher<
TypeError> - A matcher for TypeError.
-
isConcurrentModificationError
→ const TypeMatcher<
ConcurrentModificationError> - A matcher for ConcurrentModificationError.
-
isCyclicInitializationError
→ const TypeMatcher<
Error> - A matcher for Error.
- isEmpty → const Matcher
- Returns a matcher that matches the isEmpty property.
-
isException
→ const TypeMatcher<
Exception> - A matcher for Exception.
- isFalse → const Matcher
- A matcher that matches anything except the Boolean value true.
-
isFormatException
→ const TypeMatcher<
FormatException> - A matcher for FormatException.
- isInCard → const Matcher
- Asserts that the Finder locates a single widget that has at least one Card widget ancestor.
-
isList
→ const TypeMatcher<
List> - A matcher for List.
-
isMap
→ const TypeMatcher<
Map> - A matcher for Map.
- isNaN → const Matcher
- A matcher that matches the numeric value NaN.
- isNegative → const Matcher
- A matcher which matches if the match argument is negative.
- isNonNegative → const Matcher
- A matcher which matches if the match argument is zero or positive.
- isNonPositive → const Matcher
- A matcher which matches if the match argument is zero or negative.
- isNonZero → const Matcher
- A matcher which matches if the match argument is non-zero.
-
isNoSuchMethodError
→ const TypeMatcher<
NoSuchMethodError> - A matcher for NoSuchMethodError.
- isNotEmpty → const Matcher
- Returns a matcher that matches the isNotEmpty property.
- isNotInCard → const Matcher
- Asserts that the Finder locates a single widget that has no Card widget ancestors.
- isNotNaN → const Matcher
- A matcher that matches any non-NaN value.
- isNotNull → const Matcher
- A matcher that matches any non-null value.
- isNull → const Matcher
- A matcher that matches any null value.
-
isNullThrownError
→ const TypeMatcher<
TypeError> - A matcher for TypeError.
- isOffstage → const Matcher
- Asserts that the Finder locates a single widget that has at least one Offstage widget ancestor.
- isOnstage → const Matcher
- Asserts that the Finder locates a single widget that has no Offstage widget ancestors.
- isPositive → const Matcher
- A matcher which matches if the match argument is positive.
-
isRangeError
→ const TypeMatcher<
RangeError> - A matcher for RangeError.
-
isStateError
→ const TypeMatcher<
StateError> - A matcher for StateError.
- isTrue → const Matcher
- A matcher that matches the Boolean value true.
-
isUnimplementedError
→ const TypeMatcher<
UnimplementedError> - A matcher for UnimplementedError.
-
isUnsupportedError
→ const TypeMatcher<
UnsupportedError> - A matcher for UnsupportedError.
- isZero → const Matcher
- A matcher which matches if the match argument is zero.
- kDebugWarning → const String
- The warning message to show when a benchmark is performed with assert on.
- kDragSlopDefault → const double
- The default drag touch slop used to break up a large drag into multiple smaller moves.
- labeledTapTargetGuideline → const AccessibilityGuideline
- A guideline which enforces that all nodes with a tap or long press action also have a label.
- returnsNormally → const Matcher
- A matcher that matches a function call against no exception.
- textContrastGuideline → const AccessibilityGuideline
- A guideline which requires text contrast to meet minimum values.
- throws → const Matcher
- This function is deprecated.
- throwsArgumentError → const Matcher
- A matcher for functions that throw ArgumentError.
- throwsConcurrentModificationError → const Matcher
- A matcher for functions that throw ConcurrentModificationError.
- throwsCyclicInitializationError → const Matcher
- A matcher for functions that throw CyclicInitializationError.
- throwsException → const Matcher
- A matcher for functions that throw Exception.
- throwsFormatException → const Matcher
- A matcher for functions that throw FormatException.
- throwsNoSuchMethodError → const Matcher
- A matcher for functions that throw NoSuchMethodError.
- throwsNullThrownError → const Matcher
- A matcher for functions that throw NullThrownError.
- throwsRangeError → const Matcher
- A matcher for functions that throw RangeError.
- throwsStateError → const Matcher
- A matcher for functions that throw StateError.
- throwsUnimplementedError → const Matcher
- A matcher for functions that throw Exception.
- throwsUnsupportedError → const Matcher
- A matcher for functions that throw UnsupportedError.
Properties
- autoUpdateGoldenFiles ↔ bool
-
Whether golden files should be automatically updated during tests rather
than compared to the image bytes recorded by the tests.
getter/setter pair
- completes → Matcher
-
Matches a Future that completes successfully with any value.
final
- doesNotComplete → Matcher
-
Matches a Future that does not complete.
final
- emitsDone → StreamMatcher
-
Returns a StreamMatcher that asserts that the stream emits a "done" event.
final
- globalContainer → BloomContainer
-
Accesses the global active Bloom DI container.
no setter
- goldenFileComparator ↔ GoldenFileComparator
-
Compares pixels against those of a golden image file.
getter/setter pair
-
isAssertionError
→ TypeMatcher<
AssertionError> -
A matcher for AssertionError.
final
-
isFlutterError
→ TypeMatcher<
FlutterError> -
A matcher for FlutterError.
final
- isLinux → bool
-
Whether the test is running on the Linux operating system.
no setter
- isMacOS → bool
-
Whether the test is running on the macOS operating system.
no setter
- isWindows → bool
-
Whether the test is running on the Windows operating system.
no setter
- kBuildBudget ↔ Duration
-
The maximum amount of time considered safe to spend for a frame's build
phase. Anything past that is in the danger of missing the frame as 60FPS.
getter/setter pair
- logger → BloomLogger
-
Global standard logger instance for Bloom framework and applications.
final
- neverCalled → Null Function([Object?, Object?, Object?, Object?, Object?, Object?, Object?, Object?, Object?, Object?])
-
Returns a function that causes the test to fail if it's called.
no setter
- paints → PaintPattern
-
Matches objects or functions that paint a display list that matches the
canvas calls described by the pattern.
no setter
- paintsAssertion → Matcher
-
Matches objects or functions that assert when they try to paint.
no setter
- paintsNothing → Matcher
-
Matches objects or functions that does not paint anything on the canvas.
no setter
- reportTestException ↔ TestExceptionReporter
-
A function that is called by the test framework when an unexpected error
occurred during a test.
getter/setter pair
- throwsAssertionError → Matcher
-
A matcher for functions that throw AssertionError.
final
- throwsFlutterError → Matcher
-
A matcher for functions that throw FlutterError.
final
Functions
-
addStateInfo(
Map matchState, Map values) → void - Useful utility for nesting match states.
-
addTearDown(
FutureOr callback()) → void - Registers a function to be run after the current test.
-
allOf(
Object? arg0, [Object? arg1, Object? arg2, Object? arg3, Object? arg4, Object? arg5, Object? arg6]) → Matcher - This returns a matcher that matches if all of the matchers passed as arguments (up to 7) match.
-
anyElement(
Object? valueOrMatcher) → Matcher -
Returns a matcher which matches Iterables in which at least one
element matches the given
valueOrMatcher. -
anyOf(
Object? arg0, [Object? arg1, Object? arg2, Object? arg3, Object? arg4, Object? arg5, Object? arg6]) → Matcher - Matches if any of the given matchers evaluate to true.
-
batch<
T> (T cb()) → T - Batches multiple signal updates into a single synchronous notification cycle.
-
benchmarkWidgets(
WidgetTesterCallback callback, {bool mayRunWithAsserts = false, bool semanticsEnabled = false}) → Future< void> -
Runs the
callbackinside the Flutter benchmark environment. -
bloomBackgroundCallbackDispatcher(
) → void - Top-level background callback dispatcher for native OS background execution.
-
captureImage(
Element element) → Future< Image> -
Render the closest RepaintBoundary of the
elementinto an image. -
clipsWithBoundingRRect(
{required BorderRadius borderRadius}) → Matcher -
Asserts that a Finder locates a single object whose root RenderObject
is a RenderClipRRect with no clipper set, and border radius equals to
borderRadius, or an equivalent RenderClipPath. -
clipsWithShapeBorder(
{required ShapeBorder shape}) → Matcher -
Asserts that a Finder locates a single object whose root RenderObject
is a RenderClipPath with a ShapeBorderClipper that clips to
shape. -
closeTo(
num value, num delta) → Matcher -
Returns a matcher which matches if the match argument is within
deltaof somevalue. -
collapseWhitespace(
String string) → String - Utility function to collapse whitespace runs to single spaces and strip leading/trailing whitespace.
-
collectAllElementsFrom(
Element rootElement, {required bool skipOffstage}) → Iterable< Element> - Provides an iterable that efficiently returns all the Elements rooted at the given Element. See CachingIterable for details.
-
collectAllSemanticsNodesFrom(
SemanticsNode root, {DebugSemanticsDumpOrder order = DebugSemanticsDumpOrder.traversalOrder}) → Iterable< SemanticsNode> - Provides an iterable that efficiently returns all the SemanticsNodes rooted at the given SemanticsNode. See CachingIterable for details.
-
compareLists(
List< int> ? test, List<int> ? master) → Future<ComparisonResult> -
Returns a ComparisonResult to describe the pixel differential of the
testandmasterimage bytes provided. -
completion(
Object? matcher, [String? description]) → Matcher -
Matches a Future that completes successfully with a value that matches
matcher. -
computed<
T> (T compute(), {String? debugLabel}) → Computed< T> - Creates a computed (derived) reactive value.
-
contains(
Object? expected) → Matcher - Returns a matcher that matches if the match argument contains the expected value.
-
containsAll(
Iterable expected) → Matcher -
Matches Iterables which contain an element matching every value in
expectedin any order, and may contain additional values. -
containsAllInOrder(
Iterable expected) → Matcher -
Matches Iterables which contain an element matching every value in
expectedin the same order, but may contain additional values interleaved throughout. -
containsOnce(
Object? expected) → Matcher - Matches Iterables where exactly one element matches the expected value, and all other elements don't match.
-
containsPair(
Object? key, Object? valueOrMatcher) → Matcher -
Returns a matcher which matches maps containing the key-value pair
with
key=>valueOrMatcher. -
containsSemantics(
{String? identifier, String? traversalParentIdentifier, String? traversalChildIdentifier, String? label, AttributedString? attributedLabel, String? hint, AttributedString? attributedHint, String? value, AttributedString? attributedValue, String? increasedValue, AttributedString? attributedIncreasedValue, String? decreasedValue, AttributedString? attributedDecreasedValue, String? tooltip, TextDirection? textDirection, Rect? rect, Size? size, double? elevation, double? thickness, int? platformViewId, int? maxValueLength, int? currentValueLength, SemanticsValidationResult? validationResult, SemanticsInputType? inputType, String? maxValue, String? minValue, bool? hasCheckedState, bool? isChecked, bool? isCheckStateMixed, bool? isSelected, bool? hasSelectedState, bool? isButton, bool? isSlider, bool? isKeyboardKey, bool? isLink, bool? isFocused, bool? isFocusable, bool? isTextField, bool? isReadOnly, bool? hasEnabledState, bool? isEnabled, bool? isInMutuallyExclusiveGroup, bool? isHeader, bool? isObscured, bool? isMultiline, bool? namesRoute, bool? scopesRoute, bool? isHidden, bool? isImage, bool? isLiveRegion, bool? hasToggledState, bool? isToggled, bool? hasImplicitScrolling, bool? hasExpandedState, bool? isExpanded, bool? hasRequiredState, bool? isRequired, bool? hasTapAction, bool? hasFocusAction, bool? hasLongPressAction, bool? hasScrollLeftAction, bool? hasScrollRightAction, bool? hasScrollUpAction, bool? hasScrollDownAction, bool? hasIncreaseAction, bool? hasDecreaseAction, bool? hasShowOnScreenAction, bool? hasMoveCursorForwardByCharacterAction, bool? hasMoveCursorBackwardByCharacterAction, bool? hasMoveCursorForwardByWordAction, bool? hasMoveCursorBackwardByWordAction, bool? hasSetTextAction, bool? hasSetSelectionAction, bool? hasCopyAction, bool? hasCutAction, bool? hasPasteAction, bool? hasDidGainAccessibilityFocusAction, bool? hasDidLoseAccessibilityFocusAction, bool? hasDismissAction, String? onTapHint, String? onLongPressHint, List< CustomSemanticsAction> ? customActions, List<Matcher> ? children}) → Matcher - Asserts that a SemanticsNode contains the specified information.
-
containsValue(
Object? value) → Matcher -
Returns a matcher which matches maps containing the given
value. -
coversSameAreaAs(
Path expectedPath, {required Rect areaToCompare, int sampleSize = 20}) → Matcher - Asserts that 2 paths cover the same area by sampling multiple points.
-
createTestImage(
{int width = 1, int height = 1, bool cache = true}) → Future< Image> - Creates an arbitrarily sized image for testing.
-
doesNotMeetGuideline(
AccessibilityGuideline guideline) → AsyncMatcher - The inverse matcher of meetsGuideline.
-
effect(
void cb(), {String? debugLabel}) → void Function() -
Runs a reactive side-effect callback
cbwhenever any accessed signal changes. -
emits(
Object? matcher) → StreamMatcher -
Returns a StreamMatcher for
matcher. -
emitsAnyOf(
Iterable matchers) → StreamMatcher -
Returns a StreamMatcher that matches the stream if at least one of
matchersmatches. -
emitsError(
Object? matcher) → StreamMatcher -
Returns a StreamMatcher that matches a single error event that matches
matcher. -
emitsInAnyOrder(
Iterable matchers) → StreamMatcher -
Returns a StreamMatcher that matches the stream if each matcher in
matchersmatches, in any order. -
emitsInOrder(
Iterable matchers) → StreamMatcher -
Returns a StreamMatcher that matches the stream if each matcher in
matchersmatches, one after another. -
emitsThrough(
Object? matcher) → StreamMatcher -
Returns a StreamMatcher that matches any number of events followed by
events that match
matcher. -
endsWith(
String suffixString) → Matcher -
Returns a matcher that matches if the match argument is a string and
ends with
suffixString. -
equals(
Object? expected, [int limit = 100]) → Matcher -
Returns a matcher that matches if the value is structurally equal to
expected. -
equalsIgnoringCase(
String value) → Matcher -
Returns a matcher which matches if the match argument is a string and
is equal to
valuewhen compared case-insensitively. -
equalsIgnoringHashCodes(
Object value) → Matcher -
Asserts that two Strings or
Iterable<String>s are equal after normalizing likely hash codes. -
equalsIgnoringWhitespace(
String value) → Matcher -
Returns a matcher which matches if the match argument is a string and
is equal to
value, ignoring whitespace. -
escape(
String str) → String -
Returns
strwith all whitespace characters represented as their escape sequences. -
everyElement(
Object? valueOrMatcher) → Matcher -
Returns a matcher which matches Iterables in which all elements
match the given
valueOrMatcher. -
expect(
dynamic actual, dynamic matcher, {String? reason, dynamic skip}) → void -
Assert that
actualmatchesmatcher. -
expectAsync(
Function callback, {int count = 1, int max = 0, String? id, String? reason}) → Function - This function is deprecated because it doesn't work well with strong mode. Use expectAsync0, expectAsync1, expectAsync2, expectAsync3, expectAsync4, expectAsync5, or expectAsync6 instead.
-
expectAsync0<
T> (T callback(), {int count = 1, int max = 0, String? id, String? reason}) → Func0< T> -
Informs the framework that the given
callbackof arity 0 is expected to be calledcountnumber of times (by default 1). -
expectAsync1<
T, A> (T callback(A), {int count = 1, int max = 0, String? id, String? reason}) → Func1< T, A> -
Informs the framework that the given
callbackof arity 1 is expected to be calledcountnumber of times (by default 1). -
expectAsync2<
T, A, B> (T callback(A, B), {int count = 1, int max = 0, String? id, String? reason}) → Func2< T, A, B> -
Informs the framework that the given
callbackof arity 2 is expected to be calledcountnumber of times (by default 1). -
expectAsync3<
T, A, B, C> (T callback(A, B, C), {int count = 1, int max = 0, String? id, String? reason}) → Func3< T, A, B, C> -
Informs the framework that the given
callbackof arity 3 is expected to be calledcountnumber of times (by default 1). -
expectAsync4<
T, A, B, C, D> (T callback(A, B, C, D), {int count = 1, int max = 0, String? id, String? reason}) → Func4< T, A, B, C, D> -
Informs the framework that the given
callbackof arity 4 is expected to be calledcountnumber of times (by default 1). -
expectAsync5<
T, A, B, C, D, E> (T callback(A, B, C, D, E), {int count = 1, int max = 0, String? id, String? reason}) → Func5< T, A, B, C, D, E> -
Informs the framework that the given
callbackof arity 5 is expected to be calledcountnumber of times (by default 1). -
expectAsync6<
T, A, B, C, D, E, F> (T callback(A, B, C, D, E, F), {int count = 1, int max = 0, String? id, String? reason}) → Func6< T, A, B, C, D, E, F> -
Informs the framework that the given
callbackof arity 6 is expected to be calledcountnumber of times (by default 1). -
expectAsyncUntil0<
T> (T callback(), bool isDone(), {String? id, String? reason}) → Func0< T> -
Informs the framework that the given
callbackof arity 0 is expected to be called untilisDonereturns true. -
expectAsyncUntil1<
T, A> (T callback(A), bool isDone(), {String? id, String? reason}) → Func1< T, A> -
Informs the framework that the given
callbackof arity 1 is expected to be called untilisDonereturns true. -
expectAsyncUntil2<
T, A, B> (T callback(A, B), bool isDone(), {String? id, String? reason}) → Func2< T, A, B> -
Informs the framework that the given
callbackof arity 2 is expected to be called untilisDonereturns true. -
expectAsyncUntil3<
T, A, B, C> (T callback(A, B, C), bool isDone(), {String? id, String? reason}) → Func3< T, A, B, C> -
Informs the framework that the given
callbackof arity 3 is expected to be called untilisDonereturns true. -
expectAsyncUntil4<
T, A, B, C, D> (T callback(A, B, C, D), bool isDone(), {String? id, String? reason}) → Func4< T, A, B, C, D> -
Informs the framework that the given
callbackof arity 4 is expected to be called untilisDonereturns true. -
expectAsyncUntil5<
T, A, B, C, D, E> (T callback(A, B, C, D, E), bool isDone(), {String? id, String? reason}) → Func5< T, A, B, C, D, E> -
Informs the framework that the given
callbackof arity 5 is expected to be called untilisDonereturns true. -
expectAsyncUntil6<
T, A, B, C, D, E, F> (T callback(A, B, C, D, E, F), bool isDone(), {String? id, String? reason}) → Func6< T, A, B, C, D, E, F> -
Informs the framework that the given
callbackof arity 6 is expected to be called untilisDonereturns true. -
expectLater(
dynamic actual, dynamic matcher, {String? reason, dynamic skip}) → Future< void> - Just like expect, but returns a Future that completes when the matcher has finished matching.
-
expectSync(
dynamic actual, dynamic matcher, {String? reason}) → void -
Assert that
actualmatchesmatcher. -
fail(
String message) → Never -
Convenience method for throwing a new TestFailure with the provided
message. -
findsAtLeast(
int n) → Matcher - Asserts that the FinderBase locates at least the given number of candidates.
-
findsAtLeastNWidgets(
int n) → Matcher - Asserts that the FinderBase locates at least a number of widgets in the widget tree.
-
findsExactly(
int n) → Matcher - Asserts that the FinderBase locates the specified number of candidates.
-
findsNWidgets(
int n) → Matcher - Asserts that the FinderBase locates the specified number of widgets in the widget tree.
-
greaterThan(
Object value) → Matcher -
Returns a matcher which matches if the match argument is greater
than the given
value. -
greaterThanOrEqualTo(
Object value) → Matcher -
Returns a matcher which matches if the match argument is greater
than or equal to the given
value. -
group(
Object description, void body(), {dynamic skip, int? retry}) → void - Creates a group of tests.
-
hasLength(
Object? matcher) → Matcher -
Returns a matcher that matches if an object has a length property
that matches
matcher. -
inClosedOpenRange(
num low, num high) → Matcher -
Returns a matcher which matches if the match argument is greater
than or equal to a
lowand less thanhigh. -
inExclusiveRange(
num low, num high) → Matcher -
Returns a matcher which matches if the match argument is greater
than
lowand less thanhigh. -
inInclusiveRange(
num low, num high) → Matcher -
Returns a matcher which matches if the match argument is greater
than or equal to
lowand less than or equal tohigh. -
inject<
T> () → T -
Resolves a dependency of type
Tfrom the global active Bloom container. -
injectOrNull<
T> () → T? -
Resolves an optional dependency of type
Tfrom the global active Bloom container, or returnsnullif not registered. -
inOpenClosedRange(
num low, num high) → Matcher -
Returns a matcher which matches if the match argument is greater
than
lowand less than or equal tohigh. -
isA<
T> () → TypeMatcher< T> -
Returns a matcher that matches objects with type
T. -
isAccessibilityAnnouncement(
String message, {TextDirection? textDirection, Assertiveness? assertiveness, int? viewId}) → Matcher - Asserts that a CapturedAccessibilityAnnouncement matches the expected message.
-
isIn(
Object? expected) → Matcher - Returns a matcher that matches if the match argument is in the expected value. This is the converse of contains.
-
isInstanceOf<
T> () → TypeMatcher< T> - A matcher that compares the type of the actual value to the type argument T.
-
isMethodCall(
String name, {required dynamic arguments}) → Matcher -
A matcher for MethodCalls, asserting that it has the specified
method
nameandarguments. -
isNot(
Object? valueOrMatcher) → Matcher -
Returns a matcher that inverts
valueOrMatcherto its logical negation. -
isPathThat(
{Iterable< Offset> includes = const <Offset>[], Iterable<Offset> excludes = const <Offset>[]}) → Matcher -
Matches a Path that contains (as defined by Path.contains) the given
includespoints and does not contain the givenexcludespoints. -
isRenderObjectAncestorOfTarget(
RenderObject renderObject, HitTestTarget target) → bool -
Returns true if
renderObjectis equal totargetor is an ancestor oftargetin the render tree. -
isSameColorAs(
Color color, {double threshold = colorEpsilon}) → Matcher -
Asserts that the object represents the same color as
colorwhen used to paint. -
isSameColorSwatchAs<
T> (ColorSwatch< T> color, {double threshold = colorEpsilon}) → Matcher -
Asserts that the object represents the same color swatch as
colorwhen used to paint. -
isSemantics(
{String? identifier, String? traversalParentIdentifier, String? traversalChildIdentifier, String? label, AttributedString? attributedLabel, String? hint, AttributedString? attributedHint, String? value, AttributedString? attributedValue, String? increasedValue, AttributedString? attributedIncreasedValue, String? decreasedValue, AttributedString? attributedDecreasedValue, String? tooltip, TextDirection? textDirection, Rect? rect, Size? size, double? elevation, double? thickness, int? platformViewId, int? maxValueLength, int? currentValueLength, SemanticsValidationResult? validationResult, SemanticsInputType? inputType, String? maxValue, String? minValue, SemanticsRole? role, bool? hasCheckedState, bool? isChecked, bool? isCheckStateMixed, bool? isSelected, bool? hasSelectedState, bool? isButton, bool? isSlider, bool? isKeyboardKey, bool? isLink, bool? isFocused, bool? isFocusable, bool? isTextField, bool? isReadOnly, bool? hasEnabledState, bool? isEnabled, bool? isInMutuallyExclusiveGroup, bool? isHeader, bool? isObscured, bool? isMultiline, bool? namesRoute, bool? scopesRoute, bool? isHidden, bool? isImage, bool? isLiveRegion, bool? hasToggledState, bool? isToggled, bool? hasImplicitScrolling, bool? hasExpandedState, bool? isExpanded, bool? hasRequiredState, bool? isRequired, bool? hasTapAction, bool? hasFocusAction, bool? hasLongPressAction, bool? hasScrollLeftAction, bool? hasScrollRightAction, bool? hasScrollUpAction, bool? hasScrollDownAction, bool? hasIncreaseAction, bool? hasDecreaseAction, bool? hasShowOnScreenAction, bool? hasMoveCursorForwardByCharacterAction, bool? hasMoveCursorBackwardByCharacterAction, bool? hasMoveCursorForwardByWordAction, bool? hasMoveCursorBackwardByWordAction, bool? hasSetTextAction, bool? hasSetSelectionAction, bool? hasCopyAction, bool? hasCutAction, bool? hasPasteAction, bool? hasDidGainAccessibilityFocusAction, bool? hasDidLoseAccessibilityFocusAction, bool? hasDismissAction, String? onTapHint, String? onLongPressHint, List< CustomSemanticsAction> ? customActions, List<Matcher> ? children}) → Matcher - Asserts that a SemanticsNode contains the specified information.
-
isSorted<
T extends Comparable< (T> >) → Matcher - Matches Iterables which are sorted.
-
isSortedBy<
T, K extends Comparable< (K> >K keyOf(T)) → Matcher -
Matches Iterables which are sorted by the
keyOfproperty. -
isSortedByCompare<
T, K> (K keyOf(T), Comparator< K> compare) → Matcher -
Matches Iterables which are
compare-sorted by theirkeyOfproperty. -
isSortedUsing<
T> (Comparator< T> compare) → Matcher -
Matches Iterables which are
compare-sorted. -
isSystemTextScaler(
{double? withScaleFactor}) → Matcher - Asserts that the object is a TextScaler that reflects the user's font scale preferences from the platform's accessibility settings.
-
lessThan(
Object value) → Matcher -
Returns a matcher which matches if the match argument is less
than the given
value. -
lessThanOrEqualTo(
Object value) → Matcher -
Returns a matcher which matches if the match argument is less
than or equal to the given
value. -
markTestSkipped(
String message) → void - Marks the current test as skipped.
-
matches(
Pattern re) → Matcher -
Returns a matcher that matches if the match argument is a string and
matches the regular expression given by
re. -
matchesGoldenFile(
Object key, {int? version}) → AsyncMatcher -
Asserts that a Finder, Future<ui.Image>, or ui.Image matches the
golden image file identified by
key, with an optionalversionnumber. -
matchesReferenceImage(
Image image) → AsyncMatcher -
Asserts that a Finder, Future<ui.Image>, or ui.Image matches a
reference image identified by
image. -
matchesSemantics(
{String? identifier, String? traversalParentIdentifier, String? traversalChildIdentifier, String? label, AttributedString? attributedLabel, String? hint, AttributedString? attributedHint, String? value, AttributedString? attributedValue, String? increasedValue, AttributedString? attributedIncreasedValue, String? decreasedValue, AttributedString? attributedDecreasedValue, String? tooltip, TextDirection? textDirection, Rect? rect, Size? size, double? elevation, double? thickness, int? platformViewId, int? maxValueLength, int? currentValueLength, SemanticsValidationResult validationResult = SemanticsValidationResult.none, SemanticsInputType? inputType, String? maxValue, String? minValue, SemanticsRole? role, bool hasCheckedState = false, bool isChecked = false, bool isCheckStateMixed = false, bool isSelected = false, bool hasSelectedState = false, bool isButton = false, bool isSlider = false, bool isKeyboardKey = false, bool isLink = false, bool isFocused = false, bool isFocusable = false, bool isTextField = false, bool isReadOnly = false, bool hasEnabledState = false, bool isEnabled = false, bool isInMutuallyExclusiveGroup = false, bool isHeader = false, bool isObscured = false, bool isMultiline = false, bool namesRoute = false, bool scopesRoute = false, bool isHidden = false, bool isImage = false, bool isLiveRegion = false, bool hasToggledState = false, bool isToggled = false, bool hasImplicitScrolling = false, bool hasExpandedState = false, bool isExpanded = false, bool hasRequiredState = false, bool isRequired = false, bool hasTapAction = false, bool hasFocusAction = false, bool hasLongPressAction = false, bool hasScrollLeftAction = false, bool hasScrollRightAction = false, bool hasScrollUpAction = false, bool hasScrollDownAction = false, bool hasIncreaseAction = false, bool hasDecreaseAction = false, bool hasShowOnScreenAction = false, bool hasMoveCursorForwardByCharacterAction = false, bool hasMoveCursorBackwardByCharacterAction = false, bool hasMoveCursorForwardByWordAction = false, bool hasMoveCursorBackwardByWordAction = false, bool hasSetTextAction = false, bool hasSetSelectionAction = false, bool hasCopyAction = false, bool hasCutAction = false, bool hasPasteAction = false, bool hasDidGainAccessibilityFocusAction = false, bool hasDidLoseAccessibilityFocusAction = false, bool hasDismissAction = false, String? onTapHint, String? onLongPressHint, List< CustomSemanticsAction> ? customActions, List<Matcher> ? children}) → Matcher - Asserts that a SemanticsNode contains the specified information.
-
matrix3MoreOrLessEquals(
Matrix3 value, {double epsilon = precisionErrorTolerance}) → Matcher -
Asserts that two
Matrix3s are equal, within some tolerated error. -
matrixMoreOrLessEquals(
Matrix4 value, {double epsilon = precisionErrorTolerance}) → Matcher - Asserts that two Matrix4s are equal, within some tolerated error.
-
mayEmit(
Object? matcher) → StreamMatcher -
Returns a StreamMatcher that allows (but doesn't require)
matcherto match the stream. -
mayEmitMultiple(
Object? matcher) → StreamMatcher -
Returns a StreamMatcher that matches any number of events that match
matcher. -
meetsGuideline(
AccessibilityGuideline guideline) → AsyncMatcher -
Asserts that the currently rendered widget meets the provided accessibility
guideline. -
moreOrLessEquals(
double value, {double epsilon = precisionErrorTolerance}) → Matcher - Asserts that two doubles are equal, within some tolerated error.
-
mutation<
T, P> ({required MutationFn< T, P> mutate, List? optimisticKey, OptimisticUpdater<T, P> ? optimisticData, List<List> invalidateKeys = const [], OnMutateCallback<P> ? onMutate, OnSuccessCallback<T, P> ? onSuccess, OnErrorCallback<P> ? onError, OnSettledCallback<T, P> ? onSettled}) → BloomMutation<T, P> - Creates a declarative mutation with optional automated optimistic rollback and cache invalidation.
-
neverEmits(
Object? matcher) → StreamMatcher -
Returns a StreamMatcher that matches a stream that never matches
matcher. -
nonconst<
T> (T t) → T - This function can be used to call a const constructor in such a way as to create a new instance rather than creating the common const instance.
-
offsetMoreOrLessEquals(
Offset value, {double epsilon = precisionErrorTolerance}) → Matcher - Asserts that two Offsets are equal, within some tolerated error.
-
orderedEquals(
Iterable expected) → Matcher -
Returns a matcher which matches Iterables that have the same
length and the same elements as
expected, in the same order. -
paintsExactlyCountTimes(
Symbol methodName, int count) → Matcher -
Matches objects or functions that draw
methodNameexactlycountnumber of times. -
pairwiseCompare<
S, T> (Iterable< S> expected, bool comparator(S, T), String description) → Matcher - A pairwise matcher for Iterables.
-
predicate<
T> (bool f(T), [String description = 'satisfies function']) → Matcher - Returns a matcher that uses an arbitrary function that returns whether the value is considered a match.
-
printOnFailure(
String message) → void -
Prints
messageif and when the current test fails. -
prints(
Object? matcher) → Matcher -
Matches a Function that prints text that matches
matcher. -
provide<
T> (FactoryFunc< T> factory) → void -
Registers a transient
factoryon the global active Bloom container. -
provideSingleton<
T> (FactoryFunc< T> factory, {bool lazy = true}) → void -
Registers a singleton
factoryon the global active Bloom container. -
provideValue<
T> (T value) → void -
Registers an existing instance
valueon the global active Bloom container. -
pumpEventQueue(
{int times = 20}) → Future -
Returns a Future that completes after the event loop has run the given
number of
times(20 by default). -
query<
T> ({required List key, required QueryFetcher< T> fetch, Duration staleTime = const Duration(minutes: 5), Duration cacheTime = const Duration(minutes: 30), bool enabled = true, int retry = 2, Duration retryDelay = const Duration(milliseconds: 500)}) → BloomQuery<T> - Creates a declarative, cached asynchronous query.
-
readonly<
T> (Signal< T> signal) → ReadonlySignal<T> -
Creates a read-only view of a
signal. -
rectMoreOrLessEquals(
Rect value, {double epsilon = precisionErrorTolerance}) → Matcher - Asserts that two Rects are equal, within some tolerated error.
-
registerException(
Object error, [StackTrace stackTrace = StackTrace.empty]) → void - Registers an exception that was caught for the current test.
-
rendersOnPhysicalModel(
{BoxShape? shape, BorderRadius? borderRadius, double? elevation}) → Matcher - Asserts that a Finder locates a single object whose root RenderObject is a RenderPhysicalModel or a RenderPhysicalShape.
-
rendersOnPhysicalShape(
{required ShapeBorder shape, double? elevation}) → Matcher -
Asserts that a Finder locates a single object whose root RenderObject
is RenderPhysicalShape that uses a ShapeBorderClipper that clips to
shapeas its clipper. Ifelevationis non null asserts thatRenderPhysicalShape.elevationis equal toelevation. -
reportExpectCall(
StackTrace stack, List< DiagnosticsNode> information) → int -
Report call site for
expect()call. Returns the number of frames that should be elided if a stack were to be modified to hide the expect call, or zero if no such call was found. -
resetActiveContainer(
) → void - Resets the global active container to a fresh, empty BloomContainer instance.
-
same(
Object? expected) → Matcher -
Returns a matches that matches if the value is the same instance
as
expected, using identical. -
setActiveContainer(
BloomContainer container) → void - Sets the currently active global container (used by BloomTestScope for test isolation).
-
setUp(
dynamic body()) → void - Registers a function to be run before tests.
-
setUpAll(
dynamic body()) → void - Registers a function to be run once before all tests.
-
signal<
T> (T initialValue, {String? debugLabel}) → Signal< T> -
Creates a fine-grained reactive state signal with an
initialValue. -
simulateKeyDownEvent(
LogicalKeyboardKey key, {String? platform, PhysicalKeyboardKey? physicalKey, String? character}) → Future< bool> - Simulates sending a hardware key down event through the system channel.
-
simulateKeyRepeatEvent(
LogicalKeyboardKey key, {String? platform, PhysicalKeyboardKey? physicalKey, String? character}) → Future< bool> - Simulates sending a hardware key repeat event through the system channel.
-
simulateKeyUpEvent(
LogicalKeyboardKey key, {String? platform, PhysicalKeyboardKey? physicalKey}) → Future< bool> - Simulates sending a hardware key up event through the system channel.
-
spawnHybridCode(
String dartCode, {Object? message, bool stayAlive = false}) → StreamChannel -
Spawns a VM isolate that runs the given
dartCode, which is loaded as the contents of a Dart library. -
spawnHybridUri(
Object uri, {Object? message, bool stayAlive = false}) → StreamChannel -
Spawns a VM isolate for the given
uri, which may be a Uri or a String. -
startsWith(
String prefixString) → Matcher -
Returns a matcher that matches if the match argument is a string and
starts with
prefixString. -
stringContainsInOrder(
List< String> substrings) → Matcher -
Returns a matcher that matches if the match argument is a string and
contains a given list of
substringsin relative order. -
tearDown(
dynamic body()) → void - Registers a function to be run after tests.
-
tearDownAll(
dynamic body()) → void - Registers a function to be run once after all tests.
-
test(
Object description, dynamic body(), {String? testOn, Timeout? timeout, dynamic skip, dynamic tags, Map< String, dynamic> ? onPlatform, int? retry}) → void - Creates a new test case with the given description (converted to a string) and body.
-
testWidgets(
String description, WidgetTesterCallback callback, {bool? skip, Timeout? timeout, bool semanticsEnabled = true, TestVariant< Object?> variant = const DefaultTestVariant(), dynamic tags, int? retry, LeakTesting? experimentalLeakTesting}) → void -
Runs the
callbackinside the Flutter test environment. -
throwsA(
Object? matcher) → Matcher - This can be used to match three kinds of objects:
-
unorderedEquals(
Iterable expected) → Matcher -
Returns a matcher which matches Iterables that have the same length and
the same elements as
expected, but not necessarily in the same order. -
unorderedMatches(
Iterable expected) → Matcher -
Returns a matcher which matches Iterables whose elements match the
matchers in
expected, but not necessarily in the same order. -
within<
T> ({required num distance, required T from, DistanceFunction< T> ? distanceFunction}) → Matcher - Asserts that two values are within a certain distance from each other.
-
wrapMatcher(
Object? valueOrMatcher) → Matcher - Takes an argument and returns an equivalent Matcher.
Typedefs
-
AllMessagesHandler
= Future<
ByteData?> ? Function(String channel, MessageHandler? handler, ByteData? message) - A function which takes the name of the method channel, it's handler, platform message and asynchronously returns an encoded response.
- AnyDistanceFunction = num Function(Never a, Never b)
- The type of a union of instances of DistanceFunction<T> for various types T.
-
BackgroundTaskCallback
= FutureOr<
bool> Function(Map<String, dynamic> data) - Callback signature for asynchronous background task execution.
- BeforeSendCallback = BloomTelemetryEvent? Function(BloomTelemetryEvent event)
- Callback signature for intercepting, modifying, or dropping telemetry events before transmission.
- BloomDiscoveryListener = BloomDevServerDiscovery
- Alias for backwards compatibility with Bloom Go discovery listener.
- BloomLogWriter = void Function(String message)
- Callback signature for handling formatted log line outputs.
-
BloomNextFunction
= Future<
BloomResponse> Function() - Next-handler callback invoked by middleware to pass control to the subsequent middleware or route handler in the pipeline.
-
BloomRouteHandler
= FutureOr<
BloomResponse> Function(BloomRequest request) - Handler function signature for Bloom server route endpoints.
-
CustomConflictResolver
= FutureOr<
Map< Function(Map<String, dynamic> ?>String, dynamic> clientPayload, Object serverError) - Custom conflict resolution handler resolving differences between client payload and server error.
-
DeepLinkHandler
= FutureOr<
void> Function(Uri uri) - Handler callback signature invoked when a deep link URI is received.
- DescribeMatchCallback = String Function(Plurality plurality)
- Signature for FinderBase.describeMatch.
-
DistanceFunction<
T> = num Function(T a, T b) - Computes the distance between two values.
- ElementPredicate = bool Function(Element element)
- Signature for CommonFinders.byElementPredicate.
- ErrorFormatter = String Function(Object? actual, Matcher matcher, String? reason, Map matchState, bool verbose)
-
The type used for functions that can be used to build up error reports
upon failures in
expect. -
EventDispatcher
= Future<
void> Function(PointerEvent event) - Signature for a callback that can dispatch events and returns a future that completes when the event dispatch is complete.
-
FactoryFunc<
T> = T Function() -
Factory function callback that instantiates a dependency of type
T. -
Func0<
T> = T Function() -
Func1<
T, A> = T Function([A a]) -
Func2<
T, A, B> = T Function([A a, B b]) -
Func3<
T, A, B, C> = T Function([A a, B b, C c]) -
Func4<
T, A, B, C, D> = T Function([A a, B b, C c, D d]) -
Func5<
T, A, B, C, D, E> = T Function([A a, B b, C c, D d, E e]) -
Func6<
T, A, B, C, D, E, F> = T Function([A a, B b, C c, D d, E e, F f]) - HitTester = HitTestResult Function(Offset location)
- Signature for callbacks that perform hit-testing at a given location.
- MockStreamHandlerOnCancelCallback = void Function(Object? arguments)
- Typedef for the inline onCancel callback.
- MockStreamHandlerOnListenCallback = void Function(Object? arguments, MockStreamHandlerEventSink events)
- Typedef for the inline onListen callback.
-
MutationExecutor
= Future Function(Map<
String, dynamic> payload) - Execution function that sends an offline mutation payload to the server.
-
MutationFn<
T, P> = Future< T> Function(P params) - The asynchronous execution function that performs the mutation operation.
-
OnErrorCallback<
P> = FutureOr< void> Function(Object error, P params, dynamic context) - Hook called when a mutation throws an error.
-
OnMutateCallback<
P> = FutureOr Function(P params) - Hook called immediately prior to executing the mutation, returning an optional context object.
-
OnSettledCallback<
T, P> = FutureOr< void> Function(T? data, Object? error, P params, dynamic context) - Hook called after mutation settled (either succeeded or failed).
-
OnSuccessCallback<
T, P> = FutureOr< void> Function(T data, P params, dynamic context) - Hook called upon successful mutation completion.
-
OptimisticUpdater<
T, P> = T? Function(P params, T? oldData) - Optimistic update transformation function updating cached data prior to network response.
- PaintPatternPredicate = bool Function(Symbol methodName, List arguments)
- Signature for the PaintPattern.something and PaintPattern.everything predicate argument.
-
QueryFetcher<
T> = Future< T> Function() - Asynchronous data fetcher function for a query.
-
RequestInterceptor
= FutureOr<
BaseRequest> Function(BaseRequest request) -
Interceptor callback that transforms an outgoing
http.BaseRequestbefore sending. -
ResponseInterceptor
= FutureOr<
Response> Function(Response response) -
Interceptor callback that transforms an incoming
http.Responsebefore returning to callers. - SemanticsNodePredicate = bool Function(SemanticsNode node)
- Signature for CommonSemanticsFinders.byPredicate.
- TestExceptionReporter = void Function(FlutterErrorDetails details, String testDescription)
- Signature for the reportTestException callback.
- WidgetPredicate = bool Function(Widget widget)
- Signature for CommonFinders.byWidgetPredicate.
-
WidgetTesterCallback
= Future<
void> Function(WidgetTester tester) - Signature for callback to testWidgets and benchmarkWidgets.
Exceptions / Errors
- BloomEnvironmentException
- Exception thrown when environment schema validation fails or a required variable is missing/invalid.
- BloomHttpException
- Exception thrown when telemetry transmission over HTTP fails.
- BloomNativeConfigurationException
-
Thrown when a native module encounters invalid configuration or missing keys in
bloom.yamlor module manifests. - BloomNativeException
- Base exception for errors originating across the Bloom Native Module boundary.
- Thrown when a hardware sensor, camera, or peripheral device is busy, absent, or disabled.
- BloomNativeOperationFailedException
- Thrown when an internal native SDK operation or bridge promise rejected on the host platform.
- BloomNativePermissionDeniedException
- Thrown when a required native OS permission was denied, restricted, or permanently blocked.
- BloomOfflineException
- Exception thrown when a simulated offline network call is executed.
- TestFailure
- An exception thrown when a test assertion fails.