1651709340
Kommunicate Flutter plugin
Flutter wrapper using the native modules of Kommunicate Android and iOS SDKs.
dependencies:
//other dependencies
kommunicate_flutter: ^1.4.5
flutter pub get
import 'package:kommunicate_flutter/kommunicate_flutter.dart';
pod install
Note: Kommunicate iOS requires min ios platform version 12 and uses dynamic frameworks. Make sure you have the below settings at the top of your ios/Podfile:
platform :ios, '12.0'
use_frameworks!
Sign up for Kommunicate to get your APP_ID. This APP_ID is used to create/launch conversations.
Kommunicate provides buildConversation function to create and launch chat directly saving you the extra steps of authentication, creation, initialization and launch. You can customize the process by building the conversationObject according to your requirements. To launch the chat you need to create a conversation object. This object is passed to the buildConversation
function and based on the parameters of the object the chat is created/launched.
Below are some examples to launch chat in different scenarios:
If you would like to launch the chat directly without the visiting user entering any details, then use the method as below:
try {
dynamic conversationObject = {
'appId': '<APP_ID>' // The [APP_ID](https://dashboard.kommunicate.io/settings/install) obtained from kommunicate dashboard.
};
dynamic result = await KommunicateFlutterPlugin.buildConversation(conversationObject);
print("Conversation builder success : " + result.toString());
} on Exception catch (e) {
print("Conversation builder error occurred : " + e.toString());
}
If you need the user to fill in details like phone number, emailId and name before starting the support chat then launch the chat with withPreChat
flag as true. In this case you wouldn't need to pass the kmUser. A screen would open up for the user asking for details like emailId, phone number and name. Once the user fills the valid details (atleast emailId or phone number is required), the chat would be launched. Use the function as below:
try {
dynamic conversationObject = {
'appId': '<APP_ID>',// The [APP_ID](https://dashboard.kommunicate.io/settings/install) obtained from kommunicate dashboard.
'withPreChat': true
};
dynamic result = await KommunicateFlutterPlugin.buildConversation(conversationObject);
print("Conversation builder success : " + result.toString());
} on Exception catch (e) {
print("Conversation builder error occurred : " + e.toString());
}
If you already have the user details then create a KMUser object using the details and launch the chat. Use the method as below to create KMUser with already existing details:
try {
dynamic user = {
'userId' : '<USER_ID>', //Replace it with the userId of the logged in user
'password' : '<PASSWORD>' //Put password here if user has password, ignore otherwise
};
dynamic conversationObject = {
'appId': '<APP_ID>',// The [APP_ID](https://dashboard.kommunicate.io/settings/install) obtained from kommunicate dashboard.
'kmUser': jsonEncode(user)
};
dynamic result = await KommunicateFlutterPlugin.buildConversation(conversationObject);
print("Conversation builder success : " + result.toString());
} on Exception catch (e) {
print("Conversation builder error occurred : " + e.toString());
}
Note:
jsonEncode
requires the dart packagedart:convert
. Make sure you have imported the package at the top of the dart file asimport 'dart:convert';
If you have a different use-case and would like to customize the chat creation, user creation and chat launch, you can use more parameters in the conversationObject.
Below are all the parameters you can use to customize the conversation according to your requirements:
Parameter | Type | Description |
---|---|---|
appId | String | The APP_ID obtained from kommunicate dashboard |
groupName | String | Optional, you can pass a group name or ignore |
kmUser | KMUser | Optional, Pass the details if you have the user details, ignore otherwise. The details you pass here are used only the first time, to login the user. These login details persists until the app is uninstalled or you call logout. |
withPreChat | boolean | Optional, Pass true if you would like the user to fill the details before starting the chat. If you have user details then you can pass false or ignore. |
isSingleConversation | boolean | Optional, Pass true if you would like to create only one conversation for every user. The next time user starts the chat the same conversation would open, false if you would like to create a new conversation everytime the user starts the chat. True is recommended for single chat |
metadata | dynamic | Optional. This metadata if set will be sent with all the messages sent from that device. Also this metadata will be set to the conversations created from that device. |
agentIds | List | Optional, Pass the list of agents you want to add in this conversation. The agent ID is the email ID with which your agent is registered on Kommunicate. You may use this to add agents to the conversation while creating the conversation. Note that, conversation assignment will be done on the basis of the routing rules set in the Conversation Rules section. Adding agent ID here will only add the agents to the conversation and will not alter the routing rules. |
botIds | List | Optional, Pass the list of bots you want to add in this conversation. Go to bots -> Manage Bots -> Copy botID . Ignore if you haven't integrated any bots. You may use this to add any number of bots to the conversation while creating the conversation. Note that this has no effect on the conversation assignee, as the Conversation Rules set forth in the Dashboard will prevail. |
createOnly | boolean | Optional. Pass true if you need to create the conversation and not launch it. In this case you will receive the clientChannelKey of the created conversation in the success callback function. |
You can set the data you want to send to the bot platform by calling the updateChatContext
method as below:
dynamic chatContext = {
'key': 'value',
'objKey': {
'objKey1' : 'objValue1',
'objKey2' : 'objValue2'
}
};
KommunicateFlutterPlugin.updateChatContext(chatContext);
You can update some details of the logged in user like displayName, imageUrl, metadata etc. Use the updateUserDetail
method as below (Remove the fields from the userDetails object below, which you don't want to update):
try {
dynamic userDetails = {
'displayName': '<New Name>',
'imageLink': '<new-image-url>',
'email': '<New-Email>',
'contactNumber': '<New-Contact-Number>'
'metadata': {
'objKey1' : 'objValue1',
'objKey2' : 'objValue2'
}
};
KommunicateFlutterPlugin.updateUserDetail(userDetails);
} on Exception catch (e) {
print("Error occured while updating userDetails : " + e.toString());
}
Note: userId
is a unique identifier of a kmUser object. It cannot be updated.
You can call the logout
method to logout the user from kommunicate. Use the method as below:
KommunicateFlutterPlugin.logout();
Here is the sample app which implements this SDK: https://github.com/Kommunicate-io/Kommunicate-Flutter-Plugin/tree/master/example
Dialogflow is a Google-owned NLP platform to facilitate human-computer interactions such as chatbots, voice bots, etc.
Kommunicate's Dialogflow integration provides a more versatile, customizable and better chatting experience. Kommunicate Flutter Live Chat SDK supports all of Dialogflow's features such as Google Assistant, Rich Messaging, etc. On top of that, it is equipped with advanced features such as bot-human handoff, conversation managing dashboard, reporting, and others.
You can connect your Dialogflow chatbot with Kommunicate in the following 3 simple steps. Here is a step by step blog to add Kommunicate SDK in your Flutter app.
Create a free account on Kommunicate and navigate to the Bots section.
You can add the Kommunicate SDK in your Flutter app easily. More information on how to integrate with your Flutter app here.
Note: Here's a sample chatbot for you to get started with Dialogflow.
Run this command:
With Flutter:
$ flutter pub add kommunicate_flutter
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get
):
dependencies:
kommunicate_flutter: ^1.4.5
Alternatively, your editor might support flutter pub get
. Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:kommunicate_flutter/kommunicate_flutter.dart';
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:kommunicate_flutter/kommunicate_flutter.dart';
import 'package:kommunicate_flutter_plugin_example/AppConfig.dart';
import 'package:kommunicate_flutter_plugin_example/prechat.dart';
import 'home.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
}
@override
void dispose() {
// Clean up the controller when the widget is disposed.
super.dispose();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
backgroundColor: Color(0xff5c5aa7),
title: const Text('Kommunicate sample app'),
),
body: LoginPage(),
),
);
}
}
// ignore: must_be_immutable
class LoginPage extends StatelessWidget {
TextEditingController userId = new TextEditingController();
TextEditingController password = new TextEditingController();
void loginUser(context) {
dynamic user = {
'userId': 'amanxcv',
//'password': '',
'appId': AppConfig.APP_ID
};
KommunicateFlutterPlugin.login(user).then((result) {
Navigator.pop(context);
Navigator.push(
context, MaterialPageRoute(builder: (context) => HomePage()));
print("Login successful : " + result.toString());
}).catchError((error) {
print("Login failed : " + error.toString());
});
}
void loginAsVisitor(context) {
KommunicateFlutterPlugin.loginAsVisitor(AppConfig.APP_ID).then((result) {
Navigator.pop(context);
Navigator.push(
context, MaterialPageRoute(builder: (context) => HomePage()));
print("Login as visitor successful : " + result.toString());
}).catchError((error) {
print("Login as visitor failed : " + error.toString());
});
}
void buildConversation() {
dynamic conversationObject = {'appId': AppConfig.APP_ID};
KommunicateFlutterPlugin.buildConversation(conversationObject)
.then((result) {
print("Conversation builder success : " + result.toString());
}).catchError((error) {
print("Conversation builder error occurred : " + error.toString());
});
}
void buildConversationWithPreChat(context) {
try {
KommunicateFlutterPlugin.isLoggedIn().then((value) {
print("Logged in : " + value.toString());
if (value) {
KommunicateFlutterPlugin.buildConversation(
{'isSingleConversation': true, 'appId': AppConfig.APP_ID})
.then((result) {
print("Conversation builder success : " + result.toString());
}).catchError((error) {
print("Conversation builder error occurred : " + error.toString());
});
} else {
Navigator.push(
context, MaterialPageRoute(builder: (context) => PreChatPage()));
}
});
} on Exception catch (e) {
print("isLogged in error : " + e.toString());
}
}
@override
Widget build(BuildContext context) {
try {
KommunicateFlutterPlugin.isLoggedIn().then((value) {
print("Logged in : " + value.toString());
if (value) {
Navigator.pop(context);
Navigator.push(
context, MaterialPageRoute(builder: (context) => HomePage()));
}
});
} on Exception catch (e) {
print("isLogged in error : " + e.toString());
}
return SingleChildScrollView(
child: Container(
padding: const EdgeInsets.all(36.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(
height: 155.0,
child: Image.asset(
"assets/ic_launcher_without_shape.png",
fit: BoxFit.contain,
),
),
new TextField(
controller: userId,
decoration: new InputDecoration(
contentPadding: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 15.0),
hintText: "UserId *",
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(32.0))),
),
SizedBox(height: 10),
new TextField(
controller: password,
obscureText: true,
decoration: new InputDecoration(
contentPadding: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 15.0),
hintText: "Password *",
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(32.0))),
),
SizedBox(height: 10),
new Material(
elevation: 5.0,
borderRadius: BorderRadius.circular(30.0),
color: Color(0xff5c5aa7),
child: new MaterialButton(
onPressed: () {
loginUser(context);
},
minWidth: 400,
padding: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 15.0),
child: Text("Login",
textAlign: TextAlign.center,
style: TextStyle(fontFamily: 'Montserrat', fontSize: 20.0)
.copyWith(
color: Colors.white,
fontWeight: FontWeight.bold)),
)),
SizedBox(height: 10),
new Material(
elevation: 5.0,
borderRadius: BorderRadius.circular(30.0),
color: Color(0xff5c5aa7),
child: new MaterialButton(
onPressed: () {
loginAsVisitor(context);
},
minWidth: 400,
padding: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 15.0),
child: Text("Login as Visitor",
textAlign: TextAlign.center,
style: TextStyle(fontFamily: 'Montserrat', fontSize: 20.0)
.copyWith(
color: Colors.white,
fontWeight: FontWeight.bold)),
)),
SizedBox(height: 10),
new Material(
elevation: 5.0,
borderRadius: BorderRadius.circular(30.0),
color: Color(0xff5c5aa7),
child: new MaterialButton(
onPressed: () {
buildConversation();
},
minWidth: 400,
padding: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 15.0),
child: Text("Use conversation builder",
textAlign: TextAlign.center,
style: TextStyle(fontFamily: 'Montserrat', fontSize: 20.0)
.copyWith(
color: Colors.white,
fontWeight: FontWeight.bold)),
)),
SizedBox(height: 10),
new Material(
elevation: 5.0,
borderRadius: BorderRadius.circular(30.0),
color: Color(0xff5c5aa7),
child: new MaterialButton(
onPressed: () {
buildConversationWithPreChat(context);
},
minWidth: 400,
padding: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 15.0),
child: Text("Builder with Pre chat form",
textAlign: TextAlign.center,
style:
TextStyle(fontFamily: 'Montserrat', fontSize: 20.0)
.copyWith(
color: Colors.white,
fontWeight: FontWeight.bold))))
],
),
),
);
}
}
Refer to the official docs here: https://docs.kommunicate.io/docs/flutter-installation.html
Original article source at: https://pub.dev/packages/kommunicate_flutter/example
1597014000
Flutter Google cross-platform UI framework has released a new version 1.20 stable.
Flutter is Google’s UI framework to make apps for Android, iOS, Web, Windows, Mac, Linux, and Fuchsia OS. Since the last 2 years, the flutter Framework has already achieved popularity among mobile developers to develop Android and iOS apps. In the last few releases, Flutter also added the support of making web applications and desktop applications.
Last month they introduced the support of the Linux desktop app that can be distributed through Canonical Snap Store(Snapcraft), this enables the developers to publish there Linux desktop app for their users and publish on Snap Store. If you want to learn how to Publish Flutter Desktop app in Snap Store that here is the tutorial.
Flutter 1.20 Framework is built on Google’s made Dart programming language that is a cross-platform language providing native performance, new UI widgets, and other more features for the developer usage.
Here are the few key points of this release:
In this release, they have got multiple performance improvements in the Dart language itself. A new improvement is to reduce the app size in the release versions of the app. Another performance improvement is to reduce junk in the display of app animation by using the warm-up phase.
If your app is junk information during the first run then the Skia Shading Language shader provides for pre-compilation as part of your app’s build. This can speed it up by more than 2x.
Added a better support of mouse cursors for web and desktop flutter app,. Now many widgets will show cursor on top of them or you can specify the type of supported cursor you want.
Autofill was already supported in native applications now its been added to the Flutter SDK. Now prefilled information stored by your OS can be used for autofill in the application. This feature will be available soon on the flutter web.
A new widget for interaction
InteractiveViewer
is a new widget design for common interactions in your app like pan, zoom drag and drop for resizing the widget. Informations on this you can check more on this API documentation where you can try this widget on the DartPad. In this release, drag-drop has more features added like you can know precisely where the drop happened and get the position.
In this new release, there are many pre-existing widgets that were updated to match the latest material guidelines, these updates include better interaction with Slider
and RangeSlider
, DatePicker
with support for date range and time picker with the new style.
pubspec.yaml
formatOther than these widget updates there is some update within the project also like in pubspec.yaml
file format. If you are a flutter plugin publisher then your old pubspec.yaml
is no longer supported to publish a plugin as the older format does not specify for which platform plugin you are making. All existing plugin will continue to work with flutter apps but you should make a plugin update as soon as possible.
Visual Studio code flutter extension got an update in this release. You get a preview of new features where you can analyze that Dev tools in your coding workspace. Enable this feature in your vs code by _dart.previewEmbeddedDevTools_
setting. Dart DevTools menu you can choose your favorite page embed on your code workspace.
The updated the Dev tools comes with the network page that enables network profiling. You can track the timings and other information like status and content type of your** network calls** within your app. You can also monitor gRPC traffic.
Pigeon is a command-line tool that will generate types of safe platform channels without adding additional dependencies. With this instead of manually matching method strings on platform channel and serializing arguments, you can invoke native class and pass nonprimitive data objects by directly calling the Dart
method.
There is still a long list of updates in the new version of Flutter 1.2 that we cannot cover in this blog. You can get more details you can visit the official site to know more. Also, you can subscribe to the Navoki newsletter to get updates on these features and upcoming new updates and lessons. In upcoming new versions, we might see more new features and improvements.
You can get more free Flutter tutorials you can follow these courses:
#dart #developers #flutter #app developed #dart devtools in visual studio code #firebase local emulator suite in flutter #flutter autofill #flutter date picker #flutter desktop linux app build and publish on snapcraft store #flutter pigeon #flutter range slider #flutter slider #flutter time picker #flutter tutorial #flutter widget #google flutter #linux #navoki #pubspec format #setup flutter desktop on windows
1591643580
Recently Adobe XD releases a new version of the plugin that you can use to export designs directly into flutter widgets or screens. Yes, you read it right, now you can make and export your favorite design in Adobe XD and export all the design in the widget form or as a full-screen design, this can save you a lot of time required in designing.
What we will do?
I will make a simple design of a dialogue box with a card design with text over it as shown below. After you complete this exercise you can experiment with the UI. You can make your own components or import UI kits available with the Adobe XD.
#developers #flutter #adobe xd design export to flutter #adobe xd flutter code #adobe xd flutter code generator - plugin #adobe xd flutter plugin #adobe xd flutter plugin tutorial #adobe xd plugins #adobe xd to flutter #adobe xd tutorial #codepen for flutter.
1598396940
Flutter is an open-source UI toolkit for mobile developers, so they can use it to build native-looking** Android and iOS** applications from the same code base for both platforms. Flutter is also working to make Flutter apps for Web, PWA (progressive Web-App) and Desktop platform (Windows,macOS,Linux).
Flutter was officially released in December 2018. Since then, it has gone a much stronger flutter community.
There has been much increase in flutter developers, flutter packages, youtube tutorials, blogs, flutter examples apps, official and private events, and more. Flutter is now on top software repos based and trending on GitHub.
What is Flutter? this question comes to many new developer’s mind.
Flutter means flying wings quickly, and lightly but obviously, this doesn’t apply in our SDK.
So Flutter was one of the companies that were acquired by **Google **for around $40 million. That company was based on providing gesture detection and recognition from a standard webcam. But later when the Flutter was going to release in alpha version for developer it’s name was Sky, but since Google already owned Flutter name, so they rename it to Flutter.
Flutter is used in many startup companies nowadays, and even some MNCs are also adopting Flutter as a mobile development framework. Many top famous companies are using their apps in Flutter. Some of them here are
and many more other apps. Mobile development companies also adopted Flutter as a service for their clients. Even I was one of them who developed flutter apps as a freelancer and later as an IT company for mobile apps.
#dart #flutter #uncategorized #flutter framework #flutter jobs #flutter language #flutter meaning #flutter meaning in hindi #google flutter #how does flutter work #what is flutter
1644991598
The Ultimate Guide To Tik Tok Clone App With Firebase - Ep 2
In this video, I'm going to show you how to make a Cool Tik Tok App a new Instagram using Flutter,firebase and visual studio code.
In this tutorial, you will learn how to Upload a Profile Pic to Firestore Data Storage.
🚀 Nice, clean and modern TikTok Clone #App #UI made in #Flutter⚠️
Starter Project : https://github.com/Punithraaj/Flutter_Tik_Tok_Clone_App/tree/Episode1
► Timestamps
0:00 Intro 0:20
Upload Profile Screen
16:35 Image Picker
20:06 Image Cropper
24:25 Firestore Data Storage Configuration.
⚠️ IMPORTANT: If you want to learn, I strongly advise you to watch the video at a slow speed and try to follow the code and understand what is done, without having to copy the code, and then download it from GitHub.
► Social Media
GitHub: https://github.com/Punithraaj/Flutter_Tik_Tok_Clone_App.git
LinkedIn: https://www.linkedin.com/in/roaring-r...
Twitter: https://twitter.com/roaringraaj
Facebook: https://www.facebook.com/flutterdartacademy
► Previous Episode : https://youtu.be/QnL3fr-XpC4
► Playlist: https://youtube.com/playlist?list=PL6vcAuTKAaYe_9KQRsxTsFFSx78g1OluK
I hope you liked it, and don't forget to like,comment, subscribe, share this video with your friends, and star the repository on GitHub!
⭐️ Thanks for watching the video and for more updates don't forget to click on the notification.
⭐️Please comment your suggestion for my improvement.
⭐️Remember to like, subscribe, share this video, and star the repo on Github :)
Hope you enjoyed this video!
If you loved it, you can Buy me a coffee : https://www.buymeacoffee.com/roaringraaj
LIKE & SHARE & ACTIVATE THE BELL Thanks For Watching :-)
https://youtu.be/F_GgZVD4sDk
#flutter tutorial - tiktok clone with firebase #flutter challenge @tiktokclone #fluttertutorial firebase #flutter firebase #flutter pageview #morioh #flutter
1640672627
https://youtu.be/-tHUmjIkGJ4
Flutter Hotel Booking UI - Book your Stay At A New Hotel With Flutter - Ep1
#flutter #fluttertravelapp #hotelbookingui #flutter ui design
In this video, I'm going to show you how to make a Cool Hotel Booking App using Flutter and visual studio code.
In this tutorial, you will learn how to create a Splash Screen and Introduction Screen, how to implement a SmoothPageIndicator in Flutter.
🚀 Nice, clean and modern Hotel Booking #App #UI made in #Flutter
⚠️ IMPORTANT: If you want to learn, I strongly advise you to watch the video at a slow speed and try to follow the code and understand what is done, without having to copy the code, and then download it from GitHub.
► Social Media
GitHub: https://github.com/Punithraaj
LinkedIn: https://www.linkedin.com/in/roaring-r...
Twitter: https://twitter.com/roaringraaj
Facebook: https://www.facebook.com/flutterdartacademy
I hope you liked it, and don't forget to like,comment, subscribe, share this video with your friends, and star the repository on GitHub!
⭐️ Thanks for watching the video and for more updates don't forget to click on the notification.⭐️Please comment your suggestion for my improvement. ⭐️Remember to like, subscribe, share this video, and star the repo on Github :)Hope you enjoyed this video! If you loved it, you can Buy me a coffee : https://www.buymeacoffee.com/roaringraaj
#flutter riverpod #flutter travel app #appointment app flutter #morioh