We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b93f5c3 commit 0386a16Copy full SHA for 0386a16
1 file changed
tools.py
@@ -222,7 +222,7 @@ def generate_code(work_bean):
222
out_res += (line + '\n')
223
if first and r'.fromParams({this.' in line:
224
class_name = line.split(r'.fromParams({this.')[0].strip()
225
- out_res += '\n factory %s(jsonStr) => jsonStr.runtimeType == String ? %s.fromJson(json.decode(jsonStr)) : %s.fromJson(jsonStr);\n' \
+ out_res += '\n factory %s(jsonStr) => jsonStr is String ? %s.fromJson(json.decode(jsonStr)) : %s.fromJson(jsonStr);\n' \
226
% (class_name, class_name, class_name)
227
first = False
228
return out_res
0 commit comments