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

PiScale Chat official Flutter SDK. Build your own chat experience using Dart and Flutter.

Official Flutter packages for Communi Chat SDK #

Screenshots: #

[screenshot/home_screen.png] [screenshot/message_screen.png]

Important features #

  • Thread List
  • Chatting in a Thread;
  • Text message;
  • Multi message types (Image, Video, File, Sticker, ...);
  • Multi message actions (Reaction, Forward, Delete, Share, ...);
  • Create thread; ...

Getting Started #

Add Dependencies Add this to your package's pubspec.yaml file, use the latest version.

  dependencies:
    piscale_chat_flutter: ^latest_version

You should then run flutter packages get

Android You need to ask for these permissions. In Android version 10, open the manifest file and add this line to your application tag.

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.VIBRATE" />

IOS Your project need create with swift. Add the following keys to your Info.plist file.

<key>NSCameraUsageDescription</key>
<string>PiScale Chat would like to use your camera</string>
<key>NSMicrophoneUsageDescription</key>
<string>PiScale Chat would like to your microphone (for videos)</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>PiScale Chat would like access to your photo gallery</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>PiScale Chat would like access to your photo gallery</string>
<key>NSLocalNetworkUsageDescription</key>
<string>Looking for local tcp Bonjour service</string>

Sample Usage #


class MessagesPageExtra {
  final String? targetThreadId;
  final String? targetUserId;
  final int? targetMessageId;

  MessagesPageExtra({
    this.targetThreadId,
    this.targetUserId,
    this.targetMessageId,
  });
}

class MessagesPage extends StatelessWidget {
  final MessagesPageExtra extra;

  const MessagesPage({required this.extra});

  @override
  Widget build(BuildContext context) {
    return PSScaffoldSafeArea(
      child: PSMessages(
        targetThreadId: extra.targetThreadId,
        targetUserId: extra.targetUserId,
        targetMessageId: extra.targetMessageId,
        navigation: PSMessagesNavigationProvider(
          onBackPress: () {},
          onThreadProfilePress: (String threadId) {},
          onUrlPress: (String url) {},
          onEmailPress: (String email) {},
          onPhoneNumberPress: (String phoneNumber) {},
          onForwardMessage: (String threadId, List<int> messageIds) {},
          onMessagesPinnedPress: (String threadId) {},
          onViewFilePress: (String filePath) => OpenFilex.open(filePath),
          onUserPress: (String psUserId, String? currentThreadPartnerId) {},
          onShareMessagePress: (PSMessageModel message) {},
          onChatBotActionPress: (String uri) async {},
          onMediaPress: (List<PSMessageMediaModel> media, int? startIndex) {},
        ),
      ),
    );
  }
}

See the example directory for a complete sample app.