Some checks failed
Flutter APK Build / Build Flutter APK (pull_request) Has been cancelled
25 lines
691 B
Dart
25 lines
691 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../model/settings.dart';
|
|
import 'storage.dart';
|
|
|
|
class SettingsProvider extends ChangeNotifier {
|
|
SettingsProvider() : _settings = Storage.loadSettings();
|
|
|
|
Settings _settings;
|
|
|
|
Settings get settings => _settings;
|
|
|
|
void setExportDirectoryPath(String path, {bool silent = false}) {
|
|
_settings = _settings.copyWith(exportDirectoryPath: path);
|
|
Storage.saveSettings(_settings);
|
|
if (!silent) notifyListeners();
|
|
}
|
|
|
|
void setAlwaysExportEnabled(bool enabled, {bool silent = false}) {
|
|
_settings = _settings.copyWith(alwaysExportEnabled: enabled);
|
|
Storage.saveSettings(_settings);
|
|
if (!silent) notifyListeners();
|
|
}
|
|
}
|