scaffold_messenger_proxy 0.0.2 copy "scaffold_messenger_proxy: ^0.0.2" to clipboard
scaffold_messenger_proxy: ^0.0.2 copied to clipboard

discontinued
outdated

inject a widget into the widget tree that listens to a stream with a config and maps it to a SnackBar that is displayed - which enables to control the displaying of Snackbars from outside the widget tree

example/main.dart

import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:scaffold_messenger_proxy/scaffold_messenger_proxy.dart';

void main() {
  runApp(App());
}

class App extends StatelessWidget {
  final _streamController = StreamController<int>();

  @override
  Widget build(BuildContext context) {
    return ScaffoldMessengerProxy<int>(
      stream: _streamController.stream,
      snackBarBuilder: (_config) {
        return SynchronousFuture(
          SnackBar(
            content: Text("I am from a stream"),
          ),
        );
      },
      child: Scaffold(
        body: Center(
          child: Text("EXAMPLE"),
        ),
      ),
    );
  }
}
1
likes
140
points
2
downloads

Publisher

verified publisherquantumgray.tech

Weekly Downloads

inject a widget into the widget tree that listens to a stream with a config and maps it to a SnackBar that is displayed - which enables to control the displaying of Snackbars from outside the widget tree

Homepage
Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on scaffold_messenger_proxy