This commit is contained in:
kodjomoustapha 2025-01-09 15:24:55 +01:00
parent 6deffa4b97
commit fcb67ffd36
2 changed files with 13 additions and 2 deletions

View file

@ -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]

View file

@ -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(
@ -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;