Refactor
This commit is contained in:
13
lib/core/database/converters/duration_converter.dart
Normal file
13
lib/core/database/converters/duration_converter.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
import 'package:drift/drift.dart';
|
||||
|
||||
class DurationTypeConverter extends TypeConverter<Duration, int> {
|
||||
@override
|
||||
Duration fromSql(int fromDb) {
|
||||
return Duration(seconds: fromDb);
|
||||
}
|
||||
|
||||
@override
|
||||
int toSql(Duration value) {
|
||||
return value.inSeconds;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user