You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when I first implemented this plugin it was working correctly but now when I was testing I found this new Runtime exception. I cannot understand how to solve this error by reviewing some issues at StackOverflow. i tried adding this line in my androidManifest.xml but it doesn't solve my problem.
the following code is the code that I referred to using the flutter_beacon plugin.
`import 'dart:async';
import 'dart:io' show Platform;
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:digiatt_new/Screens/AttendanceAuth.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_beacon/flutter_beacon.dart';
import 'package:local_auth/local_auth.dart';
import 'package:lottie/lottie.dart';
import 'package:permission_handler/permission_handler.dart';
class Scan extends StatefulWidget {
var attend_data;
var userModel;
var classModel;
Scan({Key? key,required this.attend_data,required this.userModel,required this.classModel}) : super(key: key);
@override
State<Scan> createState() => _ScanState(attend_data,userModel,classModel);
}
class _ScanState extends State<Scan> {
final LocalAuthentication auth = LocalAuthentication();
_SupportState __supportState = _SupportState.unknown;
final StreamController<String> beaconEventsController = StreamController<String>.broadcast();
String authorized = 'Not Authorized';
bool isAuthenticating = false;
bool authenticated = false;
late StreamSubscription _streamRanging;
bool isScanning = false;
var attend_data;
var userModel;
var classModel;
final regions = <Region>[];
_ScanState(this.attend_data,this.userModel,this.classModel);
@override
void initState() {
Permission.bluetoothConnect.request().then((value) {
if(value.isGranted){
flutterBeacon.initializeAndCheckScanning;
}
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Give Attendance'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
//beacon_plugin code
ElevatedButton(onPressed: () async {
if (Platform.isIOS) {
// iOS platform, at least set identifier and proximityUUID for region scanning
regions.add(Region(
identifier: 'Apple Airlocate',
proximityUUID: 'E2C56DB5-DFFB-48D2-B060-D0F5A71096E0'));
} else {
// android platform, it can ranging out of beacon that filter all of Proximity UUID
regions.add(Region(identifier: 'com.beacon'));
}
// to start ranging beacons
_streamRanging = flutterBeacon.ranging(regions).listen((RangingResult result) {
print(result);
// result contains a region and list of beacons found
// list can be empty if no matching beacons were found in range
});
}, child: Text('Start scan')),
ElevatedButton(onPressed: () async {
_streamRanging.cancel();
}, child: Text('Stop scan')),
Text('- Make sure your Location and Bluetooth is on. \n - Check if your Attendance details are correct')
],
),
);
}
The text was updated successfully, but these errors were encountered:
There is one Important point to note. this error is only occurring in REDMI NOTE 10S. my primary testing device. when I tried the same app in other device. it worked perfectly. is there any problem with my device??
when I first implemented this plugin it was working correctly but now when I was testing I found this new Runtime exception. I cannot understand how to solve this error by reviewing some issues at StackOverflow. i tried adding this line in my androidManifest.xml but it doesn't solve my problem.
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
this is the list of permission added in the AndroidManifest.xml
`
the following code is the code that I referred to using the flutter_beacon plugin.
The text was updated successfully, but these errors were encountered: