flutter_carrotquest_plugin 1.0.3 flutter_carrotquest_plugin: ^1.0.3 copied to clipboard
A Carrot quest flutter plugin for Android and IOS. You can find a description of the service at https://www.carrotquest.io
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter_carrotquest/flutter_carrotquest.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
initPlatformState();
}
Future<void> initPlatformState() async {
await Carrot.setup(apiKey: 'your apiKey', appId: 'your appId')
.catchError((onError) => print(onError));
/* await Carrot.setDebug().catchError((onError) => print(onError));
await Carrot.auth(userId: 'your userId', userAuthKey: 'your userAuthKey')
.catchError((onError) => print(onError)); */
await Carrot.openChat().catchError((onError) => print(onError));
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Text(''),
),
),
);
}
}