balloon_widget 0.3.0 copy "balloon_widget: ^0.3.0" to clipboard
balloon_widget: ^0.3.0 copied to clipboard

Provide a simple balloon widget that can be placed widget tree

balloon_widget #

pub package github

a simple balloon widget.

nip_position_grid.png position_balloon.png borderRadius_balloon_color_grid.png include_nip_height_grid.png inner_padding_grid.png shadow_grid.png custom_shadow_grid.png nip_target_position_grid.png

Usage #

Use as a widget #

Balloon(
  child: Text('Hello, Balloon!'),
);

Use as a widget which placed at the specific widget. #

bool isVisible = true;

@override
Widget build(BuildContext context) {
  return PositionedBalloon( // if you want apply decoration on balloon widget, use `PositionedBalloon.decorateBuilder` widget.
    show: isVisible,
    balloon: Balloon(
      nipPosition: BalloonNipPosition.topCenter,
      child: Row(children: [
        Text("now go shopping, you got a event coin!"),
        IconButton(
            onPressed: () => setState(() => isVisible = false),
            icon: Icon(Icons.close)),
      ]),
      child: TextButton(
        onPressed: () {
          openUrl(this.goodsUrl);
          setState(() => isVisible = false);
        },
        text: Text("go shopping"),
      ),
    ),
  );
}

Use as a widget which placed at the specific widget and include button on the balloon widget. #

bool isVisible = true;

@override
Widget build(BuildContext context) {
  return BalloonTapDelegator(
      child: Scaffold(
          body: ListView(
              children: [
                PositionedBalloon(
                  show: isVisible,
                  balloon: Balloon(
                    nipPosition: BalloonNipPosition.topCenter,
                    child: Row(children: [
                      Text("now go shopping, you got a event coin!"),
                      IconButton(
                          onPressed: () => setState(() => isVisible = false),
                          icon: Icon(Icons.close)),
                      ]),
                  child: TextButton(
                      onPressed: () {
                          openUrl(this.goodsUrl);
                          setState(() => isVisible = false);
                      },
                      text: Text("go shopping"),
                  ))),
  ])));
}
8
likes
0
points
23
downloads

Publisher

verified publishernote11.dev

Weekly Downloads

Provide a simple balloon widget that can be placed widget tree

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

defer_pointer, flutter

More

Packages that depend on balloon_widget