Overview Visual 1 Visual 2 Visual 3
Copy dependencies :
questlabs_flutter_sdk :
git :
url : "Replace with your github URL"
ref : master
flutter_bloc : ^ 8.1 . 6
Props of Onboarding Quiz Component
Copy
themeConfig : QuestThemeConfig (
secondaryColor : Colors .red,
primaryColor : Colors .blue,
buttonColor : Colors .yellow,
backgroundColor : Colors .yellow,
fontStyle : "libre baskerville" ,
borderColor : Colors .red
)
Copy void main () {
runApp ( const MyApp ());
getItInit ();
getIt < SharedPref >(). init ();
}
Copy providers : [
BlocProvider (
create : (context) => getIt < ComponentStateCubit >(),
),
],
Copy 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" ,
themeConfig : QuestThemeConfig (
// secondaryColor: Colors.red,
// primaryColor: Colors.blue,
// buttonColor: Colors.yellow,
// fontStyle: "",
// borderColor: Colors.red
)
),
onBoardingProps : OnBoardingProps2 (
token : "token" ,
userId : "userId" ,
campaignId : "campaignId" ,
// design: [
// [1, 2, 3, 1],
// [5, 6, 7],
// ],
// uiHeader: [
// UiHeader(
// heading: "notheee",
// subHeading: "none 1"
// ),
// UiHeader(
// heading: "screen 2",
// subHeading: "none 2"
// ),
// ],
),
)
),
);
}
}
Watch the video below for a step-by-step guide on testing the Quiz component in your Flutter project.