FakeFloatyPlatform class

A fake FloatyChatheadsPlatform for unit tests that records every call and lets you control return values:

final fake = FakeFloatyPlatform();
FloatyChatheadsPlatform.instance = fake;
await FloatyChatheads.showChatHead(entryPoint: 'test');
expect(fake.lastConfig?.entryPoint, 'test');

Subclass it to override individual calls, for example to throw.

Inheritance
  • Object
  • PlatformInterface
  • FakeFloatyPlatform

Constructors

FakeFloatyPlatform()
Creates a fake with permission granted and no active chathead.

Properties

active ↔ bool
Controls the return value of isActive.
getter/setter pairinherited
checkPermissionCalled ↔ bool
Whether checkPermission was called.
getter/setter pairinherited
closeChatHeadCalled ↔ bool
Whether closeChatHead was called.
getter/setter pairinherited
hashCode → int
The hash code for this object.
no setterinherited
lastAddConfig ↔ AddChatHeadConfig?
The last AddChatHeadConfig passed to addChatHead.
getter/setter pairinherited
lastBadgeCount ↔ int?
The last badge count passed to updateBadge.
getter/setter pairinherited
lastConfig ↔ ChatHeadConfig?
The last ChatHeadConfig passed to showChatHead.
getter/setter pairinherited
lastIconBytes ↔ Uint8List?
The last RGBA bytes passed to updateChatHeadIcon.
getter/setter pairinherited
lastIconId ↔ String?
The last chathead ID passed to updateChatHeadIcon.
getter/setter pairinherited
lastRemovedId ↔ String?
The last ID passed to removeChatHead.
getter/setter pairinherited
permissionGranted ↔ bool
Controls the return value of checkPermission.
getter/setter pairinherited
requestPermissionCalled ↔ bool
Whether requestPermission was called.
getter/setter pairinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showChatHeadCalled ↔ bool
Whether showChatHead was called.
getter/setter pairinherited
supportsNativeIcons → bool
Whether the native bubble draws icons sent from Dart.
no setterinherited

Methods

addChatHead(AddChatHeadConfig config) → Future<void>
Adds a new chathead bubble to the existing group.
checkPermission() → Future<bool>
Checks whether overlay permission is granted.
closeChatHead() → Future<void>
Closes the chathead and stops the overlay service.
closeOverlay() → Future<void>
Closes the overlay from inside the overlay isolate.
inherited
collapseChatHead() → Future<void>
Programmatically collapses the chathead content panel.
expandChatHead() → Future<void>
Programmatically expands the chathead to show its content panel.
getOverlayPosition() → Future<OverlayPosition>
Gets the current overlay position as an OverlayPosition.
inherited
isActive() → Future<bool>
Whether the chathead overlay is currently active.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeChatHead(String id) → Future<void>
Removes a chathead bubble by its id.
requestPermission() → Future<bool>
Opens the system overlay permission settings screen.
reset() → void
Resets all call tracking state.
inherited
resizeContent(int width, int height) → Future<void>
Resizes the overlay content panel to width x height logical pixels.
inherited
showChatHead(ChatHeadConfig config) → Future<void>
Shows the chathead with the given config.
toString() → String
A string representation of this object.
inherited
updateBadge(int count) → Future<void>
Updates the badge count on the chathead bubble.
updateChatHeadIcon(String id, Uint8List rgbaBytes, int width, int height) → Future<void>
Replaces the chathead icon with raw RGBA pixel data.
updateFlag(OverlayFlag flag) → Future<void>
Updates the window behavior flag.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited