flutter-keyboard hides itself when clicked on textfield - forms

I/ViewRootImpl#799941b[MainActivity](12513): ViewPostIme pointer 0
I/ViewRootImpl#799941b[MainActivity](12513): ViewPostIme pointer 1
D/InputMethodManager(12513): SSI - flag : 0 Pid : 12513 view : com.example.facatte
D/InputMethodManager(12513): prepareNavigationBarInfo() DecorView#f0b7259[MainActivity]
D/InputMethodManager(12513): getNavigationBarColor() -855310
D/InputMethodManager(12513): prepareNavigationBarInfo() DecorView#f0b7259[MainActivity]
D/InputMethodManager(12513): getNavigationBarColor() -855310
V/InputMethodManager(12513): Starting input: tba=com.example.facatte ic=io.flutter.plugin.editing.InputConnectionAdaptor#8b758fe mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager(12513): startInputInner - Id : 0
I/InputMethodManager(12513): startInputInner - mService.startInputOrWindowGainedFocus
D/InputTransport(12513): Input channel destroyed: 'ClientS', fd=93
W/IInputConnectionWrapper(12513): getExtractedText on inactive InputConnection
W/IInputConnectionWrapper(12513): requestCursorAnchorInfo on inactive InputConnection
I/ViewRootImpl#799941b[MainActivity](12513): MSG_RESIZED: frame=(0,0,1080,2340) ci=(0,83,0,989) vi=(0,83,0,989) or=1
I/ViewRootImpl#799941b[MainActivity](12513): Relayout returned: old=(0,0,1080,2340) new=(0,0,1080,2340) req=(1080,2340)0 dur=12 res=0x1 s={true 518951051264} ch=false
D/InputMethodManager(12513): HSIFW - flag : 0
I/ViewRootImpl#799941b[MainActivity](12513): MSG_RESIZED: frame=(0,0,1080,2340) ci=(0,83,0,126) vi=(0,83,0,126) or=1
I/ViewRootImpl#799941b[MainActivity](12513): Relayout returned: old=(0,0,1080,2340) new=(0,0,1080,2340) req=(1080,2340)0 dur=12 res=0x1 s={true 518951051264} ch=false
This is the output in console when tapping on the textfield.
The keyboard comes up for 2 seconds and then hides automatically. It doesnt throw any error too !

GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
final _formKey = GlobalKey<FormState>();
TextEditingController textEditingController = new TextEditingController();
return Scaffold(
key: _scaffoldKey,
body : Form(
key: _formKey,
child: TextField(
controller: textEditingController,
decoration: new InputDecoration(
hintText: 'Type Your Data',
),
),
));
Or If you are using Multiple TextFields then use a separate controller for each TextField. I hope this will work for you.

Related

Failure while running flutter

