flic_button
1.2.12, released 8 weeks ago by darkerwaters.co.uk
Flutter interface for Flic2 Bluetooth buttons on Android and iOS.
WASM-ready
What it does
Wraps the official Flic2 native libraries to let Flutter applications search for, connect to, disconnect, and listen for press and release events from Flic 2 hardware buttons. Supports Android and iOS platforms.
AI-written summary of version 1.2.12, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to integrate Flic 2 Bluetooth hardware buttons into your mobile app.
- Your app needs to trigger actions based on button presses, double-presses, or holds from physical Flic buttons.
Skip it when
- You require a persistent background service to handle button presses while the Flutter application is completely destroyed.
- You are using the original first-generation Flic buttons, which are not currently supported.
Strengths
- Direct integration with official Flic2 Android and iOS SDKs.
- Exposes search, connection management, and button click callbacks cleanly to Dart.
Weaknesses
- Does not support background execution if the app is destroyed.
- Requires manual configuration of native permissions for Bluetooth and Location on both Android and iOS.
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 1
Requires native configuration of Bluetooth and Location permissions in AndroidManifest.xml and iOS Info.plist, alongside minimum SDK adjustments and Gradle modifications.
import 'package:flic_button/flic_button.dart';
class ButtonListener with Flic2Listener {
void onButtonClicked(Flic2ButtonClick buttonClick) {
print('button ${buttonClick.button.uuid} clicked');
}
}
void main() {
final plugin = FlicButtonPlugin(flic2listener: ButtonListener());
plugin.invokation.then((value) {
return plugin.getFlic2Buttons();
}).then((value) {
if (value.isEmpty) {
plugin.scanForFlic2();
} else {
for (Flic2Button button in value) {
plugin.listenToFlic2Button(button.uuid);
}
}
});
}Works with
Packages commonly used together with flic_button: ones it builds on, ones built on it, and its own family.