atlas_support_sdk 0.0.1 copy "atlas_support_sdk: ^0.0.1" to clipboard
atlas_support_sdk: ^0.0.1 copied to clipboard

outdated

Atlas customer support chat widget

Atlas customer support chat widget

Getting started #

To use it with Android you may need to ensure that AndroidManifest.xml includes <uses-permission android:name="android.permission.INTERNET" />

Usage #

Using the widget to add the chat

import 'package:atlas_support_sdk/atlas_support_widget.dart';

// Use widget:
AtlasSupportWidget(appId: "", userId: "", userHash: "")

Listening for stats changes

import 'package:atlas_support_sdk/watch_atlas_support_stats.dart';

// Listen:
class _MyWidgetState extends State<MyWidget> {
  int _unreadCount = 0;
  Function? _unsubscribe = null;

  @override
  void initState() {
    super.initState();
    _unsubscribe = watchAtlasSupportStats(
        appId: "",
        userId: "",
        userHash: "",
        onStatsChange: (stats) {
          setState(() {
            _unreadCount = stats['conversations']
                .fold(0, (sum, conversation) => sum + conversation['unread']);
          });
        });
  }

  @override
  void dispose() {
    _unsubscribe?.call();
    super.dispose();
  }

  // ...
}
0
likes
100
points
376
downloads

Publisher

unverified uploader

Weekly Downloads

Atlas customer support chat widget

Documentation

API reference

License

MIT (license)

Dependencies

flutter, http, web_socket_channel, webview_flutter, webview_flutter_android, webview_flutter_wkwebview

More

Packages that depend on atlas_support_sdk