Open GoldenSoju opened 3 years ago
It is better to use tryParse this way
if (Platform.isAndroid) { modifiedUrl = Uri.tryParse(url)?.toString()?.replaceAll('#', "%23"); } else { modifiedUrl = Uri.tryParse(url)?.toString(); }
or just use null check beforehand
Seems like a null-safety error. I think in social_share.dart you would have to change the code:
to
Otherwise you promise (= !) a URL that might not be given. So better replace the exclamation mark with question mark or check if URL is not null before running the parse part.