Skip to content

Instantly share code, notes, and snippets.

View DFelten's full-sized avatar

Daniel Felten DFelten

View GitHub Profile
@DFelten
DFelten / custom_stream_builder.dart
Last active July 19, 2019 10:46
Custom Stream Builder for Flutter BLoCs
import 'dart:async';
import 'package:flutter/material.dart';
class CustomStreamBuilder<State> extends StatelessWidget {
final Stream stream;
final Widget errorWidget;
final Widget initialWidget;
final Widget Function(BuildContext context, State state) builder;
CustomStreamBuilder({@required this.stream, @required this.builder, this.errorWidget, this.initialWidget});