|
1 |
| -# flutter-ref-app-simple-chat |
| 1 | +# PubNub Chat App |
| 2 | + |
| 3 | +The Simple chat app demonstrates how to build a chat application using [PubNub Chat](https://www.pubnub.com/docs/chat/quickstart) and [PubNub Dart SDK](https://www.pubnub.com/docs/sdks/dart). Learn how to add private messaging and group messaging features in general chat application. Learn how to build features like send/receive messages, typing indicators, online members list. You can download the project to run on your local machine, and explore the code to see how we built it. |
| 4 | + |
| 5 | + |  |  | |
| 6 | +--- | ---- | ---- | |
| 7 | + |
| 8 | +The application uses [PubNub](https://www.pubnub.com/) service with [Dart SDK](https://pub.dev/packages/pubnub). |
| 9 | + |
| 10 | +## Prerequisites |
| 11 | + |
| 12 | +- [Flutter](https://flutter.dev/docs/get-started/install) |
| 13 | +- [PubNub Account](#pubnub-account) (*Free*) |
| 14 | + |
| 15 | +## PubNub Account |
| 16 | + |
| 17 | +To run this application you must obtain publish and subscribe keys from your PubNub Account. If you don't already have an account, you can [create one for free](https://dashboard.pubnub.com/). |
| 18 | + |
| 19 | +1. Sign in to your [PubNub Dashboard](https://dashboard.pubnub.com/). |
| 20 | + |
| 21 | +1. Click **Create New App**. |
| 22 | + |
| 23 | +1. Give your app a name, and select **Chat App** as the app type. |
| 24 | + |
| 25 | +1. Select a region to store your user data (e.g. *Portland*). |
| 26 | + |
| 27 | +1. Click **Create**. |
| 28 | + |
| 29 | +1. Click your new app to open its settings, then click its keyset. |
| 30 | + |
| 31 | +1. Locate the *Publish* and *Subscribe* keys. Include these keys in this project's `.env` file. |
| 32 | + |
| 33 | +## Running the project |
| 34 | + |
| 35 | +1. Clone the GitHub repository. |
| 36 | + |
| 37 | + ```bash |
| 38 | + git clone https://github.com/pubnub/flutter-ref-app-simple-chat.git |
| 39 | + ``` |
| 40 | + |
| 41 | +1. Add `.env` file with keyset values as described in `.env.sample`. |
| 42 | + |
| 43 | + ```dart |
| 44 | + PUBNUB_SUBSCRIBE_KEY="<Enter Your PubNub Publish Key Here>" |
| 45 | + PUBNUB_PUBLISH_KEY="<Enter Your PubNub Subscribe Key Here>" |
| 46 | + ``` |
| 47 | + |
| 48 | +1. Install the dependencies. |
| 49 | + |
| 50 | + ```bash |
| 51 | + cd flutter-ref-app-simple-chat |
| 52 | + flutter pub get |
| 53 | + ``` |
| 54 | + |
| 55 | +1. Start an simulator or connect your device and run application with selected device. |
| 56 | + |
| 57 | + ```bash |
| 58 | + flutter run |
| 59 | + ``` |
| 60 | + |
| 61 | +## Further Information |
| 62 | + |
| 63 | +Visit the [PubNub Dart SDK Docs](https://www.pubnub.com/docs/sdks/dart) page for more information about how to use PubNub Dart SDK. |
| 64 | +Please refer [Flutter Install](https://flutter.dev/docs/get-started/install) page for flutter framework and simulator setup. |
0 commit comments