I'am trying to run my flutter app on my android device but everytime
I try to run it I'am getting an error but the things is that the flutter
app is a newly created flutter project and I haven't run any code
yet but the android device is the one I always use to run my flutter apps
this is the error:
Launching lib\main.dart on SM G9250 in debug mode...
Running Gradle task 'assembleDebug'...
F/CoreApps(23818): [1][CommonFeature] ###versionCode : 115082101, CONTACT_PROFILE_SERVICE_ENABLE : true, FREE_MESSAGE_ENABLE : true
F/CoreApps(23818): [1][CommonFeature] ###versionCode : 115082101, CONTACT_PROFILE_SERVICE_ENABLE : true, FREE_MESSAGE_ENABLE : true
F/CoreApps(23818): [ELog][1][EasySignUp] [NotRegistered][014dade2924475c9ae5e0ed07254fa66fa9f1650bb]
F/CoreApps(24071): [1][CommonFeature] ###versionCode : 115082101, CONTACT_PROFILE_SERVICE_ENABLE : true, FREE_MESSAGE_ENABLE : true
F/CoreApps(24071): [1][CommonFeature] ###versionCode : 115082101, CONTACT_PROFILE_SERVICE_ENABLE : true, FREE_MESSAGE_ENABLE : true
F/CoreApps(24071): [ELog][1][EasySignUp] [NotRegistered][014dade2924475c9ae5e0ed07254fa66fa9f1650bb]
F/CoreApps(24352): [1][CommonFeature] ###versionCode : 115082101, CONTACT_PROFILE_SERVICE_ENABLE : true, FREE_MESSAGE_ENABLE : true
F/CoreApps(24352): [1][CommonFeature] ###versionCode : 115082101, CONTACT_PROFILE_SERVICE_ENABLE : true, FREE_MESSAGE_ENABLE : true
F/CoreApps(24352): [ELog][1][EasySignUp] [NotRegistered][014dade2924475c9ae5e0ed07254fa66fa9f1650bb]
F/CoreApps(24586): [1][CommonFeature] ###versionCode : 115082101, CONTACT_PROFILE_SERVICE_ENABLE : true, FREE_MESSAGE_ENABLE : true
F/CoreApps(24586): [1][CommonFeature] ###versionCode : 115082101, CONTACT_PROFILE_SERVICE_ENABLE : true, FREE_MESSAGE_ENABLE : true
F/CoreApps(24586): [ELog][1][EasySignUp] [NotRegistered][014dade2924475c9ae5e0ed07254fa66fa9f1650bb]
F/Finsky:background(25198): [62819] kce.h(3): Service object is not present when stopServiceSafely was called.
F/Finsky:background(25198): com.google.android.flib.log.WhatATerribleException
F/Finsky:background(25198): at adil.h(PG:2)
F/Finsky:background(25198): at com.google.android.finsky.utils.FinskyLog.k(PG:3)
F/Finsky:background(25198): at kce.h(PG:3)
F/Finsky:background(25198): at kce.g(PG)
F/Finsky:background(25198): at kce.e(PG:2)
F/Finsky:background(25198): at kcp.h(PG)
F/Finsky:background(25198): at kcn.a(PG:4)
F/Finsky:background(25198): at kcp.j(PG:1)
F/Finsky:background(25198): at kcp.c(PG)
F/Finsky:background(25198): at jzy.e(PG:12)
F/Finsky:background(25198): at jzv.apply(PG:117)
F/Finsky:background(25198): at j$.util.stream.s.accept(SourceFile:45)
F/Finsky:background(25198): at j$.util.a.forEachRemaining(SourceFile:20)
F/Finsky:background(25198): at j$.util.stream.c.y(SourceFile:21)
F/Finsky:background(25198): at j$.util.stream.c.G(SourceFile:8)
F/Finsky:background(25198): at j$.util.stream.Z0.e(SourceFile:1)
F/Finsky:background(25198): at j$.util.stream.c.J(SourceFile:35)
F/Finsky:background(25198): at j$.util.stream.A1.collect(SourceFile:83)
F/Finsky:background(25198): at jzm.a(PG:57)
F/Finsky:background(25198): at akic.e(PG:2)
F/Finsky:background(25198): at akie.run(PG:9)
F/Finsky:background(25198): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
F/Finsky:background(25198): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
F/Finsky:background(25198): at htq.run(PG:40)
F/Finsky:background(25198): at java.lang.Thread.run(Thread.java:818)
F/Finsky:background(26867): [62984] kce.h(3): Service object is not present when stopServiceSafely was called.
F/Finsky:background(26867): com.google.android.flib.log.WhatATerribleException
F/Finsky:background(26867): at adil.h(PG:2)
F/Finsky:background(26867): at com.google.android.finsky.utils.FinskyLog.k(PG:3)
F/Finsky:background(26867): at kce.h(PG:3)
F/Finsky:background(26867): at kce.g(PG)
F/Finsky:background(26867): at kce.e(PG:2)
F/Finsky:background(26867): at kcp.h(PG)
F/Finsky:background(26867): at kcn.a(PG:4)
F/Finsky:background(26867): at kcp.j(PG:1)
F/Finsky:background(26867): at kcp.c(PG)
F/Finsky:background(26867): at jzy.e(PG:12)
F/Finsky:background(26867): at jzv.apply(PG:117)
F/Finsky:background(26867): at j$.util.stream.s.accept(SourceFile:45)
F/Finsky:background(26867): at j$.util.a.forEachRemaining(SourceFile:20)
F/Finsky:background(26867): at j$.util.stream.c.y(SourceFile:21)
F/Finsky:background(26867): at j$.util.stream.c.G(SourceFile:8)
F/Finsky:background(26867): at j$.util.stream.Z0.e(SourceFile:1)
F/Finsky:background(26867): at j$.util.stream.c.J(SourceFile:35)
F/Finsky:background(26867): at j$.util.stream.A1.collect(SourceFile:83)
F/Finsky:background(26867): at jzm.a(PG:57)
F/Finsky:background(26867): at akic.e(PG:2)
F/Finsky:background(26867): at akie.run(PG:9)
F/Finsky:background(26867): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
F/Finsky:background(26867): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
F/Finsky:background(26867): at htq.run(PG:40)
F/Finsky:background(26867): at java.lang.Thread.run(Thread.java:818)

