swifty_chat 1.6.5 copy "swifty_chat: ^1.6.5" to clipboard
swifty_chat: ^1.6.5 copied to clipboard

A Flutter package to quickly get started building Chat UIs with different type of message kinds.

example/lib/main.dart

import 'package:example/advanced_chat.dart';
import 'package:example/basic_chat.dart';
import 'package:example/custom_message_kind_chat.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  // ignore: library_private_types_in_public_api
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Chat',
      debugShowCheckedModeBanner: false,
      routes: {
        '/': (_) => const Home(),
        '/basic-chat': (_) => const BasicChat(key: Key('basic_chat')),
        '/advanced-chat': (_) => const AdvancedChat(key: Key('advanced_chat')),
        '/custom-message-kind-chat': (_) =>
            const CustomMessageKindChat(key: Key('custom_message_kind_chat')),
      },
    );
  }
}

final class Home extends StatelessWidget {
  const Home({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: ListView(
        children: [
          const Divider(color: Colors.white70),
          ListTile(
            key: const Key('basic_chat_item'),
            title: const Text('Basic Chat'),
            trailing: const Icon(Icons.keyboard_arrow_right_rounded),
            onTap: () => Navigator.of(context).pushNamed('/basic-chat'),
          ),
          const Divider(color: Colors.white70),
          ListTile(
            key: const Key('advanced_chat_item'),
            title: const Text('Advanced Chat'),
            trailing: const Icon(Icons.keyboard_arrow_right_rounded),
            onTap: () => Navigator.of(context).pushNamed('/advanced-chat'),
          ),
          const Divider(color: Colors.white70),
          ListTile(
            key: const Key('custom_message_chat_item'),
            title: const Text('Custom Message Chat'),
            trailing: const Icon(Icons.keyboard_arrow_right_rounded),
            onTap: () =>
                Navigator.of(context).pushNamed('/custom-message-kind-chat'),
          ),
        ],
      ),
    );
  }
}
14
likes
140
pub points
24%
popularity

Publisher

unverified uploader

A Flutter package to quickly get started building Chat UIs with different type of message kinds.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

carousel_slider, flutter, flutter_html, jiffy, styled_widget, swifty_chat_data, url_launcher

More

Packages that depend on swifty_chat