Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sparrow SDK #1282

Merged
merged 21 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Created survey service.
  • Loading branch information
jigar-f committed Jan 6, 2025
commit 8765fa3ffe3019d40a64dc5566e0970d84dcc053
2 changes: 2 additions & 0 deletions lib/core/service/injection_container.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import 'package:get_it/get_it.dart';
import 'package:lantern/core/service/app_purchase.dart';
import 'package:lantern/core/service/survey_service.dart';

final GetIt sl = GetIt.instance;

void init() {
//Inject
sl.registerLazySingleton(() => AppPurchase());
sl.registerLazySingleton(() => SurveyService());
}
16 changes: 16 additions & 0 deletions lib/core/service/survey_service.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import 'package:surveysparrow_flutter_sdk/surveysparrow.dart';

enum SurveyScreens { homeScreen }

//This class use spot check service for survey
class SurveyService {
final SpotCheck spotCheck = SpotCheck(
domainName: "<your_domain>",
targetToken: "<target_token>",
userDetails: {},
);

void trackScreen(SurveyScreens screen) {
spotCheck.trackScreen(screen.name);
}
}