Migrate type converter sample to null safety

This commit is contained in:
Simon Binder 2021-05-17 22:14:07 +02:00
parent 371e744288
commit c40bfc9f4c
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
1 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ a `TypeConverter` for that:
class PreferenceConverter extends TypeConverter<Preferences, String> {
const PreferenceConverter();
@override
Preferences mapToDart(String fromDb) {
Preferences? mapToDart(String? fromDb) {
if (fromDb == null) {
return null;
}
@ -52,7 +52,7 @@ class PreferenceConverter extends TypeConverter<Preferences, String> {
}
@override
String mapToSql(Preferences value) {
String? mapToSql(Preferences? value) {
if (value == null) {
return null;
}