Flutter stripe_checkout Payment Method Exception

I'm using Flutter stripe_checkout: ^1.0.0 and saw some odd behaviour.
When the checkout button is clicked just once, the screen would turn blank with the following printout. On Stripe dashboard, it says, "Incomplete - The customer has not entered their payment method'.
I/flutter (32631): Checkout session id cs_test_a10k5Lsopaz9JupfebE9pW77ZgUpucfzCrh1WTKX9KcApdbKztnZiz1SKe
I/WebViewFactory(32631): Loading com.google.android.webview version 83.0.4103.106 (code 410410681)
I/cr_VariationsUtils(32631): Requesting new seed from IVariationsSeedServer
I/cr_LibraryLoader(32631): Loaded native library version number "83.0.4103.106"
I/cr_CachingUmaRecorder(32631): Flushed 3 samples from 3 histograms.
I/TetheringManager(32631): registerTetheringEventCallback:com.healthcare.jaaba
W/GooglePlayServicesUtil(32631): Google Play Store is missing.
W/GooglePlayServicesUtil(32631): Google Play Store is missing.
W/GooglePlayServicesUtil(32631): Google Play Store is missing.
W/GooglePlayServicesUtil(32631): Google Play Store is missing.
E/cr_PlatformSer-Internal(32631): UsageReporting query failed
W/ealthcare.jaab(32631): Accessing hidden method Landroid/media/AudioManager;->getOutputLatency(I)I (greylist, reflection, allowed)
D/HostConnection(32631): HostConnection::get() New Host Connection established 0xf4e7e280, tid 752
E/cr_PlatformSer-Internal(32631): Unable to determine Safe Browsing user opt-in preference
D/HostConnection(32631): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0
D/EGL_emulation(32631): eglCreateContext: 0xf4e7c140: maj 3 min 0 rcv 3
D/EGL_emulation(32631): eglMakeCurrent: 0xf4e7c140: ver 3 0 (tinfo 0xaf33b210) (first time)
D/EGL_emulation(32631): eglMakeCurrent: 0xf4e60d10: ver 3 0 (tinfo 0xf51b1d50) (first time)
W/Gralloc4(32631): allocator 3.x is not supported
I/VideoCapabilities(32631): Unsupported profile 4 for video/mp4v-es
W/cr_MediaCodecUtil(32631): HW encoder for video/avc is not available on this device.
D/EGL_emulation(32631): eglCreateContext: 0xf4e7f1d0: maj 3 min 0 rcv 3
I/ealthcare.jaab(32631): NativeAlloc concurrent copying GC freed 50165(3378KB) AllocSpace objects, 15(428KB) LOS objects, 49% free, 3769KB/7539KB, paused 2.245ms total 147.024ms
W/ealthcare.jaab(32631): Reducing the number of considered missed Gc histogram windows from 124 to 100
I/chromium(32631): [INFO:CONSOLE(1)] "Unrecognized feature: 'payment'.", source: https://js.stripe.com/v3/ (1)
However, when the checkout button is clicked 3 - 5 times continuously, the card form appears and the payment would be successful.
I/flutter (32631): Checkout session id cs_test_a1ZwZrvL4812TEpjFwQ649RMYjirJr9TMwQVZ29JYrjGj54gmqkCtTyfTW
I/flutter (32631): Checkout session id cs_test_a13D23W9EY1SgLBqYIZLAHTvFBcHKY1wUIiZdr3Kb6XPNsrrLEfj3KJjkj
I/ealthcare.jaab(32631): NativeAlloc concurrent copying GC freed 7125(419KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 3431KB/6863KB, paused 1.352ms total 189.441ms
I/chromium(32631): [INFO:CONSOLE(1)] "Unrecognized feature: 'payment'.", source: https://js.stripe.com/v3/ (1)
I/chromium(32631): [INFO:CONSOLE(1)] "Unrecognized feature: 'payment'.", source: https://js.stripe.com/v3/ (1)
I/flutter (32631): Checkout session id cs_test_a1QsxT2t7H68MpvgLinDukwOBzwW1W21ktnbQdqB25R6t2b0TE5mO4u9jj
I/flutter (32631): Checkout session id cs_test_a1o2VPwBSq0RRW6PlSKnGr554hoWFIOrPy1NZWnLveMqAZyLX6iVYKFr0y
I/chromium(32631): [INFO:CONSOLE(1)] "Unrecognized feature: 'payment'.", source: https://js.stripe.com/v3/ (1)
I/chromium(32631): [INFO:CONSOLE(1)] "Unrecognized feature: 'payment'.", source: https://js.stripe.com/v3/ (1)
I/flutter (32631): Checkout session id cs_test_a1uWleO9v9VAwUAra957z8uHbpOwNyp24nZYgAQ2aOLHqwt3hBcOtAg8Yf
I/chromium(32631): [INFO:CONSOLE(1)] "Unrecognized feature: 'payment'.", source: https://js.stripe.com/v3/ (1)
I/chromium(32631): [INFO:CONSOLE(1)] "Unrecognized feature: 'payment'.", source: https://js.stripe.com/v3/ (1)
I/chromium(32631): [INFO:CONSOLE(1)] "Unrecognized feature: 'payment'.", source: https://js.stripe.com/v3/fingerprinted/js/stripe-a07f9e62b0b55658b30abedf1005cae0.js (1)
I/chatty (32631): uid=10139(com.healthcare.jaaba) identical 1 line
I/chromium(32631): [INFO:CONSOLE(1)] "Unrecognized feature: 'payment'.", source: https://js.stripe.com/v3/fingerprinted/js/stripe-a07f9e62b0b55658b30abedf1005cae0.js (1)
I/Choreographer(32631): Skipped 31 frames! The application may be doing too much work on its main thread.
I/chromium(32631): [INFO:CONSOLE(265)] "Uncaught ReferenceError: PaymentRequest is not defined", source: https://pay.google.com/gp/p/js/pay.js (265)
Flutter Application: checkout_screen.dart
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:stripe_checkout/stripe_checkout.dart';
import 'package:flutter/material.dart';
import '../../../../utils/env.dart';
import '../widgets/example_scaffold.dart';
import '../../../../utils/api_endpoints.dart';
import 'platforms/stripe_checkout.dart' if (dart.library.js)
'platforms/stripe_checkout_web.dart';
class CheckoutScreenExample extends StatefulWidget {
const CheckoutScreenExample({Key? key}) : super(key: key);
#override
_CheckoutScreenExample createState() => _CheckoutScreenExample();
}
class _CheckoutScreenExample extends State<CheckoutScreenExample> {
#override
Widget build(BuildContext context) {
return ExampleScaffold(
title: 'Checkout Page',
padding: const EdgeInsets.all(16),
children: [
const SizedBox(height: 120),
Center(
child: ElevatedButton(
onPressed: checkout,
child: const Text('Open Checkout'),
),
)
],
);
}
Future<void> checkout() async {
final String sessionId = await _createCheckoutSession();
final result = await redirectToCheckout(
context: context,
sessionId: sessionId,
publishableKey: stripePublishableKey,
successUrl: 'https://checkout.stripe.dev/success',
canceledUrl: 'https://checkout.stripe.dev/cancel',
);
if (mounted) {
final text = result.when(
success: () => 'Paid successfully',
canceled: () => 'Checkout canceled',
error: (e) => 'Error $e',
redirected: () => 'Redirected successfully',
);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(text)),
);
}
}
Future<String> _createCheckoutSession() async {
final stripePayURL = Uri.parse(ApiUrl.stripePayUrl);
final response = await http.get(
stripePayURL,
headers: <String, String>{'Authorization': 'Bearer ' + token,
},
);
final Map<String, dynamic> bodyResponse = json.decode(response.body);
final id = bodyResponse['checkout_session_id'] as String;
debugPrint('Checkout session id $id');
return id;
}
}
Flask Backend: billing.py
#api_blueprint.route('/stripe_pay', methods=['GET'])
#token_auth.login_required
def stripe_pay():
cart_id = basic_auth.current_user().id
transaction = Transaction.query.filter(Transaction.cart_id==cart_id).first()
price = stripe.Price.create(
unit_amount=transaction.count_grand_total(),
currency=transaction.currency,
)
session = stripe.checkout.Session.create(
payment_method_types=['card'],
line_items=[{
'price': price,
'quantity': 1,
}],
mode='payment',
success_url=url_for('api.success', cart_id=cart_id, _external=True) + '?cart_id=cart_id' + '?session_id={CHECKOUT_SESSION_ID}',
cancel_url=url_for('home.index', _external=True),
)
return jsonify ({
'checkout_session_id': session['id'],
'checkout_public_key': checkout_public_key,
'cart_id': int(cart_id)
})
I would appreciate if someone show me how to fix this. Thank you.

