samuelezedi / flutter_clipboard

A plugin that helps you copy to clipboard and paste from clipboard.
Other
37 stars 7 forks source link

app getting null in applifecylestate like on resume and other #2

Open lavahasif opened 4 years ago

lavahasif commented 4 years ago

): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The getter 'text' was called on null. E/flutter (14312): Receiver: null E/flutter (14312): Tried calling: text E/flutter (14312): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5) E/flutter (14312): #1 FlutterClipboard.paste (package:clipboard/clipboard.dart:21:17)

sahmadreza commented 3 years ago

I have the same problem just in android 10 .

samuelezedi commented 3 years ago

If it's getting null, then nothing was copied, don't you think? It means there's nothing on the clipboard

BytesZero commented 3 years ago

First of all, I make sure that there is content in the clipboard, and secondly, when I switch applications back and forth several times, I get this error

BytesZero commented 3 years ago

@lavahasif @lavahasif @sahmadreza I found the answer https://github.com/flutter/flutter/issues/44267#issuecomment-569215719

BytesZero commented 3 years ago
Future.delayed(Duration(milliseconds: 500)).then((_) => ..);
lavahasif commented 3 years ago

@yy1300326388 thank you . i just create android platform channel to overcome this error.thank you

myselfuser1 commented 1 year ago

Try this https://www.youtube.com/watch?v=uz43VmWWlkc