FakeFloatyPlatform class

A fake implementation of FloatyChatheadsPlatform for unit testing.

Tracks all method calls and allows you to control return values:

final fake = FakeFloatyPlatform();
FloatyChatheadsPlatform.instance = fake;

// Now FloatyChatheads.showChatHead() calls fake.showChatHead().
await FloatyChatheads.showChatHead(entryPoint: 'test');

expect(fake.showChatHeadCalled, isTrue);
expect(fake.lastConfig?.entryPoint, equals('test'));
Inheritance
  • Object
  • PlatformInterface
  • FloatyChatheadsPlatform
  • FakeFloatyPlatform

Constructors

FakeFloatyPlatform()

Properties

active bool
Controls the return value of isActive.
getter/setter pair
checkPermissionCalled bool
Whether checkPermission was called.
getter/setter pair
closeChatHeadCalled bool
Whether closeChatHead was called.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
lastAddConfig AddChatHeadConfig?
The last AddChatHeadConfig passed to addChatHead.
getter/setter pair
lastBadgeCount int?
The last badge count passed to updateBadge.
getter/setter pair
lastConfig ChatHeadConfig?
The last ChatHeadConfig passed to showChatHead.
getter/setter pair
lastRemovedId String?
The last ID passed to removeChatHead.
getter/setter pair
permissionGranted bool
Controls the return value of checkPermission.
getter/setter pair
requestPermissionCalled bool
Whether requestPermission was called.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showChatHeadCalled bool
Whether showChatHead was called.
getter/setter pair

Methods

addChatHead(AddChatHeadConfig config) Future<void>
Adds a new chathead bubble to the existing group.
override
checkPermission() Future<bool>
Checks whether overlay permission is granted.
override
closeChatHead() Future<void>
Closes the chathead and stops the overlay service.
override
closeOverlay() Future<void>
Closes the overlay from inside the overlay isolate.
inherited
collapseChatHead() Future<void>
Programmatically collapses the chathead content panel.
override
expandChatHead() Future<void>
Programmatically expands the chathead to show its content panel.
override
getOverlayPosition() Future<OverlayPosition>
Gets the current overlay position as an OverlayPosition.
inherited
isActive() Future<bool>
Whether the chathead overlay is currently active.
override
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.
override
requestPermission() Future<bool>
Opens the system overlay permission settings screen.
override
reset() → void
Resets all call tracking state.
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.
override
toString() String
A string representation of this object.
inherited
updateBadge(int count) Future<void>
Updates the badge count on the chathead bubble.
override
updateFlag(OverlayFlag flag) Future<void>
Updates the window behavior flag.
inherited

Operators

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