messaggera 0.0.4
messaggera: ^0.0.4 copied to clipboard
Messaggera is an interactive chat widget that facilitates real-time communication with your audience, simplifying connections, assistance and conversions.
messaggera is an interactive chat widget that facilitates real-time communication with your audience, simplifying connections, assistance and conversions.
[Screenshot of a messages screen]
Installing #
Add this to your package's pubspec.yaml file:
dependencies:
messaggera: ^0.0.4
import it
import 'package:messaggera/messaggera.dart';
How to use #
initialize messaggera in your main
void main() async {
// Get your websiteId from https://www.messaggera.com
String websiteId = '';
await messaggeraInit(websiteId: websiteId);
runApp(const MyApp());
}
call the widget
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: Text('Press the button to open chat'),
),
floatingActionButton: messaggera(
mainColor: const Color(0xFF3498DB),
)));
}
}
use this function to add user data if there is any. otherwise he will appear as guest from operator side.
await setUserData({
"email": "",
"id": "",
"name": "",
});
call this function to see your current user data.
Future<Map<String, dynamic>?> userData = getUserData();
call this function to delete current user data.
removeUserData();
Messaggera Configuration #
| Property | Description | Default |
|---|---|---|
mainColor |
The primary color theme for the button and UI elements. | Colors.blue |
showEmojiKeyboard |
Whether to display the emoji keyboard in the chat. | true |
showFilePicker |
Whether to enable file picking functionality. | true |
screenUtilDesignSize |
The screen design size for responsive UI scaling using flutter_screenutil. |
Size(428,936) |
buttonIcon |
Custom icon widget for the floating action button. | official messaggera logo |
heroTag |
The hero tag for the floating action button to support transitions. | null |