shounakmulay / Telephony

Flutter plugin for telephony features like query device sms directory, listen for incoming messages, retrieve various network parameters, etc.
https://telephony.shounakmulay.dev
MIT License
140 stars 137 forks source link

Unhandled Exception: NoSuchMethodError: The getter 'requestPhoneAndSmsPermissions' was called on null. #196

Open abhitheawesomecoder opened 11 months ago

abhitheawesomecoder commented 11 months ago

E/flutter (10721): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: NoSuchMethodError: The getter 'requestPhoneAndSmsPermissions' was called on null. E/flutter (10721): Receiver: null E/flutter (10721): Tried calling: requestPhoneAndSmsPermissions E/flutter (10721): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:38:5) E/flutter (10721): #1 _VerifyMobile.initPlatformState (package:womb/Screens/Auth_Screens/verify_mobile.dart:55:42) E/flutter (10721): #2 _VerifyMobile.initState (package:womb/Screens/Auth_Screens/verify_mobile.dart:32:5) E/flutter (10721): #3 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:5602:55) E/flutter (10721): #4 ComponentElement.mount (package:flutter/src/widgets/framework.dart:5447:5) E/flutter (10721): #5 Element.inflateWidget (package:flutter/src/widgets/framework.dart:4326:16) E/flutter (10721): #6 Element.updateChild (package:flutter/src/widgets/framework.dart:3837:18) E/flutter (10721): #7 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6736:14) E/flutter (10721): #8 Element.inflateWidget (package:flutter/src/widgets/framework.dart:4326:16) E/flutter (10721): #9 Element.updateChild (package:flutter/src/widgets/framework.dart:3837:18) E/flutter (10721): #10 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16) E/flutter (10721): #11 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7) E/flutter (10721): #12 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:5453:5) E/flutter (10721): #13 ComponentElement.mount (package:flutter/src/widgets/framework.dart:5447:5) E/flutter (10721): #14 Element.inflateWidget (package:flutter/src/widgets/framework.dart:4326:16) E/flutter (10721): #15 Element.updateChild (package:flutter/src/widgets/framework.dart:3837:18) E/flutter (10721): #16 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6736:14) E/flutter (10721): #17 Element.inflateWidget (package:flutter/src/widgets/framework.dart:4326:16) E/flutter (10721): #18 Element.updateChild (package:flutter/src/widgets/framework.dart:3837:18) E/flutter (10721): #19 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6736:14) E/flutter (10721): #20 Element.inflateWidget (package:flutter/src/widgets/framework.dart:4326:16) E/flutter (10721): #21 Element.updateChild (package:flutter/src/widgets/framework.dart:3837:18) E/flutter (10721): #22 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16) E/flutter (10721): #23 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11) E/flutter (10721): #24 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7) E/flutter (10721): #25 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:5453:5) E/flutter (10721): #26 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:5625:11) E/flutter (10721): #27 ComponentElement.mount (package:flutter/src/widgets/framework.dart:5447:5) E/flutter (10721): #28 Element.inflateWidget (package:flutter/src/widgets/framework.dart:4326:16) E/flutter (10721): #29 Element.updateChild (package:flutter/src/widgets/framework.dart:3837:18) E/flutter (10721): #30 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6736:14

thanhdang198 commented 10 months ago

Just call with telephony.requestPhoneAndSmsPermissions; I've checked and this function work normally