Added new combined chart on home

This commit is contained in:
Juan Gilsanz Polo 2023-05-20 22:57:38 +02:00
parent 8ca59d26c7
commit cf5af1061f
10 changed files with 506 additions and 25 deletions

View file

@ -41,6 +41,8 @@ class AppConfigProvider with ChangeNotifier {
int _showIpLogs = 0;
int _combinedChartHome = 0;
String? _doNotRememberVersion;
GitHubRelease? _appUpdatesAvailable;
@ -129,6 +131,10 @@ class AppConfigProvider with ChangeNotifier {
return _showIpLogs == 1 ? true : false;
}
bool get combinedChartHome {
return _combinedChartHome == 1 ? true : false;
}
String? get doNotRememberVersion {
return _doNotRememberVersion;
}
@ -315,6 +321,22 @@ class AppConfigProvider with ChangeNotifier {
}
}
Future<bool> setCombinedChartHome(bool value) async {
final updated = await updateConfigQuery(
db: _dbInstance!,
column: 'combinedChart',
value: value == true ? 1 : 0
);
if (updated == true) {
_combinedChartHome = value == true ? 1 : 0;
notifyListeners();
return true;
}
else {
return false;
}
}
Future<bool> setStaticColor(int value) async {
final updated = await updateConfigQuery(
db: _dbInstance!,
@ -349,6 +371,7 @@ class AppConfigProvider with ChangeNotifier {
_useThemeColorForStatus = dbData['useThemeColorForStatus'] != null ? convertFromIntToBool(dbData['useThemeColorForStatus'])! : false;
_showTimeLogs = dbData['showTimeLogs'];
_doNotRememberVersion = dbData['doNotRememberVersion'];
_combinedChartHome = dbData['combinedChart'];
_dbInstance = dbInstance;
notifyListeners();