Flutter, simple method channel not working

I followed this https://docs.flutter.dev/development/platform-integration/platform-channels
D/InputTransport(12698): Input channel constructed: 'ClientS', fd=180
D/InputMethodManager(12698): prepareNavigationBarInfo() DecorView#9959d90[MainActivity]
D/InputMethodManager(12698): getNavigationBarColor() -16711423
V/InputMethodManager(12698): Starting input: tba=com.abc ic=null mNaviBarColor -16711423 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager(12698): startInputInner - Id : 0
I/SurfaceControl(12698): nativeRelease nativeObject s[-5476376642254367232]
I/SurfaceControl(12698): nativeRelease nativeObject e[-5476376642254367232]
I/SurfaceControl(12698): nativeRelease nativeObject s[-5476376642254367552]
I/SurfaceControl(12698): nativeRelease nativeObject e[-5476376642254367552]
continuously shows this.
The strange thing is that in Android project, clean project, rebuild, and turn off and restart Android studio sometimes works. (Only sometimes I can see the print("it works"); in MainActivity more specifically, inside of "configureFlutterEngine" function

Flutter - flutter_inappwebview - GL error: Out of memory

I use the flutter_inappwebview plugin to run a WebView (PostUrl). but I found an error when displaying my web. Here's an example of my coding:
import 'dart:async';
import 'dart:convert' show utf8;
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:smartmosque/Api/ApiServer.dart';
import 'package:smartmosque/Utils/Global.dart';
class PaymentLinkAjaPage extends StatefulWidget {
final String token;
PaymentLinkAjaPage({this.token});
#override
_PaymentLinkAjaPageState createState() => _PaymentLinkAjaPageState();
}
class _PaymentLinkAjaPageState extends State<PaymentLinkAjaPage> {
InAppWebViewController webView;
String url = "";
double progress = 0;
void actionBack() {
if (url.length > 100) {
Navigator.pop(context);
Navigator.pop(context);
Navigator.pop(context);
} else {
Navigator.pop(context);
}
}
#override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () {
actionBack();
return Future.value(true);
},
child: Scaffold(
backgroundColor: Global.primaryRed,
appBar: AppBar(
title: Text("Infak Link Aja!"),
elevation: 0,
leading: IconButton(
icon: Icon(Icons.clear),
onPressed: () {
actionBack();
}),
),
body: Container(
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.only(left: 20, right: 20),
child: progress < 1.0
? LinearProgressIndicator(value: progress)
: Container()),
Expanded(
child: ClipRRect(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20)),
child: InAppWebView(
initialHeaders: {},
initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(
debuggingEnabled: true,
useShouldOverrideUrlLoading: false)),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
var encodetext = utf8.encode("message=${widget.token}");
Uint8List postdata = Uint8List.fromList(encodetext);
webView.postUrl(url: urlWebLinkAja, postData: postdata);
},
androidOnPermissionRequest:
(InAppWebViewController controller, String origin,
List<String> resources) async {
return PermissionRequestResponse(
resources: resources,
action: PermissionRequestResponseAction.GRANT);
},
onReceivedServerTrustAuthRequest:
(controller, challenge) async {
return ServerTrustAuthResponse(
action: ServerTrustAuthResponseAction.PROCEED);
},
onLoadStart:
(InAppWebViewController controller, String url) async {
setState(() {
this.url = url;
// print("urlstart: $url");
});
},
onLoadStop: (controller, url) async {
setState(() {
this.url = url;
});
},
onProgressChanged:
(InAppWebViewController controller, int progress) {
setState(() {
this.progress = progress / 100;
});
},
),
))
],
),
),
),
);
}
}
and here's the error log:
E/OpenGLRenderer( 5918): GL error: Out of memory!
F/OpenGLRenderer( 5918): glFinish error! GL_OUT_OF_MEMORY (0x505)
W/google-breakpad( 5918): ### ### ### ### ### ### ### ### ### ### ### ### ###
W/google-breakpad( 5918): Chrome build fingerprint:
W/google-breakpad( 5918): 70.0.3538.110
W/google-breakpad( 5918): 353811052
W/google-breakpad( 5918): ### ### ### ### ### ### ### ### ### ### ### ### ###
F/libc ( 5918): Fatal signal 6 (SIGABRT), code -6 in tid 6041 (RenderThread), pid 5918 (gma.example)
Softversion: PD1731F_EX_A_1.18.3
Time: 2020-09-28 15:17:37
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'vivo/1724/1724:8.1.0/OPM1.171019.011/compil08311518:user/release-keys'
Revision: '0'
ABI: 'arm64'
pid: 5918, tid: 6041, name: RenderThread >>> com.example.test <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'glFinish error! GL_OUT_OF_MEMORY (0x505)'
x0 0000000000000000 x1 0000000000001799 x2 0000000000000006 x3 0000000000000008
x4 0000007b2cd44588 x5 0000007b2cd44588 x6 0000007b2cd44588 x7 0000007b2cd44588
x8 0000000000000083 x9 0000000010000000 x10 0000007b2cd43cb0 x11 8f38f30250d84677
x12 8f38f30250d84677 x13 0000000000000000 x14 ffffffffffffffdf x15 8f38f30250d84677
x16 0000005f418bffa8 x17 0000007bd2ec4134 x18 8f38f30250d84677 x19 000000000000171e
x20 0000000000001799 x21 0000000000000083 x22 0000007bd29a9a70 x23 0000000000000502
x24 0000007bd29a9b3e x25 0000000000000505 x26 0000007bd29a9b24 x27 0000007bd29a9b3e
x28 0000000000000505 x29 0000007b2cd43cf0 x30 0000007bd2e6a630
sp 0000007b2cd43cb0 pc 0000007bd2e6a658 pstate 0000000060000000
backtrace:
#00 pc 000000000001e658 /system/lib64/libc.so (abort+120)
#01 pc 00000000000083e4 /system/lib64/liblog.so (__android_log_assert+296)
#02 pc 00000000000468fc /system/lib64/libhwui.so (android::uirenderer::debug::GlesErrorCheckWrapper::assertNoErrors(char const*)+384)
#03 pc 0000000000089b00 /system/lib64/libhwui.so (android::uirenderer::Caches::flush(android::uirenderer::Caches::FlushMode)+164)
#04 pc 00000000000752fc /system/lib64/libhwui.so (android::uirenderer::renderthread::Bridge_destroyHardwareResources(android::uirenderer::renderthread::destroyHardwareResourcesArgs*)+12)
#05 pc 0000000000076934 /system/lib64/libhwui.so (android::uirenderer::renderthread::MethodInvokeRenderTask::run()+24)
#06 pc 0000000000076cc8 /system/lib64/libhwui.so (android::uirenderer::renderthread::SignalingRenderTask::run()+28)
#07 pc 0000000000077c18 /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+336)
#08 pc 0000000000011590 /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+276)
#09 pc 00000000000aa03c /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+136)
#10 pc 0000000000077968 /system/lib64/libc.so (__pthread_start(void*)+36)
#11 pc 000000000001fa30 /system/lib64/libc.so (__start_thread+68)
Lost connection to device.
Running flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.20.4, on Microsoft Windows [Version 10.0.18363.1082], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Android Studio (version 3.6)
[√] VS Code (version 1.49.2)
[√] Connected device (1 available)
• No issues found!

