ezbloc_flutter
library
Functions
testBloc <R extends Bloc<S > , S > (dynamic description , {FutureVoidCallback ? setup , required BlocTestBloc <R > bloc , BlocCallback <R > ? expectBefore , BlocCallback <R > ? expectAfter , required StreamMatcher expectedStates , BlocCallback <R > ? job , BlocTestTransform <R , S , dynamic > ? transform , Duration timeout = const Duration(minutes: 1) , bool testDistinctStatesOnly = false })
→ void
Utility function which abstracts over a dart test to ease off bloc testing
Typedefs
ArgBlocBuilder <T , R >
= T Function(R arg )
Takes context and arg
, returns a Bloc
BlocCallback <R >
= Future <void > Function(R )
BlocListener
= void Function(BlocEventType type )
BlocTestBloc <R >
= Future <R > Function()
BlocTestTransform <R , S , T >
= T Function(R , S )
BlocTestVoidCallback
= void Function()
BlocWithArgBuilder <T >
= T Function(BuildContext ? context , dynamic arg )
Takes context
and arg
, returns a Bloc
BusyBuilder <T >
= Widget Function(BuildContext context , T? data )
This function takes a context
and data
of type T
and returns a widget
DataBuilder <T >
= Widget Function(BuildContext context , T data )
This function takes a context
and data
of type T
and returns a widget
Deserializer <T >
= T Function(dynamic o )
ErrorBuilder <T >
= Widget Function(BuildContext context , T? error )
This function takes a context
and an error
and returns a widget
FutureVoidCallback
= Future <void > Function()
GlobalBusyBuilder
= Widget Function(BuildContext context , Bloc bloc , Widget ? lastStateBuild )
This function takes a BuildContext , Bloc , and a Widget and returns a widget
GlobalErrorBuilder
= Widget Function(BuildContext context , Bloc bloc , Widget ? lastStateBuild )
This function takes a BuildContext , Bloc , and a Widget and returns a widget
Serializer <T >
= dynamic Function(T o )
ShouldSkip <T >
= bool Function(T pastState , T currentState )
This function takes pastState
and currentState