messaggera 0.0.1
messaggera: ^0.0.1 copied to clipboard
messaggera flutter Package for mobile applications
Installing #
Add this to your package's pubspec.yaml file:
dependencies:
messaggera: ^0.0.1
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();