aberchat 0.0.1
aberchat: ^0.0.1 copied to clipboard
Realtime chat package with socket.io. You can easily integrate this package to your flutter app. This package is using socket.io for realtime communication. You can use this package for your chat app [...]
example/lib/main.dart
import 'package:aberchat/aberchat.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'AberChat',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'AberChat Example'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: RoomPage(
aberchatConfig: AberchatConfig(
appId: 'your-app-id',
apiKey: 'your-api-key',
roomId: 'your-room-id',
),
onReceivedEvent: (event) {
print(event);
},
),
);
}
}