Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class RootContainer extends StatelessWidget {
- final Widget child;
- RootContainer({this.child});
- @override
- Widget build(BuildContext context) {
- return StreamBuilder<OverlayAlert>(
- stream: ApiService.ThrottledException.stream,
- builder: (context, snapshot) {
- if (snapshot.connectionState == ConnectionState.active) {
- Future.delayed(Duration.zero, () => showAlert(context, snapshot));
- }
- return this.child;
- },
- );
- }
- void showAlert(BuildContext context, snapshot) {
- print("showing dialog");
- showDialog(
- context: context,
- builder: (context) => OverlayAlertDialog(snapshot),
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment