cpd_2022_zi/lib/providers/settings_provider.dart

23 lines
519 B
Dart
Raw Normal View History

2023-02-27 02:27:42 +01:00
import 'package:flutter/material.dart';
import 'package:smoke_cess_app/services/settings_service.dart';
import '../models/settings.dart';
class SettingsProvider extends ChangeNotifier {
Settings? _settings;
bool _initialized = false;
2023-02-27 02:27:42 +01:00
Settings? get settings => _settings;
bool get initialized => _initialized;
2023-02-27 02:27:42 +01:00
SettingsProvider() {
initSettings();
}
void initSettings() async {
_settings = await loadSettings();
_initialized = _settings != null ? true : false;
2023-02-27 02:27:42 +01:00
notifyListeners();
}
}