11# Instabug for Flutter
22
3- [ ![ pub package] ( https://img.shields.io/pub/v/instabug .svg )] ( https://pub.dev/packages/instabug )
3+ [ ![ pub package] ( https://img.shields.io/pub/v/instabug_flutter .svg )] ( https://pub.dev/packages/instabug_flutter )
44
55A Flutter plugin for [ Instabug] ( https://instabug.com/ ) .
66
@@ -20,106 +20,6 @@ A Flutter plugin for [Instabug](https://instabug.com/).
2020* ⚙️ Under active development
2121* ⚠ Not available yet
2222
23- ### APIs
24-
25- The section below contains the APIs we're planning to implement for our 1.0 release across different classes. We'll add the Dart API methods as we implement them.
26-
27- #### ` Instabug `
28-
29- | API Method | Native Equivalent (Android/iOS) |
30- | ----------------------------------------------------------------------| -----------------------------------------------------------------------------------------------------------|
31- | ` start(String token, List<InvocationEvent> invocationEvents) ` | ` new Instabug.Builder(this, "APP_TOKEN").build() ` <br >` + startWithToken:invocationEvents: ` |
32- | ` showWelcomeMessageWithMode(WelcomeMessageMode welcomeMessageMode) ` | ` showWelcomeMessage(WelcomeMessage.State state) ` <br >` + showWelcomeMessageWithMode: ` |
33- | ` identifyUserWithEmail(String email, [String name]) ` | ` identifyUser(String username, String email) ` <br >` + identifyUserWithEmail:name: ` |
34- | ` logOut() ` | ` logoutUser() ` <br >` + logOut ` |
35- | ` setLocale(Locale locale) ` | ` setLocale(Locale locale) ` <br >` + setLocale: ` |
36- | ` setColorTheme(ColorTheme colorTheme) ` | ` setColorTheme(InstabugColorTheme theme) ` <br >` + setColorTheme: ` |
37- | ` appendTags(List<String> tags) ` | ` addTags(String... tags) ` <br >` + appendTags: ` |
38- | ` resetTags() ` | ` resetTags() ` <br >` + resetTags ` |
39- | ` getTags() ` | ` getTags() ` <br >` + getTags ` |
40- | ` setStringForKey(String value, String key) ` | ` setCustomTextPlaceHolders(InstabugCustomTextPlaceHolder placeholder) ` <br >` + setValue:forStringWithKey: ` |
41- | ` setUserAttributeWithKey(String value, String key) ` | ` setUserAttribute(String key, String value) ` <br >` + setUserAttribute:withKey: ` |
42- | ` getUserAttributeForKey(Sring Key) ` | ` getUserAttribute(String key) ` <br >` + userAttributeForKey: ` |
43- | ` removeUserAttributeForKey(String key) ` | ` removeUserAttribute(String key) ` <br >` + removeUserAttributeForKey: ` |
44- | ` getUserAttributes() ` | ` getAllUserAttributes() ` <br >` + userAttributes: ` |
45- | ` logUserEventWithName(String name) ` | ` logUserEvent(String name) ` <br >` + logUserEventWithName: ` |
46- | ` show() ` | ` show() ` <br >` + show ` |
47- | ` setSessionProfilerEnabled(bool sessionProfilerEnabled) ` | ` setSessionProfilerState(Feature.State state) ` <br >` sessionProfilerEnabled ` |
48- | ` setPrimaryColor(Color color) ` | ` setPrimaryColor(@ColorInt int primaryColorValue) ` <br >` tintColor ` |
49- | ` setUserData(String userData) ` | ` setUserData(String userData) ` <br >` userData ` |
50- | ` addFileAttachmentWithURL(String filePath, String fileName) ` | ` addFileAttachment(Uri fileUri, String fileNameWithExtension) ` <br >` + addFileAttachmentWithURL: ` |
51- | ` addFileAttachmentWithData(Uint8List data, String fileName) ` | ` addFileAttachment(byte[] data, String fileNameWithExtension) ` ` + addFileAttachmentWithData: ` |
52- | ` clearFileAttachments() ` | ` clearFileAttachment() ` <br >` + clearFileAttachments ` |
53- | ` setWelcomeMessageMode(WelcomeMessageMode welcomeMessageMode) ` | ` setWelcomeMessageState(WelcomeMessage.State welcomeMessageState) ` <br >` welcomeMessageMode ` |
54-
55- #### ` BugReporting `
56-
57- | API Method | Native Equivalent (Android/iOS) |
58- | ---------------------------------------------------------------------------------------------| -----------------------------------------------------------------------------------------------------------------------------|
59- | ` invokeWithMode(InvocationMode invocationMode, [List<InvocationOption> invocationOptions]) ` | ` invoke(InvocationMode mode, @InvocationOption int... options) ` <br >` +invokeWithMode:options: ` |
60- | ` setEnabled(bool isEnabled) ` | ` setState(Feature.State state) ` <br >` enabled ` |
61- | ` setOnInvokeCallback(Function function) ` | ` setOnInvokeCallback(OnInvokeCallback onInvokeCallback) ` <br >` willInvokeHandler ` |
62- | ` setOnDismissCallback(Function function) ` | ` setOnDismissCallback(OnSdkDismissCallback onSdkDismissedCallback) ` <br >` didDismissHandler ` |
63- | ` setInvocationEvents(List<InvocationEvent> invocationEvents) ` | ` setInvocationEvents(InstabugInvocationEvent... invocationEvents) ` <br >` invocationEvents ` |
64- | ` setEnabledAttachmentTypes(bool screenshot, bool extraScreenshot, bool galleryImage, bool screenRecording) ` | ` setAttachmentTypesEnabled(boolean initial, boolean extra, boolean gallery, boolean recording ` <br >` enabledAttachmentTypes ` |
65- | ` setReportTypes(List<ReportType> reportTypes) ` | ` setReportTypes(@BugReporting.ReportType int... types) ` <br >` promptOptionsEnabledReportTypes ` |
66- | ` setExtendedBugReportMode(ExtendedBugReportMode extendedBugReportMode) ` | ` setExtendedBugReportState(ExtendedBugReport.State state) ` <br >` extendedBugReportMode ` |
67- | ` setInvocationOptions(List<InvocationOption> invocationOptions) ` | ` setOptions(@Option int... options) ` <br >` bugReportingOptions `
68- | ` showWithOptions(ReportType reportType, List<InvocationOption> invocationOptions) ` | ` show(@BugReporting.ReportType int type) ` <br >` + showWithReportType:options: `
69-
70- #### ` InstabugLog `
71-
72- | API Method | Native Equivalent (Android/iOS) |
73- | -----------------------------------------------| --------------------------------------------------------------|
74- | ` logDebug(String message) ` | ` d(String message) ` <br >` + logDebug: ` |
75- | ` logVerbose(String message) ` | ` v(String message) ` <br >` + logVerbose: ` |
76- | ` logInfo(String message) ` | ` i(String message) ` <br >` + logInfo: ` |
77- | ` logWarn(String message) ` | ` w(String message) ` <br >` + logWarn: ` |
78- | ` logError(String message) ` | ` e(String message) ` <br >` + logError: ` |
79- | ` clearAllLogs(String message) ` | ` clearLogs() ` <br >` + clearAllLogs: ` |
80-
81- #### ` Surveys `
82-
83- | API Method | Native Equivalent (Android/iOS) |
84- | -----------------------------------------------| ---------------------------------------------------------------------------------------------------------------------------------------------|
85- | ` setEnabled(bool isEnabled) ` | ` setState(Feature.State state) ` <br >` enabled ` |
86- | ` setAutoShowingEnabled(bool isEnabled) ` | ` setAutoShowingEnabled(boolean isAutoShowingEnabled) ` <br >` autoShowingEnabled ` |
87- | ` getAvailableSurveys(Function function) ` | ` getAvailableSurveys() ` <br >` + availableSurveys ` |
88- | ` setOnShowCallback(Function function) ` | ` setOnShowCallback(OnShowCallback onShowCallback) ` <br >` willShowSurveyHandler ` |
89- | ` setOnDismissCallback(Function function) ` | ` setOnDismissCallback(OnDismissCallback onDismissCallback) ` <br >` didDismissSurveyHandler ` |
90- | ` setShouldShowWelcomeScreen(bool shouldShowWelcomeScreen) ` | ` setShouldShowWelcomeScreen(boolean shouldShow) ` <br >` shouldShowWelcomeScreen ` |
91- | ` showSurveyIfAvailable() ` | ` showSurveyIfAvailable() ` <br >` + showSurveyIfAvailable ` |
92- | ` showSurvey(String surveyToken) ` | ` showSurvey(String token) ` <br >` + showSurveyWithToken: ` |
93- | ` hasRespondedToSurvey(String surveyToken, Function function) ` | ` hasRespondToSurvey(String token) ` <br >` + hasRespondedToSurveyWithToken: ` |
94-
95- #### ` FeatureRequests `
96-
97- | API Method | Native Equivalent (Android/iOS) |
98- | -----------------------------------------------| --------------------------------------------------------------|
99- | ` show() ` | ` show() ` <br >` + show ` |
100- | ` setEmailFieldRequired(bool isEmailFieldRequired, List<ActionType> actionTypes) ` | ` setEmailFieldRequired(boolean isEmailRequired, ActionTypes actions) ` <br >` + setEmailFieldRequired:forAction: ` |
101-
102-
103- #### ` Chats `
104-
105- | API Method | Native Equivalent (Android/iOS) |
106- | -----------------------------------------------| --------------------------------------------------------------|
107- | ` show() ` | ` show() ` <br >` + show ` |
108- | ` setEnabled(bool isEnabled) ` | ` setState(Feature.State state) ` <br >` enabled ` |
109-
110-
111- #### ` Replies `
112-
113- | API Method | Native Equivalent (Android/iOS) |
114- | -----------------------------------------------| ---------------------------------------------------------------------------------------------------------------------------------------------|
115- | ` setEnabled(bool isEnabled) ` | ` setState(Feature.State state) ` <br >` enabled ` |
116- | ` show() ` | ` show() ` <br >` + show ` |
117- | ` hasChats(Function function) ` | ` hasChats() ` <br >` + hasChats ` |
118- | ` setOnNewReplyReceivedCallback(Function function) ` | ` setOnNewReplyReceivedCallback(Callback callback) ` <br >` didReceiveReplyHandler `
119- | ` getUnreadRepliesCount(Function function) ` | ` getUnreadRepliesCount() ` <br >` unreadRepliesCount ` |
120- | ` setInAppNotificationsEnabled(bool isEnabled) ` | ` setInAppNotificationEnabled(Boolean isChatNotificationEnable) ` <br >` inAppNotificationsEnabled ` |
121- | ` setInAppNotificationSound(bool isEnabled) ` | ` setInAppNotificationSound(Boolean shouldPlaySound) ` |
122-
12323## Integration
12424
12525Creating a Flutter app on the Instabug dashboard isn't possible yet. Create a React Native app instead.
@@ -132,7 +32,7 @@ Creating a Flutter app on the Instabug dashboard isn't possible yet. Create a Re
13232
13333``` yaml
13434dependencies :
135- instabug :
35+ instabug_flutter :
13636` ` `
13737
138382. Install the package by running the following command.
@@ -146,7 +46,7 @@ flutter packages get
146461 . To start using Instabug, import it into your Flutter app.
14747
14848``` dart
149- import 'package:instabug /Instabug.dart';
49+ import 'package:instabug_flutter /Instabug.dart';
15050```
15151
152522 . Initialize the SDK in ` initState() ` . This line enables the SDK with the default behavior and sets it to be shown when the device is shaken. Ignore this if you're building for Android only.
0 commit comments