when concatenate null value to a string , it shows error how to solve this problem, please help

288 views
Skip to first unread message

Navas jaseer

unread,
Mar 14, 2021, 12:27:37 PM3/14/21
to Flutter Development (flutter-dev)
hi,

i have getting the error when am concatenting two strings , how to solve this problem 

here below the error message shows in console


"Unhandled Exception: Invalid argument(s) _StringBase.+ (dart:core-patch/string_patch.dart:267:57)"



regards,
navas jaseer

sow...@csdcorp.com

unread,
Mar 14, 2021, 5:39:58 PM3/14/21
to Flutter Development (flutter-dev)
You can use the ?? operator to provide a default, like so:

var str3 = (str1 ?? '') + (str2 ?? '');

Reply all
Reply to author
Forward
0 new messages