@ -1,4 +1,5 @@
import ' dart:io ' ;
import ' dart:typed_data ' ;
import ' tl_scheme.dart ' ;
@ -188,7 +189,14 @@ String findFromJsonHandling(
objectPrefix: objectPrefix ,
varNameInsteadOfKeyName: ' e ' ,
) ;
return ' ( $ varAccess as List<dynamic>).map((e) => ( $ innerHandler )).toList(growable: false) ' ;
final innerType = findDartType (
tmp2 ,
scheme ,
abstractPrefix: abstractPrefix ,
functionPrefix: functionPrefix ,
objectPrefix: objectPrefix ,
) ;
return ' $ varAccess == null ? < $ innerType >[] : ( $ varAccess as List<dynamic>).map((e) => ( $ innerHandler )).toList(growable: false) ' ;
}
final predefined = {
@ -213,7 +221,7 @@ String findFromJsonHandling(
return " int.parse( $ varAccess ?? '0') " ;
}
else if ( type = = ' bytes ' ) {
return ' base64.decode($ varAccess ) ' ;
return ' $ varAccess == null ? Uint8List(0) : base64.decode($ varAccess ) ' ;
}
else {
return ' b.TdBase.fromJson( $ varAccess ) as ${ findDartType ( type , scheme , abstractPrefix: abstractPrefix , functionPrefix: functionPrefix , objectPrefix: objectPrefix ) } ' ;