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; bool _scanning = false; Settings? get settings => _settings; bool get initialized => _initialized; bool get scanning => _scanning; set scanning(bool value) { _scanning = value; notifyListeners(); } SettingsProvider() { initSettings(); } Future initSettings() async { _settings = await loadSettings(); _initialized = _settings != null ? true : false; notifyListeners(); } }