Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AhsanSarwar45 committed Dec 20, 2023
1 parent 144b01f commit 584a266
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 1 addition & 2 deletions lib/common/utils/list_storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ Future<String> saveRingtone(String id, String sourceUri) async {
}

String loadTextFileSync<T extends JsonSerializable>(String key) {
String appDataDirectory = getAppDataDirectoryPathSync();
File file = File(path.join(appDataDirectory, '$key.txt'));
File file = File(path.join(getAppDataDirectoryPathSync(), '$key.txt'));
try {
return file.readAsStringSync();
} catch (error) {
Expand Down
10 changes: 7 additions & 3 deletions lib/settings/types/setting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -452,13 +452,17 @@ class DynamicSelectSetting<T extends ListItem> extends Setting<int> {
this.optionsGetter, {
void Function(BuildContext, int)? onChange,
String description = "",
int defaultValue = 0,
int defaultValue = -1,
bool isVisual = true,
bool shouldCloseOnSelect = true,
List<SettingEnableConditionParameter> enableConditions = const [],
List<String> searchTags = const [],
}) : super(name, description, optionsGetter()[defaultValue].value.id,
onChange, enableConditions, searchTags, isVisual);
}) : super(name, description, defaultValue, onChange, enableConditions,
searchTags, isVisual) {
if (defaultValue != -1) {
_value = getIdAtIndex(defaultValue);
}
}

@override
DynamicSelectSetting<T> copy() {
Expand Down

0 comments on commit 584a266

Please sign in to comment.