import 'package:json_annotation/json_annotation.dart'; part 'MessageBean2.g.dart'; @JsonSerializable(explicitToJson: true) class MessageBean2{ String? sender_type; String? sender_name; String? text; MessageBean2(this.sender_type,this.sender_name,this.text); factory MessageBean2.fromJson(Map json) => _$MessageBean2FromJson(json); Map toJson() => _$MessageBean2ToJson(this); }