chat_bubbles 0.7.5

  • Readme
  • Changelog
  • Example
  • Installing
  • 71

chat_bubbles plugin #

Chat bubble widgets, similar to the Whatsapp and more shapes. Easy to use and implement chat bubbles.

Getting Started #

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

dependencies:
  chat_bubbles: ^0.7.5

Usage #

Then you just have to import the package with

import 'package:chat_bubbles/chat_bubbles.dart'

Now you can use this plugin to implement various types of Chat Bubbles.

Example #

BubbleNormal(
    text: 'bubble normal with tail',
    isSender: false,
    color: Color(0xAF52FF8C),
    tail: true,
),
BubbleNormal(
    text: 'bubble normal with tail',
    isSender: true,
    color: Color(0xAF6AD0F5),
    tail: true,
),
BubbleNormal(
    text: 'bubble normal without tail',
    isSender: false,
    color: Color(0xAF52FF8C),
    tail: false,
),
BubbleNormal(
    text: 'bubble normal without tail',
    color: Color(0xAF6AD0F5),
    tail: false,
),
BubbleSpecialOne(
    text: 'bubble special one with tail',
    isSender: false,
    color: Color(0xAF52FF8C),
),
BubbleSpecialOne(
    text: 'bubble special one without tail',
    color: Color(0xAF6AD0F5),
),
BubbleSpecialOne(
    text: 'bubble special one with tail',
    isSender: false,
    tail: false,
    color: Color(0xAF52FF8C),
),
BubbleSpecialOne(
    text: 'bubble special one without tail',
    tail: false,
    color: Color(0xAF6AD0F5),
),
BubbleSpecialTwo(
    text: 'bubble special tow with tail',
    isSender: false,
    color: Color(0xAF52FF8C),
),
BubbleSpecialTwo(
    text: 'bubble special tow with tail',
    isSender: true,
    color: Color(0xAF6AD0F5),
),
BubbleSpecialTwo(
    text: 'bubble special tow without tail',
    isSender: false,
    tail: false,
    color: Color(0xAF52FF8C),
),
BubbleSpecialTwo(
    text: 'bubble special tow without tail',
    tail: false,
    color: Color(0xAF6AD0F5),
)

Issues #

Please feel free to let me know any issue regarding to this plugin.

[0.7.5] - 21/06/2020 #

  • Add message states(sent, delivered, seen) flag for BubbleNormal.
  • Update the example.

[0.7.1+6] - 17/05/2020 #

  • Update the example.

[0.7.1+5] - 10/05/2020 #

  • Update README.md file.

[0.7.1+4] - 10/05/2020 #

  • Update package description.

[0.7.1+3] - 09/05/2020 #

  • Update package description.

[0.7.1+2] - 09/05/2020 #

  • Update package description.

[0.7.1+1] - 09/05/2020 #

  • Update package description.

[0.7.1] - 09/05/2020 #

  • Update package description.

[0.7.0] - 09/05/2020 #

  • First release with an example.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'chat bubble example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'chat bubble example'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: SingleChildScrollView(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              BubbleNormal(
                text: 'bubble normal with tail',
                isSender: false,
                color: Color(0xAF6AD0F5),
                tail: true,
              ),
              BubbleNormal(
                text:
                    'bubble normal with tail bubble normal with tail bubble normal with tail back the',
                isSender: true,
                color: Color(0xFFE2FFC7),
                tail: true,
                sent: true,
              ),
              BubbleNormal(
                text: 'bubble normal without tail',
                isSender: false,
                color: Color(0xAF6AD0F5),
                tail: false,
              ),
              BubbleNormal(
                text: 'bubble normal without tail',
                color: Color(0xFFE2FFC7),
                tail: false,
                seen: true,
              ),
              BubbleSpecialOne(
                text: 'bubble special one with tail',
                isSender: false,
                color: Color(0xAF6AD0F5),
              ),
              BubbleSpecialOne(
                text: 'bubble special one with tail',
                color: Color(0xFFE2FFC7),
              ),
              BubbleSpecialOne(
                text: 'bubble special one without tail',
                isSender: false,
                tail: false,
                color: Color(0xAF6AD0F5),
              ),
              BubbleSpecialOne(
                text: 'bubble special one without tail',
                tail: false,
                color: Color(0xFFE2FFC7),
              ),
              BubbleSpecialTwo(
                text: 'bubble special tow with tail',
                isSender: false,
                color: Color(0xAF6AD0F5),
              ),
              BubbleSpecialTwo(
                text: 'bubble special tow with tail',
                isSender: true,
                color: Color(0xFFE2FFC7),
              ),
              BubbleSpecialTwo(
                text: 'bubble special tow without tail',
                isSender: false,
                tail: false,
                color: Color(0xAF6AD0F5),
              ),
              BubbleSpecialTwo(
                text: 'bubble special tow without tail',
                tail: false,
                color: Color(0xFFE2FFC7),
              ),
            ],
          ),
        ),
      ),
      // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  chat_bubbles: ^0.7.5

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:chat_bubbles/chat_bubbles.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
41
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
71
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [chat_bubbles] that is in a package requiring null.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test