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): A SoluCXKey that uniquely identifies the widget.
  • type (required): A SoluCXWidgetType that specifies the type of widget (bottom, top, modal, inline).
  • data (required): A SoluCXWidgetData object containing the data to be sent to the survey.
  • options (required): A SoluCXWidgetOptions object containing configuration options for the widget.
  • alignment (optional): An Alignment object specifying the alignment of the widget. Default is Alignment.center.
  • webViewController (optional): A WebViewController for controlling the WebView.
  • soluCXWidgetService (optional): A SoluCXWidgetService 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): A double specifying the width of the widget as a fraction of the display width. Default is 1.0.
  • retryAttempts (optional): An int specifying the number of retry attempts. Default is 5.
  • retryInterval (optional): An int specifying the retry interval in days. Default is 1.
  • collectInterval (optional): An int specifying the data collection interval in days. Default is 60.
  • collectPartialInterval (optional): An int specifying 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 String representing the transaction ID.
  • attemptId (optional): A String representing the attempt ID.
  • name (optional): A String representing the name of the client.
  • email (optional): A String representing the email of the client.
  • clientId (optional): A String representing the client ID.
  • cpf (optional): A String representing the CPF of the client.
  • phone (optional): A String representing the phone number of the client.
  • phone2 (optional): A String representing the secondary phone number of the client.
  • gender (optional): A String representing the gender of the client.
  • birthDate (optional): A String representing the birth date of the client.
  • rating (optional): A String representing the rating given by the client.
  • storeId (optional): A String representing the store ID.
  • employeeId (optional): A String representing the employee ID.
  • amount (optional): A double representing the amount of the transaction.
  • journey (optional): A String 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.