|
|
@ -63,7 +63,6 @@ class LevelBloc extends Bloc<LevelEvent, LevelState> { |
|
|
|
final ScrollController scrollController = ScrollController(); |
|
|
|
|
|
|
|
/// ------------Functions------------ |
|
|
|
|
|
|
|
void goToQuestionPage(BuildContext context, LevelEntity level){ |
|
|
|
context.pushNamed( |
|
|
|
Routes.questionPage, |
|
|
@ -73,6 +72,10 @@ class LevelBloc extends Bloc<LevelEvent, LevelState> { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
void goToHomePage(BuildContext context){ |
|
|
|
context.pop(); |
|
|
|
} |
|
|
|
|
|
|
|
/// ------------Api Calls------------ |
|
|
|
FutureOr<void> _getLevelListEvent(GetLevelListEvent event, |
|
|
|
Emitter<LevelState> emit) async { |
|
|
@ -87,12 +90,13 @@ class LevelBloc extends Bloc<LevelEvent, LevelState> { |
|
|
|
getLevelStatus: const BaseComplete(''), |
|
|
|
chooseLevel: data.first, |
|
|
|
)); |
|
|
|
await Future.delayed(Duration(milliseconds: 500)); |
|
|
|
scrollController.animateTo( |
|
|
|
scrollController.position.maxScrollExtent, |
|
|
|
duration: Duration(seconds: 1), |
|
|
|
curve: Curves.easeInOut, |
|
|
|
); |
|
|
|
await Future.delayed(Duration(milliseconds: 500), () { |
|
|
|
scrollController.animateTo( |
|
|
|
scrollController.position.maxScrollExtent, |
|
|
|
duration: Duration(seconds: 500), |
|
|
|
curve: Curves.easeInOut, |
|
|
|
); |
|
|
|
}); |
|
|
|
}, |
|
|
|
(error) {}, |
|
|
|
); |
|
|
|