Giter Site home page Giter Site logo

furkansemiz / phspeechbubble Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nilsbacke/phspeechbubble

0.0 0.0 0.0 379 KB

A custom flutter widget for tooltips and popups within your flutter app based off of the red instagram notification popups.

License: MIT License

Java 10.51% Ruby 23.74% Objective-C 12.95% Dart 52.79%

phspeechbubble's Introduction

SpeechBubble

A flutter widget that emulates a speech bubble.

This widget is modeled after the red Instagram notification popups.

Screenshot

Installing

Dart Pub: https://pub.dartlang.org/packages/speech_bubble#-installing-tab-

  1. Depend on it

    Add this to your package's pubspec.yaml file:

  speech_bubble: ^0.0.5
  1. Install it

    You can install packages from the command line:

$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

  1. Import it

    Now in your Dart code, you can use:

import 'package:speech_bubble/speech_bubble.dart';

Usage

Creates a widget that emulates a speech bubble. Could be used for a tooltip, or as a pop-up notification, etc.

Properties

  • child -> Widget

The child contained by the SpeechBubble.

  • nipLocation -> NipLocation

The location of the nip of the speech bubble. Use the NipLocation enum, either TOP, RIGHT, BOTTOM, or LEFT. The nip will automatically center to the side that it is assigned.

  • color -> Color

The color of the body of the SpeechBubble and nip. Defaultly red.

  • borderRadius -> double

The borderRadius of the SpeechBubble. The SpeechBubble is built with a circular border radius on all 4 corners.

  • height -> double

The explicitly defined height of the SpeechBubble. The SpeechBubble will defaultly enclose its child.

  • width -> double

The explicitly defined width of the SpeechBubble. The SpeechBubble will defaultly enclose its child.

  • padding -> Widget

The padding widget between the child and the edges of the SpeechBubble.

Example Code

import 'package:flutter/material.dart';
import 'package:speech_bubble/speech_bubble.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Plugin example app'),
        ),
        body: new Center(
          child: new SpeechBubble(
            nipLocation: NipLocation.BOTTOM,
            // child: Column(
            //   mainAxisSize: MainAxisSize.min,
            //   children: <Widget>[
            //     Text("Give your users some guided instruction"),
            //     Text("From the inside of a Speech Bubble")
            //   ],
            // ),
            child: Row(
              mainAxisSize: MainAxisSize.min,
              children: <Widget>[
                Icon(
                  Icons.favorite,
                  color: Colors.white,
                ),
                Padding(
                  padding: const EdgeInsets.all(4.0),
                ),
                Text(
                  "1",
                  style: TextStyle(
                    color: Colors.white,
                    fontSize: 18.0,
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

phspeechbubble's People

Contributors

nilsbacke avatar vanethos avatar cristiancy96 avatar shinriyo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.