Skip to content

Commit 7db2936

Browse files
author
LavanyaA
authored
Merge pull request #2088 from sfHariHaraSudhan/master
Moved the chat widget related release source to flutter widgets.
2 parents f1b4bc1 + 6a27c3c commit 7db2936

File tree

135 files changed

+7761
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+7761
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## Unreleased
2+
3+
Initial release.
4+
5+
**Features**
6+
1. Messages - A list of ChatMessage objects that will be displayed in the chat interface as either incoming or outgoing messages, depending on the current user.
7+
2. Composer - The primary text editor where the user can compose new chat messages.
8+
3. Action button - This represents the send button, which invokes a callback with the text entered in the default composer.
9+
4. Placeholder - This allows you to specify a custom widget to display when there are no messages in the chat.
10+
5. Bubble - This holds each message's header, content, footer, and avatar.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Syncfusion License
2+
3+
Syncfusion Flutter Chat package is available under the Syncfusion Essential Studio program, and can be licensed either under the Syncfusion Community License Program or the Syncfusion commercial license.
4+
5+
To be qualified for the Syncfusion Community License Program you must have a gross revenue of less than one (1) million U.S. dollars ($1,000,000.00 USD) per year and have less than five (5) developers in your organization, and agree to be bound by Syncfusion’s terms and conditions.
6+
7+
Customers who do not qualify for the community license can contact [email protected] for commercial licensing options.
8+
9+
Under no circumstances can you use this product without (1) either a Community License or a commercial license and (2) without agreeing and abiding by Syncfusion’s license containing all terms and conditions.
10+
11+
The Syncfusion license that contains the terms and conditions can be found at
12+
https://www.syncfusion.com/content/downloads/syncfusion_license.pdf
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
![Syncfusion Flutter Chat banner](https://cdn.syncfusion.com/content/images/Flutter/chat/chat_pub_banner.png)
2+
3+
# Flutter Chat library
4+
5+
The [Flutter Chat](https://www.syncfusion.com/flutter-widgets/flutter-Chat?utm_source=pubdev&utm_medium=listing&utm_campaign=flutter-Chat-pubdev) package is a UI library designed to help you create a robust chat application within your Flutter projects.
6+
7+
## Overview
8+
* Offers a modern conversation UI to facilitate communication among users.
9+
* Displays both one-on-one and group conversations.
10+
* Provides a wide range of customization options for message content, headers, footers, avatars, editors, and action buttons.
11+
12+
**Disclaimer:** This is a commercial package. To use this package, you need to have either a Syncfusion commercial license or Free [Syncfusion Community license](https://www.syncfusion.com/products/communitylicense). For more details, please check the [LICENSE](https://github.com/syncfusion/flutter-examples/blob/master/LICENSE).
13+
14+
## Table of content:
15+
- [Chat Features](#chat-features)
16+
- [Get the demo application](#get-the-demo-application)
17+
- [Useful links](#other-useful-links)
18+
- [Installation](#installation)
19+
- [Flutter Chat example](#flutter-chat-example)
20+
- [Support and feedback](#support-and-feedback)
21+
- [About Syncfusion](#about-syncfusion)
22+
23+
## Chat Features:
24+
25+
**Placeholder:** Define a custom widget to show when there are no messages in the chat. This feature is especially beneficial for providing users with an engaging or pertinent message that signifies the conversation is currently empty.
26+
27+
**Composer:** This is the primary text editor where users can compose new chat messages. There is an option to define a custom widget to serve as a composer, allowing one or more widgets to provide multiple options for composing a message.
28+
29+
**Action button:** This is used for the Send button. Pressing this action button invokes the callback, where the outgoing user rebuilds the chat widget with their composed message. There is an option to define a custom widget consisting of one or more interactive widgets to serve as action buttons, such as a send button, microphone button, or file attachment button.
30+
31+
**Conversation:** This displays the content of incoming and outgoing messages. Each message includes details such as the message text, time stamp, and author. There is an option available to individually customize incoming and outgoing messages, providing a distinct appearance for each message type.
32+
33+
- **Incoming:** The content of incoming messages can be customize. Change the background color, content shape, and other features according to the message user or specific conditions.
34+
35+
- **Outgoing:** The content of outgoing messages can be customized. Change the background color, content shape, and other features according to the message user or specific conditions.
36+
37+
- **Header:** The header displays the username of the message's author along with the time stamp. Additionally, users can build a custom widget to display more information about the chat message.
38+
39+
- **Footer:** Define a custom widget to display additional information about the chat message, such as the time stamp or message delivery status.
40+
41+
- **Avatar:** The author's avatar displays either an image or the initials of their name. By default, if the avatar image source is not defined, the user's initials will be displayed. Additionally, users can create a custom widget that shows more information about them.
42+
43+
- **Content:** Users can customize the message content's background color, content shape, and other features based on the user or other specific conditions. By default, the text content is shown as not selectable, but there is an option to display the message content using a custom widget.
44+
45+
## Get the demo application
46+
47+
Explore the full capabilities of our Flutter widgets on your device by installing our sample browser applications from the below app stores, and view samples code in GitHub.
48+
49+
<p align="center">
50+
<a href="https://play.google.com/store/apps/details?id=com.syncfusion.flutter.examples"><img src="https://cdn.syncfusion.com/content/images/FTControl/google-play-store.png"/></a>
51+
<a href="https://flutter.syncfusion.com"><img src="https://cdn.syncfusion.com/content/images/FTControl/web-sample-browser.png"/></a>
52+
<a href="https://www.microsoft.com/en-us/p/syncfusion-flutter-gallery/9nhnbwcsf85d?activetab=pivot:overviewtab"><img src="https://cdn.syncfusion.com/content/images/FTControl/windows-store.png"/></a>
53+
</p>
54+
<p align="center">
55+
<a href="https://install.appcenter.ms/orgs/syncfusion-demos/apps/syncfusion-flutter-gallery/distribution_groups/release"><img src="https://cdn.syncfusion.com/content/images/FTControl/macos-app-center.png"/></a>
56+
<a href="https://snapcraft.io/syncfusion-flutter-gallery"><img src="https://cdn.syncfusion.com/content/images/FTControl/snap-store.png"/></a>
57+
<a href="https://github.com/syncfusion/flutter-examples"><img src="https://cdn.syncfusion.com/content/images/FTControl/github-samples.png"/></a>
58+
</p>
59+
60+
## Other useful links
61+
62+
Take a look at the following to learn more about the Syncfusion Flutter Chat.
63+
64+
* [Syncfusion Flutter Chat product page](https://www.syncfusion.com/flutter-widgets/flutter-chat)
65+
* [User guide documentation for Chat](https://help.syncfusion.com/flutter/chat)
66+
* [Knowledge base](https://www.syncfusion.com/kb)
67+
68+
## Installation
69+
70+
Add the [latest version](https://pub.dev/packages/syncfusion_flutter_chat/install) of [Syncfusion Flutter Chat](https://pub.dev/packages/syncfusion_flutter_chat) widget to your `pubspec.yaml` file..
71+
72+
## Flutter Chat example
73+
74+
Import Chat library using the code provided below.
75+
76+
```dart
77+
import 'package:syncfusion_flutter_chat/chat.dart';
78+
```
79+
### Add Chat widget
80+
81+
Initialize the Chat widget as a child of any widget.
82+
83+
```dart
84+
@override
85+
Widget build(BuildContext context) {
86+
return Scaffold(
87+
body: SfChat(),
88+
);
89+
}
90+
```
91+
92+
### Bind data source
93+
94+
To bind the message conversations to the `Chat` widget, the predefined data model class `ChatMessage` is used. This class contains three essential properties: `text`, `time`, and `author`, which are required for rendering a chat message. The following code snippet illustrates how to assign data to the `Chat` widget.
95+
96+
```dart
97+
late List<ChatMessage> _messages;
98+
99+
@override
100+
void initState() {
101+
_messages = <ChatMessage>[
102+
ChatMessage(
103+
text: 'Hello, how can I help you today?',
104+
time: DateTime.now(),
105+
author: const ChatAuthor(
106+
id: 'a2c4-56h8-9x01-2a3d',
107+
name: 'Incoming user name',
108+
),
109+
),
110+
];
111+
super.initState();
112+
}
113+
114+
@override
115+
Widget build(BuildContext context) {
116+
return SfChat(
117+
messages: _messages,
118+
outgoingUser: '8ob3-b720-g9s6-25s8',
119+
composer: const ChatComposer(
120+
decoration: InputDecoration(
121+
hintText: 'Type a message',
122+
),
123+
),
124+
actionButton: ChatActionButton(
125+
onPressed: (String newMessage) {
126+
setState(() {
127+
_messages.add(ChatMessage(
128+
text: newMessage,
129+
time: DateTime.now(),
130+
author: const ChatAuthor(
131+
id: '8ob3-b720-g9s6-25s8',
132+
name: 'Outgoing user name',
133+
),
134+
));
135+
});
136+
},
137+
),
138+
);
139+
}
140+
141+
@override
142+
void dispose() {
143+
_messages.clear();
144+
super.dispose();
145+
}
146+
```
147+
148+
The following output illustrates the result of the above code sample.
149+
150+
![Default Chat demo](https://cdn.syncfusion.com/content/images/Flutter/chat/chat_pub_getting_started_demo.gif)
151+
152+
## Support and feedback
153+
154+
* For questions, reach out to our [Syncfusion support team](https://support.syncfusion.com/support/tickets/create) or post them through the [Community forums](https://www.syncfusion.com/forums). Submit a feature request or a bug in our [Feedback portal](https://www.syncfusion.com/feedback/flutter).
155+
* To renew your subscription, click [renew](https://www.syncfusion.com/sales/products) or contact our sales team at [email protected] | Toll Free: 1-888-9 DOTNET.
156+
157+
## About Syncfusion
158+
159+
Founded in 2001 and headquartered in Research Triangle Park, N.C., Syncfusion has more than 20,000 customers and more than 1 million users, including large financial institutions, Fortune 500 companies, and global IT consultancies.
160+
161+
Today we provide 1,000+ controls and frameworks for web ([ASP.NET Core](https://www.syncfusion.com/aspnet-core-ui-controls), [ASP.NET MVC](https://www.syncfusion.com/aspnet-mvc-ui-controls), [ASP.NET WebForms](https://www.syncfusion.com/jquery/aspnet-web-forms-ui-controls), [JavaScript](https://www.syncfusion.com/javascript-ui-controls), [Angular](https://www.syncfusion.com/angular-ui-components), [React](https://www.syncfusion.com/react-ui-components), [Vue](https://www.syncfusion.com/vue-ui-components), [Flutter](https://www.syncfusion.com/flutter-widgets), and [Blazor](https://www.syncfusion.com/blazor-components)), mobile ([Xamarin](https://www.syncfusion.com/xamarin-ui-controls), [.NET MAUI](https://www.syncfusion.com/maui-controls), [Flutter](https://www.syncfusion.com/flutter-widgets), [UWP](https://www.syncfusion.com/uwp-ui-controls), and [JavaScript](https://www.syncfusion.com/javascript-ui-controls)), and desktop development ([Flutter](https://www.syncfusion.com/flutter-widgets), [WinForms](https://www.syncfusion.com/winforms-ui-controls), [WPF](https://www.syncfusion.com/wpf-ui-controls), [UWP](https://www.syncfusion.com/uwp-ui-controls), [.NET MAUI](https://www.syncfusion.com/maui-controls), and [WinUI](https://www.syncfusion.com/winui-controls)). We provide ready-to-deploy enterprise software for dashboards, reports, data integration, and big data processing. Many customers have saved millions in licensing fees by deploying our software.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include: package:syncfusion_flutter_core/analysis_options.yaml
2+
3+
analyzer:
4+
errors:
5+
todo: ignore
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# chat_example
2+
3+
A new Flutter project.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include: package:flutter_lints/flutter.yaml
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java
8+
9+
# Remember to never publicly share your keystore.
10+
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11+
key.properties
12+
**/*.keystore
13+
**/*.jks
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5+
id "dev.flutter.flutter-gradle-plugin"
6+
}
7+
8+
def localProperties = new Properties()
9+
def localPropertiesFile = rootProject.file("local.properties")
10+
if (localPropertiesFile.exists()) {
11+
localPropertiesFile.withReader("UTF-8") { reader ->
12+
localProperties.load(reader)
13+
}
14+
}
15+
16+
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
17+
if (flutterVersionCode == null) {
18+
flutterVersionCode = "1"
19+
}
20+
21+
def flutterVersionName = localProperties.getProperty("flutter.versionName")
22+
if (flutterVersionName == null) {
23+
flutterVersionName = "1.0"
24+
}
25+
26+
android {
27+
namespace = "com.syncfusion.chat_example"
28+
compileSdk = flutter.compileSdkVersion
29+
ndkVersion = flutter.ndkVersion
30+
31+
compileOptions {
32+
sourceCompatibility = JavaVersion.VERSION_1_8
33+
targetCompatibility = JavaVersion.VERSION_1_8
34+
}
35+
36+
defaultConfig {
37+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
38+
applicationId = "com.syncfusion.chat_example"
39+
// You can update the following values to match your application needs.
40+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
41+
minSdk = flutter.minSdkVersion
42+
targetSdk = flutter.targetSdkVersion
43+
versionCode = flutterVersionCode.toInteger()
44+
versionName = flutterVersionName
45+
}
46+
47+
buildTypes {
48+
release {
49+
// TODO: Add your own signing config for the release build.
50+
// Signing with the debug keys for now, so `flutter run --release` works.
51+
signingConfig = signingConfigs.debug
52+
}
53+
}
54+
}
55+
56+
flutter {
57+
source = "../.."
58+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
4+
to allow setting breakpoints, to provide hot reload, etc.
5+
-->
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
</manifest>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<application
3+
android:label="chat_example"
4+
android:name="${applicationName}"
5+
android:icon="@mipmap/ic_launcher">
6+
<activity
7+
android:name=".MainActivity"
8+
android:exported="true"
9+
android:launchMode="singleTop"
10+
android:taskAffinity=""
11+
android:theme="@style/LaunchTheme"
12+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
13+
android:hardwareAccelerated="true"
14+
android:windowSoftInputMode="adjustResize">
15+
<!-- Specifies an Android theme to apply to this Activity as soon as
16+
the Android process has started. This theme is visible to the user
17+
while the Flutter UI initializes. After that, this theme continues
18+
to determine the Window background behind the Flutter UI. -->
19+
<meta-data
20+
android:name="io.flutter.embedding.android.NormalTheme"
21+
android:resource="@style/NormalTheme"
22+
/>
23+
<intent-filter>
24+
<action android:name="android.intent.action.MAIN"/>
25+
<category android:name="android.intent.category.LAUNCHER"/>
26+
</intent-filter>
27+
</activity>
28+
<!-- Don't delete the meta-data below.
29+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
30+
<meta-data
31+
android:name="flutterEmbedding"
32+
android:value="2" />
33+
</application>
34+
<!-- Required to query activities that can process text, see:
35+
https://developer.android.com/training/package-visibility and
36+
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
37+
38+
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
39+
<queries>
40+
<intent>
41+
<action android:name="android.intent.action.PROCESS_TEXT"/>
42+
<data android:mimeType="text/plain"/>
43+
</intent>
44+
</queries>
45+
</manifest>

0 commit comments

Comments
 (0)