loup-v / beacons

Flutter beacons plugin for Android and iOS.
Apache License 2.0
78 stars 54 forks source link

type 'String' is not a subtype of type 'int' - Error thrown when Major set on iBeacon selection #10

Open tristanwilson111 opened 6 years ago

tristanwilson111 commented 6 years ago

Hey there,

I've got my beacon detected with Generic UUID, Major and Minor settings in place. With iBeacon, it seems when I have any value (String, int, etc.) in the Major text area, this error is thrown. I am able to use iBeacon when Major is blank.

Stacktrace:

` ══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════ I/flutter (17107): The following assertion was thrown while handling a gesture: I/flutter (17107): type 'String' is not a subtype of type 'int'

When the exception was thrown, this was the stack: I/flutter (17107): #0 new BeaconRegionIBeacon.from (file:///D:/Projects/flutter_beacons/beacons/lib/data/beacon_region.dart) I/flutter (17107): #1 _HeaderState._onTapSubmit (file:///D:/Projects/flutter_beacons/beacons/example/lib/header.dart:84:40) I/flutter (17107): #2 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24) I/flutter (17107): #3 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:161:9) I/flutter (17107): #4 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:94:7) I/flutter (17107): #5 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:315:9) I/flutter (17107): #6 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73:12) I/flutter (17107): #7 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:11) I/flutter (17107): #8 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:143:19) I/flutter (17107): #9 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:121:22) I/flutter (17107): #10 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:101:7) I/flutter (17107): #11 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:64:7) I/flutter (17107): #12 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:48:7) I/flutter (17107): #13 _invoke1 (dart:ui/hooks.dart:134:13) I/flutter (17107): #14 _dispatchPointerDataPacket (dart:ui/hooks.dart:91:5) I/flutter (17107): I/flutter (17107): Handler: onTap I/flutter (17107): Recognizer: I/flutter (17107): TapGestureRecognizer#fc434(debugOwner: GestureDetector, state: possible, won arena, finalPosition: I/flutter (17107): Offset(199.4, 276.3), sent tap down) I/flutter (17107): ════════════════════════════════════════════════════════════════════════════════════════════════════`

I'm still learning both Flutter and Dart, and tried to see if there were any mismatched variables, but saw none. This is not an issue for me as I am able to work around it, just figured I would make an issue in case it's something needing fixed.

This error was produced on a Google Pixel running the Android P Beta.

lukaspili commented 6 years ago

Can you show me code you're using to listen to iBeacons? Thanks.

tristanwilson111 commented 6 years ago

Code being used is your example application.

vinceramcesoliveros commented 5 years ago

What happens if you change the datatype to String? I am studying your plugin and will try to contribute.

EDIT: It works for me when I changed the Datatype of "int" to "String"