solucx_widget 1.0.7
solucx_widget: ^1.0.7 copied to clipboard
SoluCXWidget is a Flutter widget that allows you to integrate SoluCX functionalities into your Flutter application.
SoluCXWidget #
The SoluCXWidget is a Flutter widget that allows integration with the SoluCX survey system. It offers different types
of widgets that can be displayed in various positions on the screen, such as top, bottom, modal, or inline.
Features #
- Support for different widget types:
bottom,top,modal,inline. - Control widget visibility.
- Dynamic widget resizing.
- Control of attempts and data collection intervals.
- Integration with WebView for displaying web content.
Getting Started #
Prerequisites #
- Flutter SDK
- Project dependencies listed in
pubspec.yaml - Internet permission for Android and iOS
Installation #
Add SoluCXWidget to your Flutter project:
dependencies:
flutter:
sdk: flutter
solucx_widget: ^1.0.7
Configuration #
Android
Add the following permission to your AndroidManifest.xml file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.yourapp">
<uses-permission android:name="android.permission.INTERNET"/>
<!-- ...existing code... -->
</manifest>
iOS
Add the following to your Info.plist file:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Usage #
Here is a basic example of how to use SoluCXWidget:
import 'package:flutter/material.dart';
import 'package:solucx_widget/solucx_widget.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('SoluCX Widget Example'),
),
body: Center(
child: SoluCXWidget(
soluCXKey: 'your-solucx-key',
type: SoluCXWidgetType.bottom,
data: SoluCXWidgetData(
clientId: 'client-id',
email: 'client@example.com',
),
options: SoluCXWidgetOptions(
widgetWidth: 1.0,
retryAttempts: 5,
retryInterval: 1,
collectInterval: 60,
collectPartialInterval: 0,
),
),
),
),
);
}
}
Interfaces #
SoluCXKey #
A type alias for String used as a unique identifier for the SoluCX widget.
SoluCXWidget #
A Flutter widget that integrates with the SoluCX survey system.
Properties
soluCXKey(required): ASoluCXKeythat uniquely identifies the widget.type(required): ASoluCXWidgetTypethat specifies the type of widget (bottom, top, modal, inline).data(required): ASoluCXWidgetDataobject containing the data to be sent to the survey.options(required): ASoluCXWidgetOptionsobject containing configuration options for the widget.alignment(optional): AnAlignmentobject specifying the alignment of the widget. Default isAlignment.center.webViewController(optional): AWebViewControllerfor controlling the WebView.soluCXWidgetService(optional): ASoluCXWidgetServicefor handling widget-related services.
SoluCXWidgetType #
An enum representing the type of SoluCX widget.
bottom: Displays the widget at the bottom of the screen.top: Displays the widget at the top of the screen.modal: Displays the widget as a modal overlay.inline: Displays the widget inline within the existing layout.
SoluCXWidgetOptions #
A class containing configuration options for the SoluCX widget.
Properties
widgetWidth(optional): Adoublespecifying the width of the widget as a fraction of the display width. Default is1.0.retryAttempts(optional): Anintspecifying the number of retry attempts. Default is5.retryInterval(optional): Anintspecifying the retry interval in days. Default is1.collectInterval(optional): Anintspecifying the data collection interval in days. Default is60.collectPartialInterval(optional): Anintspecifying the partial data collection interval in days. Default is0.
SoluCXWidgetData #
A class containing the data to be sent to the SoluCX survey.
Properties
transactionId(optional): AStringrepresenting the transaction ID.attemptId(optional): AStringrepresenting the attempt ID.name(optional): AStringrepresenting the name of the client.email(optional): AStringrepresenting the email of the client.clientId(optional): AStringrepresenting the client ID.cpf(optional): AStringrepresenting the CPF of the client.phone(optional): AStringrepresenting the phone number of the client.phone2(optional): AStringrepresenting the secondary phone number of the client.gender(optional): AStringrepresenting the gender of the client.birthDate(optional): AStringrepresenting the birth date of the client.rating(optional): AStringrepresenting the rating given by the client.storeId(optional): AStringrepresenting the store ID.employeeId(optional): AStringrepresenting the employee ID.amount(optional): Adoublerepresenting the amount of the transaction.journey(optional): AStringrepresenting the journey of the client.
Additional Information #
For more information on how to contribute to the project, report issues, and what to expect from the package authors, please refer to the official documentation.