Skip to content

Instantly share code, notes, and snippets.

@salsolatragus
Created November 30, 2019 20:54
Show Gist options
  • Save salsolatragus/ac66e1808d4ccc43acf2d8735f97cf5a to your computer and use it in GitHub Desktop.
Save salsolatragus/ac66e1808d4ccc43acf2d8735f97cf5a to your computer and use it in GitHub Desktop.
Minimal Example to Reproduce Catcher/flutter_bloc issue
// dependencies:
// ...
// catcher: ^0.2.7
// flutter_bloc: ^2.1.1
import 'package:catcher/catcher_plugin.dart';
import 'package:catcher/core/catcher.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:bloc/bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
void main() => Catcher(
MyApp(),
debugConfig: CatcherOptions(
PageReportMode(),
[ConsoleHandler()]
)
);
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
title: 'Flutter Demo',
home: BlocBuilder<MyBloc, BlocState>(
bloc: MyBloc(),
builder: (BuildContext context, BlocState state) {
throw Exception();
},
),
);
}
}
abstract class BlocEvent {}
abstract class BlocState {}
class BlocInitState implements BlocState {}
class MyBloc extends Bloc<BlocEvent, BlocState> {
@override
BlocState get initialState => BlocInitState();
@override
Stream<BlocState> mapEventToState(BlocEvent event) {
return null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment