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): ASoluCXKey
that uniquely identifies the widget.type
(required): ASoluCXWidgetType
that specifies the type of widget (bottom, top, modal, inline).data
(required): ASoluCXWidgetData
object containing the data to be sent to the survey.options
(required): ASoluCXWidgetOptions
object containing configuration options for the widget.alignment
(optional): AnAlignment
object specifying the alignment of the widget. Default isAlignment.center
.webViewController
(optional): AWebViewController
for controlling the WebView.soluCXWidgetService
(optional): ASoluCXWidgetService
for 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): Adouble
specifying the width of the widget as a fraction of the display width. Default is1.0
.retryAttempts
(optional): Anint
specifying the number of retry attempts. Default is5
.retryInterval
(optional): Anint
specifying the retry interval in days. Default is1
.collectInterval
(optional): Anint
specifying the data collection interval in days. Default is60
.collectPartialInterval
(optional): Anint
specifying 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): AString
representing the transaction ID.attemptId
(optional): AString
representing the attempt ID.name
(optional): AString
representing the name of the client.email
(optional): AString
representing the email of the client.clientId
(optional): AString
representing the client ID.cpf
(optional): AString
representing the CPF of the client.phone
(optional): AString
representing the phone number of the client.phone2
(optional): AString
representing the secondary phone number of the client.gender
(optional): AString
representing the gender of the client.birthDate
(optional): AString
representing the birth date of the client.rating
(optional): AString
representing the rating given by the client.storeId
(optional): AString
representing the store ID.employeeId
(optional): AString
representing the employee ID.amount
(optional): Adouble
representing the amount of the transaction.journey
(optional): AString
representing 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.
Libraries
- solucx_widget
- SoluCX widget package.