ConnectionBuilder constructor
ConnectionBuilder({
- Key? key,
- ConnectionBloc? bloc,
- WidgetBuilder? onOnline,
- WidgetBuilder? onOffline,
Implementation
ConnectionBuilder({
super.key,
super.bloc,
WidgetBuilder? onOnline,
WidgetBuilder? onOffline,
}) : super(
builder: (BuildContext context, Connection state) {
switch (state) {
case Connection.online:
return onOnline?.call(context) ?? const SizedBox.shrink();
case Connection.offline:
return onOffline?.call(context) ?? const SizedBox.shrink();
}
},
);