Skip to content

Instantly share code, notes, and snippets.

@sbis04
Created March 4, 2019 17:00
Show Gist options
  • Select an option

  • Save sbis04/26e6223e13dc7c2ce0c8eca5f8021fa8 to your computer and use it in GitHub Desktop.

Select an option

Save sbis04/26e6223e13dc7c2ce0c8eca5f8021fa8 to your computer and use it in GitHub Desktop.
BluetoothApp class
class BluetoothApp extends StatefulWidget {
@override
_BluetoothAppState createState() => _BluetoothAppState();
}
class _BluetoothAppState extends State<BluetoothApp> {
// Initializing a global key, as it would help us in showing a SnackBar later
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
// Get the instance of the bluetooth
FlutterBluetoothSerial bluetooth = FlutterBluetoothSerial.instance;
// Define some variables, which will be required later
List<BluetoothDevice> _devicesList = [];
BluetoothDevice _device;
bool _connected = false;
bool _pressed = false;
@override
Widget build(BuildContext context) {
return Container(
// We have to work on the UI in this part
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment