Beacons scanning app with Flutter

 In this article, we will check out how to implement Beacons scanning app in flutter using the beacons_plugin package.

What is Bluetooth Beacon?

A Bluetooth beacon is a small wireless device that works based on Bluetooth Low Energy. It is kind of like a lighthouse: it repeatedly transmits a constant signal that other devices can see. Instead of emitting visible light, though, it broadcasts a radio signal that is made up of a combination of letters and numbers transmitted at short, regular intervals. A Bluetooth-equipped device like a smartphone, gateway, or access point can “see” a beacon once it is in range, much like sailors looking for a lighthouse to know where they are.

What are Bluetooth Beacons used for?

  • Understand your workspace occupancy with room-level monitoring: Reduce office space and improve utilization and employee satisfaction and productivity by measuring meeting-room, floor, and seat-level occupancy.
  • Decrease carbon footprint and improve employee experience: Monitor temperature, humidity, carbon dioxide, light, motion, and air quality in real-time.
  • Create a safer workplace: Automate the people count in muster areas and the identification of the locations of staff and visitors in case of emergency.
  • Manage visitors flow: Enhances security management by delivering a consistent process that streamlines real-time visitor tracking, pairing hosts and visitors while continuing to deliver on safety, security, and compliance.

Too much theory done, isn’t it? So now, let’s do some real stuff!!


Step 1: Import the latest version of the “beacons_plugin” package to pubspec.yaml file


Step 2: Update MainActivity class to following


Step 3: Create a Stream controller
To allows sending data, error, and done events on its stream create a stream controller. It can be used to create a simple stream that others can listen on and to push events to that stream


Step 4: In order to scan the beacon create the initPlatformState() method in main.dart as follows


Step 5: Now let’s create a UI and call initPlatformState() method on the button click to scan and display the available beacon in main.dart as follows


Step 6: Ensure to update initState() method else app will not working after kill app


Step 7: To run the app first of all install the beacon simulator app from Playstore on another device and create iBeacon



I’ll leave the full code snippets below.

Have a product idea? Let’s build together!

Get in touch