import 'package:didvan/models/enums.dart';
import 'package:didvan/utils/action_sheet.dart';
import 'package:flutter/cupertino.dart';

class CoreProvier with ChangeNotifier {
  AppState _appState = AppState.busy;

  set appState(AppState newState) {
    if (newState == AppState.isolatedBusy) {
      ActionSheetUtils.showLogoLoadingIndicator();
    }
    if (_appState == AppState.isolatedBusy) {
      ActionSheetUtils.pop();
    }
    _appState = newState;
    notifyListeners();
  }

  void update() => notifyListeners();

  AppState get appState => _appState;
}
