Flutter Integration
Feeddo allows you to drop a live AI support chat into your Flutter app with just 2 lines of code.
Installation
Section titled “Installation”Add feeddo_flutter to your pubspec.yaml:
dependencies: feeddo_flutter: ^0.1.2Then install the package:
flutter pub getiOS Setup
Section titled “iOS Setup”Feeddo requires a minimum deployment target of iOS 15.0.
-
Open your project in Xcode (open
ios/Runner.xcworkspace). -
Select the Runner project in the left navigation panel.
-
In the project targets list, select Runner.
-
Select the General tab.
-
In the Deployment Info section, set Minimum Deployments to 15.0.
-
Ensure your
ios/Podfilealso specifies platform 15.0:platform :ios, '15.0'
Quick Start
Section titled “Quick Start”1. Get Your API Key
Section titled “1. Get Your API Key”Sign up at feeddo.dev and grab your API key from the dashboard.
2. Initialize Feeddo
Section titled “2. Initialize Feeddo”Call Feeddo.init() when your app starts (usually in your main screen or main.dart).
import 'package:feeddo_flutter/feeddo_flutter.dart';
// ... inside your widget or initialization logicawait Feeddo.init( apiKey: 'your-api-key-here', context: context,);3. Show the Support Chat
Section titled “3. Show the Support Chat”Add a button anywhere in your app to open the support widget:
ElevatedButton( onPressed: () { Feeddo.show(context); }, child: Text('Get Help'),)4. Show the Community Board
Section titled “4. Show the Community Board”To show feature requests and bug reports directly:
ElevatedButton( onPressed: () { Feeddo.showCommunityBoard(context); }, child: Text('Request a feature'),)Configuration
Section titled “Configuration”The init() method supports various parameters to customize the user experience.
await Feeddo.init( apiKey: 'your-api-key', context: context,
// User identification externalUserId: 'user_12345', userName: 'John Doe',
// Segmentation userSegment: 'premium', subscriptionStatus: 'active',
// Custom data customAttributes: { 'plan': 'pro', 'country': 'US', },
// Notifications isInAppNotificationOn: true, pushToken: 'fcm-token-here', pushProvider: FeeddoPushProvider.fcm,);Notifications
Section titled “Notifications”Push Notifications Setup
Section titled “Push Notifications Setup”If you haven’t configured push notifications, follow the Firebase Cloud Messaging guide.
Register your token with Feeddo:
await Feeddo.registerPushToken( pushToken: 'your-push-token', pushProvider: FeeddoPushProvider.fcm, // or .apns, .onesignal);Handle incoming messages:
// Background/TerminatedFirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) { Feeddo.handleNotificationTap(context, message.data);});
// ForegroundFirebaseMessaging.onMessage.listen((RemoteMessage message) { Feeddo.showInappNotification( context: context, title: message.notification?.title ?? 'New Message', message: message.notification?.body ?? '', data: message.data, );});Customization
Section titled “Customization”You can customize the look and feel using FeeddoTheme.
Basic Themes
Section titled “Basic Themes”// Dark themeFeeddo.show(context, theme: FeeddoTheme.dark());
// Light themeFeeddo.show(context, theme: FeeddoTheme.light());Custom Colors
Section titled “Custom Colors”final myTheme = FeeddoTheme( isDark: true, colors: FeeddoColors( background: Color(0xFF1A1A2E), textPrimary: Color(0xFFFFFFFF), primary: Color(0xFF00D9FF), // ... customized colors ),);
Feeddo.show(context, theme: myTheme);Others
Section titled “Others”Unread Message Count
Section titled “Unread Message Count”int unreadCount = Feeddo.unreadMessageCount;Update User Info
Section titled “Update User Info”await Feeddo.updateUser( userName: 'Jane Smith',);