WT 1.1.14+2 sales page update
This commit is contained in:
@@ -12,6 +12,7 @@ part 'tutorial_state.dart';
|
||||
|
||||
class TutorialBloc extends Bloc<TutorialEvent, TutorialState> with Logging {
|
||||
late String tutorialName;
|
||||
final double mediaHeightBase = 390;
|
||||
bool isActive = false;
|
||||
bool canActivate = false;
|
||||
|
||||
@@ -46,6 +47,7 @@ class TutorialBloc extends Bloc<TutorialEvent, TutorialState> with Logging {
|
||||
|
||||
setNextStepData(step);
|
||||
isActive = true;
|
||||
canActivate = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -58,8 +60,9 @@ class TutorialBloc extends Bloc<TutorialEvent, TutorialState> with Logging {
|
||||
}
|
||||
if (tutorial != null && tutorial!.steps != null) {
|
||||
actualText = tutorial!.steps![step].tutorialTextTranslation;
|
||||
print("Step: $step, text: $actualText");
|
||||
|
||||
this.actualCheck = tutorial!.steps![step].checkText;
|
||||
print("Step: $step, text: $actualCheck");
|
||||
this.checks = [];
|
||||
|
||||
if (this.actualCheck != null) {
|
||||
@@ -78,27 +81,31 @@ class TutorialBloc extends Bloc<TutorialEvent, TutorialState> with Logging {
|
||||
|
||||
calculateHeight();
|
||||
}
|
||||
/* else {
|
||||
this.add(TutorialFinished());
|
||||
} */
|
||||
}
|
||||
|
||||
bool activateTutorial() {
|
||||
if (!canActivate) {
|
||||
print("Tutorial canActivate false");
|
||||
return false;
|
||||
}
|
||||
bool isTutorialDone() {
|
||||
ActivityDone? activityDone = ActivityDone.tutorialBasic.searchByString(tutorialName);
|
||||
|
||||
if (activityDone == null) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
bool? isActivityDone = Cache().activitiesDone[activityDone.toStr()];
|
||||
log("isActivityDone? $isActivityDone");
|
||||
|
||||
log("$tutorialName isActivityDone? $isActivityDone");
|
||||
if (isActivityDone == null || isActivityDone == true) {
|
||||
return true;
|
||||
}
|
||||
canActivate = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool activateTutorial() {
|
||||
if (isTutorialDone()) {
|
||||
isActive = false;
|
||||
canActivate = false;
|
||||
return false;
|
||||
}
|
||||
log("Running tutorial $activityDone");
|
||||
|
||||
init();
|
||||
return true;
|
||||
}
|
||||
@@ -135,20 +142,9 @@ class TutorialBloc extends Bloc<TutorialEvent, TutorialState> with Logging {
|
||||
if (action == null) {
|
||||
return step + 1;
|
||||
}
|
||||
/* bool found = false;
|
||||
if (tutorial != null && tutorial!.steps != null) {
|
||||
for (var nextStep in tutorial!.steps!) {
|
||||
print("step $step parent: ${nextStep.action!.parent}");
|
||||
if (step + 1 == nextStep.step) {
|
||||
next = nextStep.step!;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} */
|
||||
step++;
|
||||
next = step;
|
||||
print("Next step:! $next");
|
||||
print("Next step:! $step");
|
||||
if (step >= tutorial!.steps!.length) {
|
||||
next = -1;
|
||||
this.add(TutorialFinished());
|
||||
@@ -172,6 +168,7 @@ class TutorialBloc extends Bloc<TutorialEvent, TutorialState> with Logging {
|
||||
menuBloc!.add(MenuCreate());
|
||||
}
|
||||
} else if (event is TutorialNext) {
|
||||
print("Tutorial Next: ${event.text}");
|
||||
if (tutorial != null) {
|
||||
yield TutorialLoading();
|
||||
|
||||
@@ -195,7 +192,6 @@ class TutorialBloc extends Bloc<TutorialEvent, TutorialState> with Logging {
|
||||
yield TutorialReady();
|
||||
} else if (event is TutorialStart) {
|
||||
yield TutorialLoading();
|
||||
isActive = true;
|
||||
canActivate = true;
|
||||
step = 0;
|
||||
yield TutorialReady();
|
||||
|
||||
Reference in New Issue
Block a user