-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from nucleus-ffm/addMoreNotificationSettings
Add more notification settings
- Loading branch information
Showing
27 changed files
with
824 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import 'package:foss_warn/enums/Severity.dart'; | ||
import 'package:foss_warn/enums/WarningSource.dart'; | ||
|
||
/// to store the chosen notificationLevel for a warningSource | ||
class NotificationPreferences { | ||
Severity notificationLevel; | ||
bool disabled; | ||
WarningSource warningSource; | ||
|
||
NotificationPreferences( | ||
{required this.warningSource, required this.notificationLevel, this.disabled = false}); | ||
|
||
factory NotificationPreferences.fromJson(Map<String, dynamic> json) { | ||
return NotificationPreferences( | ||
warningSource: WarningSource.fromString(json['warningSource'].toString()), | ||
disabled: json['disabled'], | ||
notificationLevel: | ||
Severity.fromJson(json['notificationLevel'])); | ||
} | ||
|
||
Map<String, dynamic> toJson() => { | ||
'notificationLevel': notificationLevel.toJson(), | ||
'disabled': disabled, | ||
'warningSource': warningSource.toJson(), | ||
}; | ||
} |
Oops, something went wrong.