solucx_widget 1.0.6  solucx_widget: ^1.0.6 copied to clipboard
solucx_widget: ^1.0.6 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.0
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(
              displayWidth: 300,
              displayHeight: 600,
              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): A- SoluCXKeythat uniquely identifies the widget.
- type(required): A- SoluCXWidgetTypethat specifies the type of widget (bottom, top, modal, inline).
- data(required): A- SoluCXWidgetDataobject containing the data to be sent to the survey.
- options(required): A- SoluCXWidgetOptionsobject containing configuration options for the widget.
- alignment(optional): An- Alignmentobject specifying the alignment of the widget. Default is- Alignment.center.
- webViewController(optional): A- WebViewControllerfor controlling the WebView.
- soluCXWidgetService(optional): A- SoluCXWidgetServicefor 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): A- doublespecifying the width of the widget as a fraction of the display width. Default is- 1.0.
- retryAttempts(optional): An- intspecifying the number of retry attempts. Default is- 5.
- retryInterval(optional): An- intspecifying the retry interval in days. Default is- 1.
- collectInterval(optional): An- intspecifying the data collection interval in days. Default is- 60.
- collectPartialInterval(optional): An- intspecifying the partial data collection interval in days. Default is- 0.
SoluCXWidgetData #
A class containing the data to be sent to the SoluCX survey.
Properties
- transactionId(optional): A- Stringrepresenting the transaction ID.
- attemptId(optional): A- Stringrepresenting the attempt ID.
- name(optional): A- Stringrepresenting the name of the client.
- email(optional): A- Stringrepresenting the email of the client.
- clientId(optional): A- Stringrepresenting the client ID.
- cpf(optional): A- Stringrepresenting the CPF of the client.
- phone(optional): A- Stringrepresenting the phone number of the client.
- phone2(optional): A- Stringrepresenting the secondary phone number of the client.
- gender(optional): A- Stringrepresenting the gender of the client.
- birthDate(optional): A- Stringrepresenting the birth date of the client.
- rating(optional): A- Stringrepresenting the rating given by the client.
- storeId(optional): A- Stringrepresenting the store ID.
- employeeId(optional): A- Stringrepresenting the employee ID.
- amount(optional): A- doublerepresenting the amount of the transaction.
- journey(optional): A- Stringrepresenting 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.