File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -532,7 +532,9 @@ Future<Response> _get(RequestContext context) async {
532
532
533
533
Future<Response> _post(RequestContext context) async {
534
534
final dataSource = context.read<TodosDataSource>();
535
- final todo = Todo.fromJson(await context.request.json());
535
+ final todo = Todo.fromJson(
536
+ await context.request.json() as Map<String, dynamic>,
537
+ );
536
538
537
539
return Response.json(
538
540
statusCode: HttpStatus.created,
@@ -599,7 +601,9 @@ Future<Response> _get(RequestContext context, Todo todo) async {
599
601
600
602
Future<Response> _put(RequestContext context, String id, Todo todo) async {
601
603
final dataSource = context.read<TodosDataSource>();
602
- final updatedTodo = Todo.fromJson(await context.request.json());
604
+ final updatedTodo = Todo.fromJson(
605
+ await context.request.json() as Map<String, dynamic>,
606
+ );
603
607
final newTodo = await dataSource.update(
604
608
id,
605
609
todo.copyWith(
You can’t perform that action at this time.
0 commit comments