import 'package:ambito/src/packages/ambito_theme/ambito_theme.dart';
import 'package:ambito/src/packages/ambito_theme/ambito_theme_medium.dart';
import 'package:flutter/cupertino.dart';

class ThemeManager with ChangeNotifier {
  AmbitoTheme? _themeData;

  Locale? _locale;

  /// Use this method on UI to get selected theme.
  AmbitoTheme? get themeData {
    _themeData ??= AmbitoThemeMedium();
    return _themeData;
  }

  Locale? get locale {
    _locale ??= const Locale('de');
    return _locale;
  }

  /// Sets theme and notifies listeners about change.
  setTheme(AmbitoTheme theme) async {
    _themeData = theme;
    notifyListeners();
  }

  /// Sets locale and notifies listeners about change
  setLocale(Locale locale) async {
    _locale = locale;
    notifyListeners();
  }
}
