Skip to content

Commit 8127a23

Browse files
committed
Fix lint hint "Static method should be a constructor"
1 parent c031f07 commit 8127a23

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lib/hive/service/database_service.dart

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,13 @@ class DatabaseService {
88
// Private constructor
99
DatabaseService._();
1010

11+
static final DatabaseService _instance = DatabaseService._();
12+
13+
static DatabaseService get instance => _instance;
14+
1115
static const String alarmBoxName = 'alarm_actions';
12-
static DatabaseService? _instance;
1316
late Box<AlarmAction> _alarmBox;
1417

15-
// Singleton instance getter
16-
static DatabaseService get instance {
17-
_instance ??= DatabaseService._();
18-
return _instance!;
19-
}
20-
2118
ValueListenable<Box<AlarmAction>> get alarmBoxListenable =>
2219
_alarmBox.listenable();
2320

0 commit comments

Comments
 (0)