contact picker causing app crash after I am selecting contact from contact list

I am using Flutter contact picker 0.0.2. But it is giving some weird error. It shows the contact list when I call selectContact Future, however, after selecting a particular contact from the list, the app crashes, and it gives me the below-mentioned error on console.
I have also tried with adding permission in android, even though it is not required, still, it does not work.
Code :
class _MobileNumberWidgetState extends State<MobileNumberWidget> {
final TextEditingController _phoneNumberController = TextEditingController();
final ContactPicker _contactPicker = new ContactPicker();
Contact _contact;
#override
Widget build(BuildContext context) {
return AppWidgets.shadowContainerComplete(
child:Row(
children: <Widget>[
Expanded(
child: TextField(
controller: _phoneNumberController,
decoration: AppStyles.textField(hint: "Enter Phone Number", iconData: Icons.phone_iphone),
),
),
IconButton(
icon: Icon(Icons.format_list_numbered),
onPressed: () async{
Contact contact = await _contactPicker.selectContact();
setState(() {
_contact = contact;
});
},
)
],
)
);
}
}
Console :
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk...
D/FlutterActivity(17398): Using the launch theme as normal theme.
D/FlutterActivityAndFragmentDelegate(17398): Setting up FlutterEngine.
D/FlutterActivityAndFragmentDelegate(17398): No preferred FlutterEngine was provided. Creating a new FlutterEngine for this FlutterFragment.
D/FlutterActivityAndFragmentDelegate(17398): Attaching FlutterEngine to the Activity that owns this Fragment.
D/FlutterView(17398): Attaching to a FlutterEngine: io.flutter.embedding.engine.FlutterEngine#43c3a74
D/FlutterActivityAndFragmentDelegate(17398): Executing Dart entrypoint: main, and sending initial route: /
Debug service listening on ws://127.0.0.1:28145/jPIcHt_yF9E=/ws
Syncing files to device Android SDK built for x86...
D/EGL_emulation(17398): eglMakeCurrent: 0xe121a6c0: ver 3 1 (tinfo 0xe120f8a0)
D/eglCodecCommon(17398): setVertexArrayObject: set vao to 0 (0) 1 0
D/EGL_emulation(17398): eglMakeCurrent: 0xe121a180: ver 3 1 (tinfo 0xe120fa70)
D/FlutterView(17398): Detaching from a FlutterEngine: io.flutter.embedding.engine.FlutterEngine#43c3a74
D/AndroidRuntime(17398): Shutting down VM
E/AndroidRuntime(17398): FATAL EXCEPTION: main
E/AndroidRuntime(17398): Process: maaz.easyapproach.kashbak, PID: 17398
E/AndroidRuntime(17398): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2015, result=-1, data=Intent { dat=content://com.android.contacts/data/1 flg=0x1 }} to activity {maaz.easyapproach.kashbak/maaz.easyapproach.kashbak.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.ContentResolver android.app.Activity.getContentResolver()' on a null object reference
E/AndroidRuntime(17398): at android.app.ActivityThread.deliverResults(ActivityThread.java:4845)
E/AndroidRuntime(17398): at android.app.ActivityThread.handleSendResult(ActivityThread.java:4886)
E/AndroidRuntime(17398): at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
E/AndroidRuntime(17398): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(17398): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(17398): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
E/AndroidRuntime(17398): at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(17398): at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime(17398): at android.app.ActivityThread.main(ActivityThread.java:7356)
E/AndroidRuntime(17398): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(17398): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/AndroidRuntime(17398): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
E/AndroidRuntime(17398): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.ContentResolver android.app.Activity.getContentResolver()' on a null object reference
E/AndroidRuntime(17398): at net.goderbauer.flutter.contactpicker.ContactPickerPlugin.onActivityResult(ContactPickerPlugin.java:68)
E/AndroidRuntime(17398): at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEnginePluginRegistry.java:634)
E/AndroidRuntime(17398): at io.flutter.embedding.engine.FlutterEnginePluginRegistry.onActivityResult(FlutterEnginePluginRegistry.java:367)
E/AndroidRuntime(17398): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:546)
E/AndroidRuntime(17398): at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:594)
E/AndroidRuntime(17398): at android.app.Activity.dispatchActivityResult(Activity.java:8110)
E/AndroidRuntime(17398): at android.app.ActivityThread.deliverResults(ActivityThread.java:4838)
E/AndroidRuntime(17398): ... 11 more
I/Process (17398): Sending signal. PID: 17398 SIG: 9
Lost connection to device.