mobile_chat_ui 0.0.7 copy "mobile_chat_ui: ^0.0.7" to clipboard
mobile_chat_ui: ^0.0.7 copied to clipboard

outdated

A fully customizable modern chat UI for Android, IOS and web developers.


Mobile Chat UI

A fully customizable modern chat UI for Android, IOS and web developers.


Chat Image


Getting Started #

Requirements #

Dart >=2.17.0 and Flutter >=2.0.0

First run the following command in your terminal:

flutter pub add mobile_chat_ui

Usage #

import 'package:mobile_chat_ui/mobile_chat_ui.dart';

return Scaffold(
    appBar: AppBar(
    title: const Center(child: Text("Mobile Chat UI"))),
    body: Chat(
        user: loggedInUser,
        messages: messages,
        theme: DefaultChatTheme(
          userAvatarRadius: 12,
        ),
        showUserAvatar: true,
        input: const ChatInput(),
    ),
);

Messages #

The messages variable is a list of type Message which subTypes of:

  • TextMessage
  • AudioMessage
  • ImageMessage
  • ActionMessage
  • DocumentMessage
  • TimestampMessage
import 'package:mobile_chat_ui/models/messages/message.dart';
import 'package:mobile_chat_ui/models/messages/types.dart';

List<Message> messages = [
    TimeStampMessage(displayTime: "Today"),
    TextMessage(
        author: users[Random().nextInt(users.length)],
        time: "12:00 PM",
        text:
            "Hello house, we shall be having a brief meeting in this group tonight by 8:00pm UTC."),
    ActionMessage(
        author: users[Random().nextInt(users.length)],
        time: "now",
        text: "Victor Aniedi joined the group chat via group invite link"),
    ImageMessage(
        author: users[Random().nextInt(users.length)],
        time: "12:00 PM",
        imageUrl:
            "https://images.unsplash.com/photo-1493612276216-ee3925520721?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8MXx8cmFuZG9tfGVufDB8fDB8fA%3D%3D&w=1000&q=80",
        caption:
            "Mollit tempor ea quis laborum ipsum velit ea elit sunt nisi. Ipsum amet commodo sint magna velit in sint eu ipsum reprehenderit in incididunt sint fugiat. Consectetur sit laborum commodo cupidatat. Velit aliquip minim officia consequat. Nisi eu Lorem proident incididunt."),
    DocumentMessage(
        author: users[Random().nextInt(users.length)],
        time: "12:28 PM",
        documentFormat: "DOCX",
        documentSize: "32 kb",
        documentName: "Brief Project Real Estate Landing Page",
    ),
];

The author parameter of a message should receive a type User

User #

Declare a User object with the example below

import 'package:mobile_chat_ui/models/user.dart';

User loggedInUser = User(
    id: "GtIqnUfq0KY5GfR6mD25jlVyNlDdl",
    name: "Putra Silas",
    avatarUrl: "https://randomuser.me/api/portraits/women/92.jpg",
);
25
likes
0
points
71
downloads

Publisher

unverified uploader

Weekly Downloads

A fully customizable modern chat UI for Android, IOS and web developers.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

audio_wave, cached_network_image, flutter, flutter_linkify, iconify_flutter, url_launcher

More

Packages that depend on mobile_chat_ui