Skip to content

Commit

Permalink
fix(mirai_edge_insets): replace List<num> by List<dynamic> and check …
Browse files Browse the repository at this point in the history
…if all elements are num
  • Loading branch information
superiorsd10 committed Feb 29, 2024
1 parent 6df274d commit 20bdd8b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ class MiraiEdgeInsets with _$MiraiEdgeInsets {
"right": json,
"bottom": json
};
} else if (json is List<num> && json.length == 4) {
} else if (json is List<dynamic> && json.length == 4) {
bool allElementsNum = json.every((element) => element is num);
if (!allElementsNum) {
throw ArgumentError('Invalid input format for MiraiEdgeInsets');
}
resultantJson = {
"left": json[0],
"top": json[1],
Expand Down

0 comments on commit 20bdd8b

Please sign in to comment.