Survey component
Offer a versatile survey solution for your Flutter app with our comprehensive data collection feature, including diverse templates for seamless integration. Enhance user engagement.
Last updated
dependencies:
questlabs_flutter_sdk:
git:
url: "Replace with your github URL"
ref: master
flutter_bloc: ^8.1.6
themeConfig: QuestThemeConfig(
secondaryColor: Colors.red,
primaryColor: Colors.blue,
buttonColor: Colors.yellow,
backgroundColor: Colors.yellow,
fontStyle: "poppins",
borderColor: Colors.red
)void main() {
runApp(const MyApp());
getItInit();
getIt<SharedPref>().init();
}providers: [
BlocProvider(
create: (context) => getIt<ComponentStateCubit>(),
),
],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: SurveyComponent(
questProvider: QuestProvider(
apiKey: "k-6fe7e7dc-ac8f-44a1-8bbf-a1754ddf88be",
entityId: "e-48bebfc3-4e36-4138-8c18-94e45a482003",
themeConfig: QuestThemeConfig(
// secondaryColor: Colors.red,
// primaryColor: Colors.blue,
// backgroundColor: Colors.green,
// buttonColor: Colors.yellow,
// fontStyle: "dancing script",
// borderColor: Colors.red
)
),
surveyProps: SurveyProps(
token: Token.token,
userId: "u-476d444c-5adb-41e2-9d49-6866150ac30a",
campaignId: "c-6b6c0ca1-e75f-43ad-a9dd-786858c6bf31",
questionSection: [[1, 2], [3,4, 5],],
uiHeader: [
UiHeader(
heading: "notheee",
subHeading: "none 1"
),
UiHeader(
heading: "screen 2",
subHeading: "none 2"
),
],
showFooter: false,
heading: "",
subHeading: ""
),
),
),
);
}
}