at_chat_flutter 0.0.4
at_chat_flutter: ^0.0.4 copied to clipboard

Flutter Android iOS

A flutter plugin project to provide chat feature using atsigns and atprotocol.

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,
      ),
    );
  }
}
1
likes
80
pub points
54%
popularity

Publisher

atsign.org

A flutter plugin project to provide chat feature using atsigns and atprotocol.

Homepage

Documentation

API reference

License

BSD (LICENSE)

Dependencies

at_client_mobile, at_common_flutter, at_commons, at_contact, at_lookup, flutter

More

Packages that depend on at_chat_flutter