We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This option work like int.tryParse() that will return int?.
int.tryParse()
Where are these?
JsonDecoder().tryConvert(data); JsonEncoder().tryConvert(data);
I can create this by
class Json { static String? tryEncode(data) { try { return jsonEncode(data); } catch (e) { return null; } } static dynamic tryDecode(data) { try { return jsonDecode(data); } catch (e) { return null; } } } void main() { String? jsonEncode = Json.tryEncode(dataEncoded); dynamic jsonDecode = Json.tryDecode(dataDecoded); print("jsonEncode: $jsonEncode"); print("jsonDecode: $jsonDecode"); }
However, I'm uncomfortable with this. Is it impossible to add this function?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This option work like
int.tryParse()
that will return int?.Where are these?
I can create this by
However, I'm uncomfortable with this.
Is it impossible to add this function?
The text was updated successfully, but these errors were encountered: