mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-25 19:21:38 +03:00
25 lines
720 B
Dart
25 lines
720 B
Dart
import 'dart:io';
|
|
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:logging/logging.dart';
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
// This must be initialized before use, in main.dart.
|
|
final prefProvider = Provider<SharedPreferences>((ref) {
|
|
throw UnimplementedError();
|
|
});
|
|
|
|
final logLevelProvider = StateNotifierProvider<LogLevelNotifier, Level>(
|
|
(ref) => LogLevelNotifier(Logger.root.level));
|
|
|
|
class LogLevelNotifier extends StateNotifier<Level> {
|
|
LogLevelNotifier(Level level) : super(level);
|
|
|
|
void setLogLevel(Level level) {
|
|
Logger.root.level = level;
|
|
state = level;
|
|
}
|
|
}
|
|
|
|
final isDesktop = Platform.isWindows || Platform.isMacOS || Platform.isLinux;
|