28 lines
618 B
Dart
28 lines
618 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'Models/managerContext.dart';
|
|
|
|
class AppContext with ChangeNotifier {
|
|
ManagerAppContext? _managerContext;
|
|
|
|
AppContext(this._managerContext);
|
|
|
|
getContext() => _managerContext;
|
|
setContext(ManagerAppContext appContext) async {
|
|
_managerContext = appContext;
|
|
|
|
// STORE IT LOCALLY (SQLite)
|
|
//await DatabaseHelper.instance.update(appContext);
|
|
|
|
// Store it in Firestore
|
|
//await FirestoreHelper.instance.add(appContext);
|
|
|
|
notifyListeners();
|
|
}
|
|
|
|
void setLocale(Locale locale) {
|
|
_managerContext?.locale = locale;
|
|
notifyListeners();
|
|
}
|
|
}
|