diff --git a/lib/eval/javascript/http.dart b/lib/eval/javascript/http.dart index 2ad8ead6..a37fc7c5 100644 --- a/lib/eval/javascript/http.dart +++ b/lib/eval/javascript/http.dart @@ -83,7 +83,13 @@ class Client { Future _toHttpResponse(Client client, String method, List args) async { final url = args[2] as String; final headers = (args[3] as Map?)?.toMapStringString; - final body = args.length >= 5 ? (args[4] as Map?)?.toMapStringDynamic : null; + final body = args.length >= 5 + ? args[4] is List + ? args[4] as List + : args[4] is String + ? args[4] as String + : (args[4] as Map?)?.toMapStringDynamic + : null; var request = http.Request(method, Uri.parse(url)); request.headers.addAll(headers ?? {}); if ((request.headers[HttpHeaders.contentTypeHeader] diff --git a/lib/modules/browse/extension/edit_code.dart b/lib/modules/browse/extension/edit_code.dart index 96128934..1b5ca26c 100644 --- a/lib/modules/browse/extension/edit_code.dart +++ b/lib/modules/browse/extension/edit_code.dart @@ -135,7 +135,8 @@ class _CodeEditorPageState extends ConsumerState { @override Widget build(BuildContext context) { - final filterList = source != null ? getFilterList(source: source!) : []; + List filterList = + source != null ? getFilterList(source: source!) : []; final appFontFamily = ref.watch(appFontFamilyProvider); return Scaffold( appBar: AppBar( @@ -351,6 +352,10 @@ class _CodeEditorPageState extends ConsumerState { ElevatedButton( onPressed: () async { if (source != null) { + setState(() { + filterList = + getFilterList(source: source!); + }); try { if (filters.isEmpty) { filters = filterList;