Skip to content

Commit

Permalink
Fix settings export as json (#498)
Browse files Browse the repository at this point in the history
Root cause was that sometimes lists were List<string> but other times
they were List<dynamic>.
The fix was broadening the comparison to just List because all Lists
saved to shared prefs are in fact lists of string.
  • Loading branch information
augustozanellato authored Jul 29, 2024
1 parent 3d98b11 commit f33fe38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chameleonultragui/lib/sharedprefsprovider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class SharedPreferencesProvider extends ChangeNotifier {
if (value == null) {
continue;
}
if (value is List<String>) {
if (value is List) {
// this hack is needed in order to output proper json with objects instead of objects-in-strings
value = value.map((e) => jsonDecode(e)).toList();
}
Expand Down

0 comments on commit f33fe38

Please sign in to comment.