veilidchat/lib/log/state_logger.dart

22 lines
512 B
Dart
Raw Normal View History

2023-01-08 22:27:33 -05:00
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'loggy.dart';
class StateLogger extends ProviderObserver {
const StateLogger();
@override
void didUpdateProvider(
ProviderBase provider,
Object? previousValue,
Object? newValue,
ProviderContainer container,
) {
log.debug('''{
provider: ${provider.name ?? provider.runtimeType},
oldValue: $previousValue,
newValue: $newValue
}
''');
super.didUpdateProvider(provider, previousValue, newValue, container);
}
}