Referral Component
The Referral components are reusable flutter component designed to facilitate user referrals and rewards. It allows users to earn rewards by sharing a referral code with friends
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: "libre baskerville",
borderColor: Colors.red
)void main() {
runApp(const MyApp());
getItInit();
getIt<SharedPref>().init();
}providers: [
BlocProvider(
create: (context) => getIt<ShareWithComponentCubit>(),
),
],import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:quest_interview/token.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<ShareWithComponentCubit>(),
),
],
child: MaterialApp(
title: 'Flutter Demo',
home: ShareWithComponent(
questProvider: QuestProvider(
apiKey: "apiKey",
entityId: "entityId",
// themeConfig: QuestThemeConfig(
// secondaryColor: Colors.green,
// primaryColor: Colors.blue,
// backgroundColor: Colors.white,
// buttonColor: Colors.yellow,
// fontStyle: "dancing script",
// borderColor: Colors.red
// )
),
shareWithComponentProps: ShareWithComponentProps(
userId: "userId",
token: "token",
campaignId: "campaignId",
// heading: "hhhhh",
// showFooter: true,
// description: "nothing is scary",
// gradientBackgroundColor: Colors.red,
// primaryDescription: "testing",
// primaryHeading: "jjjjjj",
// referralLink: "linkdin",
// shareButtonText: "share this",
// showRefferalLogo: false
),
)
),
);
}
}