shelf
shelf copied to clipboard
Why is the parameter "context" of Response of Map<String, Object> type? Instead of Map<String, dynamic>?
Response.ok(
Object? body, {
Map<String, /* String | List<String> */ Object>? headers,
Encoding? encoding,
Map<String, Object>? context,
})
We didn't think it was important to support null, I guess. I don't remember
Is there a reason you want dynamic? Or are you just curious?
On Sun, Oct 30, 2022, 23:17 卡特皮勒 @.***> wrote:
Response.ok( Object? body, { Map<String, /* String | List<String> */ Object>? headers, Encoding? encoding, Map<String, Object>? context, })
— Reply to this email directly, view it on GitHub https://github.com/dart-lang/shelf/issues/303, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEFCQCPIKVZS33I2DMO4TWF5P6XANCNFSM6AAAAAARSYAYIY . You are receiving this because you are subscribed to this thread.Message ID: @.***>
return Response.ok('ok', context: {"user": user.toJson()});
return Response.ok('ok', context: user.toJson());
......
///UserBean
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
return data;
}
@kevmoo
😋I think this is elegant