at_chat_flutter 1.0.2
at_chat_flutter: ^1.0.2 copied to clipboard

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

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,
      ),
    );
  }
}
3
likes
90
pub points
67%
popularity

Publisher

atsign.org

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

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD (LICENSE)

Dependencies

at_client_mobile, at_common_flutter, at_commons, at_contact, at_lookup, flutter, pedantic

More

Packages that depend on at_chat_flutter