Skip to content

Commit

Permalink
+
Browse files Browse the repository at this point in the history
  • Loading branch information
kodjodevf committed Jan 9, 2025
1 parent 6deffa4 commit fcb67ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/eval/javascript/http.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ class Client {
Future<String> _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]
Expand Down
7 changes: 6 additions & 1 deletion lib/modules/browse/extension/edit_code.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ class _CodeEditorPageState extends ConsumerState<CodeEditorPage> {

@override
Widget build(BuildContext context) {
final filterList = source != null ? getFilterList(source: source!) : [];
List<dynamic> filterList =
source != null ? getFilterList(source: source!) : [];
final appFontFamily = ref.watch(appFontFamilyProvider);
return Scaffold(
appBar: AppBar(
Expand Down Expand Up @@ -351,6 +352,10 @@ class _CodeEditorPageState extends ConsumerState<CodeEditorPage> {
ElevatedButton(
onPressed: () async {
if (source != null) {
setState(() {
filterList =
getFilterList(source: source!);
});
try {
if (filters.isEmpty) {
filters = filterList;
Expand Down

0 comments on commit fcb67ff

Please sign in to comment.