
Now for some internet optimism.
at_chat_flutter
A flutter plugin to provide chat feature between two atsigns.
Getting Started
This plugin provides a chat screen - ChatScreen that can be accessed as a bottom sheet or as a navigated screen.
Initialising
The chat service needs to be initialised. It is expected that the app will first create an AtClientService instance using the preferences and then use it to initialise the chat service.
initializeChatService(
clientSdkService.atClientServiceInstance.atClient, activeAtSign,
rootDomain: MixedConstants.ROOT_DOMAIN);
Sample Usage
As a bottom sheet
FlatButton(
onPressed: () {
scaffoldKey.currentState
.showBottomSheet((context) => ChatScreen());
},
child: Container(
height: 40,
child: Text('Open chat in bottom sheet'),
),
),
As a screen
class ThirdScreen extends StatefulWidget {
@override
_ThirdScreenState createState() => _ThirdScreenState();
}
class _ThirdScreenState extends State<ThirdScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Chat Screen')),
body: ChatScreen(
height: MediaQuery.of(context).size.height,
incomingMessageColor: Colors.blue[100],
outgoingMessageColor: Colors.green[100],
isScreen: true,
),
);
}
}
Libraries
- at_chat_flutter
- models/message_model
- screens/chat_screen
- services/chat_service
- A service to handle save and retrieve operation on chat
- utils/colors
- utils/init_chat_service
- widgets/contacts_initials
- widgets/custom_circle_avatar
- widgets/incoming_message_bubble
- widgets/outgoing_message_bubble
- widgets/send_message