runable
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
import '../../data/datasources/settings_local_datasource.dart';
|
||||
import '../../../../core/database/hive_database.dart';
|
||||
import '../../data/models/app_settings_model.dart';
|
||||
|
||||
part 'settings_datasource_provider.g.dart';
|
||||
|
||||
/// Provider for settings local data source
|
||||
/// This is kept alive as it's a dependency injection provider
|
||||
@Riverpod(keepAlive: true)
|
||||
SettingsLocalDataSource settingsLocalDataSource(Ref ref) {
|
||||
final box = HiveDatabase.instance.getBox<AppSettingsModel>('settings');
|
||||
return SettingsLocalDataSourceImpl(box);
|
||||
}
|
||||
Reference in New Issue
Block a user