-
Notifications
You must be signed in to change notification settings - Fork 4
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
Sparrow SDK #1282
Conversation
lib/core/service/survey_service.dart
Outdated
domainName: "lantern.surveysparrow.com", | ||
targetToken: AppSecret.myanmarSpotCheckTargetToken, | ||
// Should Not Pass userDetails as const | ||
userDetails: {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe create a method to create SpotCheck instances dynamically based on country code to remove the need for all these separate variables?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are taking about AppSecret.myanmarSpotCheckTargetToken
then that is not possible, this is a token needed need for each country.
default: | ||
_testingSpotCheck.trackScreen(screen.name); | ||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.. you could add a utility method to fetch a SpotCheck for a given country code., and then call trackScreen on it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
lib/core/service/survey_service.dart
Outdated
|
||
void trackScreen(SurveyScreens screen) { | ||
switch (sessionModel.country.value?.toLowerCase()) { | ||
case 'ru': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to use enums for country codes to avoid hardcoding them in multiple places?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, thanks
lib/core/service/survey_service.dart
Outdated
final filePath = await _surveyConfigPath; | ||
final file = File(filePath); | ||
if (await file.exists()) { | ||
final content = await file.readAsString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for reading the config here could also be extracted into a reusable method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but I think if we just use shared_pref here, there might be less overhead for this, What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Just a few comments on this one as well.. |
Changes are done, Do you mind taking a look again? |
No description provided.