isJson function
Checks if the string is valid JSON.
Uses Dart's JsonDecoder to validate if the string can be parsed as proper JSON.
Empty strings are considered invalid JSON.
Returns true if the string contains valid JSON, otherwise returns false.
Example:
isJson('{"name":"John", "age":30}'); // true
isJson('[1, 2, 3]'); // true
isJson('"hello"'); // true (valid JSON string)
isJson('{ invalid json }'); // false
isJson(''); // false (empty string)
Implementation
bool isJson(String str) => _isJson(str);