Site icon Flutter Packages | Pub dev Packages – Flutter Mobile App World

Papercups.io Flutter chat widget

logo

Installing

To get started simply add papercups_flutter: and the latest version to your pubspec.yaml. Then run flutter pub get

 Done, It’s that simple.

Using the widget

Integration with your app requires just a few lines of code, add the following widget wherever you want your papercups chat window to be:

import 'package:papercups_flutter/papercups_flutter.dart';

PaperCupsWidget(
    props: Props(
    accountId: "xxxxxxxx-xxxxxxx-xxxx-xxxxxx", //Your account id goes here.
    ),
),
    

That should get you up and running in just a few seconds .

Configuration

Available PaperCupsWidget arguments

ParameterTypeValueDefault
propsPropsRequired, here is where all of the config for the chat is contained.N/A
dateLocaleStringLocale for the date, use the locales from the intl package."en-US"
timeagoLocaledynamicCheck https://github.com/andresaraujo/timeago.dart/tree/master/timeago/lib/src/messages for the available classes.N/A
sendingTextStringText to show while message is sending.Sending...
sentTextStringText to show when the messgae is sent.Sent
floatingSendMessageboolWether to have the message box floating.false

Available Props paramaters

PropTypeValueDefault
accountIdstringRequired, your Papercups account tokenN/A
titlestringThe title in the header of your chat widgetWelcome!
subtitlestringThe subtitle in the header of your chat widgetHow can we help you?
newMessagePlaceholderstringThe placeholder text in the new message inputStart typing…
primaryColorColorThe theme color of your chat widgetTheme.of(context).primaryColor without alpha
primaryGradientGradientGradient to specify, should be used instead of primaryColor, DO NOT USE BOTH.N/A
greetingstringAn optional initial message to greet your customers withN/A
customerCustomerMetadataIdentifying information for the customer, including nameemailexternal_id, and metadata (for any custom fields)N/A
baseUrlstringThe base URL of your API if you’re self-hosting Papercups. Ensure you do not include the protocol (https) of a trailing dash (/)app.papercups.io
requireEmailUpfrontbooleanIf you want to require unidentified customers to provide their email before they can message youfalse
companyNameStringCompany name to show on greeting"Bot"
enterEmailPlaceholerStringThis is the placeholder text in the email input section"Enter your email"

Available CustomerMetaData paramaters

ParametersTypeValueDefault
emailstringThe customer’s emailN/A
externalIdstringThe customer’s external IDN/A
namestringThe customer’s nameN/A
otherMetadataMap<String, String>Extra metadata to pass such as OS info.N/A

Download Flutter chat widget source code on GitHub

Papercups.io Flutter chat widget
https://github.com/papercups-io/papercups_flutter
26 forks.
28 stars.
7 open issues.

Recent commits:

Exit mobile version