swifty_chat
4.1.0, released 5 days ago by an unverified publisher
Flutter package to build chat UIs with multiple message kinds like text, image, HTML, and carousels.
What it does
Provides a comprehensive set of widgets and controllers to build chat interfaces supporting multiple message types, quick replies, carousels, custom messages, and built-in themes. It handles message rendering, scrolling, and input fields out of the box.
AI-written summary of version 4.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to quickly implement a chat interface with support for various message types like text, images, and HTML.
- You want built-in support for quick replies, carousels, and custom message rendering.
Skip it when
- You require a fully custom chat layout that drastically diverges from standard chat bubble paradigms.
- You are using a Flutter version older than 3.41.0.
Strengths
- Supports multiple message kinds including text, image, HTML, quick replies, and carousels.
- Includes M3 design system integration and responsive utilities.
- Provides a ChatController for imperative actions like scrolling to the bottom.
Weaknesses
- Requires a recent Flutter version (3.41.0 or later).
- Limited documentation outside of provided markdown files and example apps.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 7
not documented
import 'package:flutter/material.dart';
import 'package:swifty_chat/swifty_chat.dart';
void main() => runApp(const MaterialApp(home: ChatExample()));
class AppUser extends ChatUser {
AppUser(String name) : super(userName: name);
}
class AppMessage extends Message {
const AppMessage({
required super.user,
required super.id,
required super.isMe,
required super.messageKind,
required super.date,
});
}
class ChatExample extends StatefulWidget {
const ChatExample({super.key});
@override
State<ChatExample> createState() => _ChatExampleState();
}
class _ChatExampleState extends State<ChatExample> {
final _messages = <Message>[];
final _controller = ChatController();
final _me = AppUser('You');
@override
Widget build(BuildContext context) => Scaffold(
body: Chat(
controller: _controller,
messages: _messages,
chatMessageInputField: MessageInputField(
sendButtonTapped: (text) {
final now = DateTime.now();
setState(
() => _messages.insert(
0,
AppMessage(
user: _me,
id: now.microsecondsSinceEpoch.toString(),
isMe: true,
messageKind: MessageKind.text(text),
date: now,
),
),
);
_controller.scrollToBottom();
},
),
),
);
}Alternatives
Packages that do the same job and could replace swifty_chat.
- yaru
Flutter widgets and theme following the Yaru design language for desktop and web.
83Compare - simple_fontellico_progress_dialog
Renders a progress dialog with multiple types of customizable loading indicators.
48Compare
Works with
Packages commonly used together with swifty_chat: ones it builds on, ones built on it, and its own family.
- url_launcherswifty_chat depends on itFlutter plugin for launching URLs across mobile, desktop, and web platforms.
- equatableswifty_chat depends on itProvides value‑based equality for Dart objects without manual == and hashCode.
- material_uiswifty_chat depends on itOfficial Flutter Material UI library implementing Google’s Material Design system.
- cupertino_uiswifty_chat depends on itOfficial Flutter Cupertino design library implementing Apple HIG iOS and macOS user interfaces.
- flutter_animateswifty_chat depends on itAdd animated effects and builders in Flutter via a unified, customizable chainable API.
- flutter_widget_from_html_coreswifty_chat depends on itRender HTML content as native Flutter widgets with correctness and extensibility.
- jiffyswifty_chat depends on itParse, manipulate, query, and format dates and times in Dart and Flutter.