I am getting this issue while trying to run my code on DartPad.
'runZoned' is deprecated and shouldn't be used. This will be removed in v9.0.0. Use Bloc.Bloc.transformer instead...
What is the correct way to replace it?
code:
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
void main() {
BlocOverrides.runZoned(
() => runApp(const App()),
blocObserver: AppBlocObserver(),
);
}
/// Custom [BlocObserver] that observes all bloc and cubit state changes.
class AppBlocObserver extends BlocObserver {
@override
void onChange(BlocBase bloc, Change change) {
super.onChange(bloc, change);
if (bloc is Cubit) print(change);
}
@override
void onTransition(Bloc bloc, Transition transition) {
super.onTransition(bloc, transition);
print(transition);
}
}