FlicButtonPlugin class

the plugin to handle the finding of, connection to and listening tp to Flic2 buttons Flic2 buttons can be purchased from flic.io/ and this library used (which wraps theirs) from github.com/50ButtonsEach/flic2lib-android to use them direct. There is also a hub they sell to control their buttons which this library does not use. Nor does this library connect to version 1 of their buttons, or the dial, but I guess it could (O:

Constructors

FlicButtonPlugin({required Flic2Listener flic2listener})
create the 'plugin' to manage all connection and listening to FLic 2 buttons

Properties

flic2listener Flic2Listener
final
hashCode int
The hash code for this object.
no setterinherited
invokation Future<bool?>?
accessor to get the invokation future so your UI can wait till it's running properly
no setter
log → Logger
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancelListenToFlic2Button(String buttonUuid) Future<bool?>
stop listening to a button (not iOS)
cancelScanForFlic2() Future<bool?>
cancel any running scan
connectButton(String buttonUuid) Future<bool?>
connect a button for use
disconnectButton(String buttonUuid) Future<bool?>
disconnect a button to stop using
disposeFlic2() Future<bool?>
dispose of this plugin to shut it all down (iOS doesn't at the moment)
forgetButton(String buttonUuid) Future<bool?>
have the manager forget the button (so you can scan again and connect again)
getFlic2ButtonByAddress(String buttonAddress) Future<Flic2Button?>
when a button is discovered, you can just get the bluetooth address, this let's you see if there's a button behind that
getFlic2Buttons() Future<List<Flic2Button>>
get all the flic 2 buttons the manager is currently aware of (will remember between sessions)
listenToFlic2Button(String buttonUuid) Future<bool?>
listen to the button (android only, or can commonly ignore)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
replaceInvalidJsonCharacters(String json, {bool isEncodeNonJsonChars = true}) String
Replaces all characters that can not exist unencoded in a JSON with their JSON-encoded representations. We need this step because we seem to be randomly getting very bad JSON back from some connected buttons (especially from the name param which can have carriage returns and other bad things in there)
scanForFlic2() Future<bool?>
initiate a scan for buttons
toString() String
A string representation of this object.
inherited

Operators

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