30 lines
709 B
Dart
30 lines
709 B
Dart
import '../assets/constants.dart' as constants;
|
|
|
|
class Settings {
|
|
final String exportDirectoryPath;
|
|
|
|
Settings._({required this.exportDirectoryPath});
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {'exportDirectoryPath': exportDirectoryPath};
|
|
}
|
|
|
|
factory Settings.fromJson(Map<String, dynamic> json) {
|
|
return Settings._(
|
|
exportDirectoryPath: json['exportDirectoryPath'] as String,
|
|
);
|
|
}
|
|
|
|
factory Settings.defaults() {
|
|
return Settings._(
|
|
exportDirectoryPath: constants.defaultAndroidExportDirectory,
|
|
);
|
|
}
|
|
|
|
Settings copyWith({String? exportDirectoryPath}) {
|
|
return Settings._(
|
|
exportDirectoryPath: exportDirectoryPath ?? this.exportDirectoryPath,
|
|
);
|
|
}
|
|
}
|