questlabs_flutter_sdk

questlabs_flutter_sdk is a Flutter package designed to integrate Quest Labs AI components into your Flutter applications. This SDK supports a range of customizable components to enhance user engagement and provide analytics.

Features

  • AI Components: Easily add AI-driven components for enhanced user interaction and data insights.
  • Customizable UI: Modify appearance and behavior to fit your app’s design.
  • API Integration: Streamlined connection to Quest Labs’ backend for real-time data processing and AI capabilities.

Getting Started

  1. Ensure Flutter is set up on your machine.
  2. Add the package to your pubspec.yaml file:
   dependencies:
     questlabs_flutter_sdk: ^1.0.0

Install the package:

   flutter pub get 

Usage

Import the package and initialize the SDK:

    void main() {
      runApp(const MyApp());
      getItInit();
      getIt<SharedPref>().init();
    }

Add the following BlocProvider setup to your providers list:

   providers: [
   BlocProvider(
            create: (context) => getIt<Cubit>(),
          ),
    ],
  • ** Configuration Parameters
  1. apiKey: Your Quest Labs API key.
  2. entityId: Unique identifier for each entity.
  3. campaignId: Unique identifier for each campaign.
  4. userId: Unique identifier for each user.
  5. token: Your Quest Labs token.

Example Usage

Here's an example of how to use the OnBoarding Component widget in a Flutter application:

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:questlabs_flutter_sdk/questlabs_flutter_sdk.dart';

void main() {
  runApp(const MyApp());
  getItInit();
  getIt<SharedPref>().init();
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MultiBlocProvider(
      providers: [
        BlocProvider(
          create: (context) => getIt<ComponentStateCubit>(),
        ),
      ],
      child: MaterialApp(
          title: 'Flutter Demo',
          home:   OnBoardingQuizTemplate2(
            questProvider: QuestProvider(
                apiKey: "apiKey",
                entityId: "entityId",
            ),
            onBoardingProps: OnBoardingProps2(
              token: "token",
              userId: "userId",
              campaignId: "campaignId",
            ),
          )
      ),
    );
  }
}

Additional information

For detailed documentation, visit the Quest Labs SDK Docs.