-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: integrate survey questions screen (#64)
- Loading branch information
1 parent
485d6f9
commit 6f24fa3
Showing
29 changed files
with
442 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import 'package:object_mapper/object_mapper.dart'; | ||
|
||
class SurveySubmitAnswerInfo with Mappable { | ||
SurveySubmitAnswerInfo({required this.id, this.answer}); | ||
|
||
String id; | ||
String? answer; | ||
|
||
@override | ||
void mapping(Mapper map) { | ||
map<String>("id", id, (v) => id = v as String); | ||
map<String>("answer", answer, (v) => answer = v as String?); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'package:object_mapper/object_mapper.dart'; | ||
import 'package:survey/models/survey_submit_answer_info.dart'; | ||
|
||
class SurveySubmitQuestionInfo with Mappable { | ||
const SurveySubmitQuestionInfo({ | ||
required this.questionId, | ||
required this.answers, | ||
}); | ||
|
||
final String questionId; | ||
final List<SurveySubmitAnswerInfo> answers; | ||
|
||
@override | ||
void mapping(Mapper map) { | ||
map<String>("id", questionId, (v) {}); | ||
map<SurveySubmitAnswerInfo>("answers", answers, (v) {}); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
lib/modules/survey_completed/survey_completed_interactor.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
part of 'survey_completed_module.dart'; | ||
|
||
abstract class SurveyCompletedInteractorDelegate {} | ||
|
||
abstract class SurveyCompletedInteractor extends ArgumentsInteractor< | ||
SurveyCompletedInteractorDelegate, SurveyCompletedArguments> {} | ||
|
||
class SurveyCompletedInteractorImpl extends SurveyCompletedInteractor {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import 'package:flutter/widgets.dart' hide Router; | ||
import 'package:survey/core/viper/module.dart'; | ||
import 'package:survey/models/survey_question_info.dart'; | ||
|
||
part 'survey_completed_view.dart'; | ||
|
||
part 'survey_completed_interactor.dart'; | ||
|
||
part 'survey_completed_presenter.dart'; | ||
|
||
part 'survey_completed_router.dart'; | ||
|
||
class SurveyCompletedModule extends ArgumentsModule< | ||
SurveyCompletedView, | ||
SurveyCompletedInteractor, | ||
SurveyCompletedPresenter, | ||
SurveyCompletedRouter, | ||
SurveyCompletedArguments> { | ||
static const routePath = "survey/completed"; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const SurveyCompletedViewImpl(); | ||
} | ||
} | ||
|
||
class SurveyCompletedArguments extends ModuleArguments { | ||
SurveyCompletedArguments({required this.outro}); | ||
|
||
final SurveyQuestionInfo outro; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
part of 'survey_completed_module.dart'; | ||
|
||
abstract class SurveyCompletedPresenter extends Presenter<SurveyCompletedView, | ||
SurveyCompletedInteractor, SurveyCompletedRouter> {} | ||
|
||
class SurveyCompletedPresenterImpl extends SurveyCompletedPresenter | ||
implements SurveyCompletedViewDelegate, SurveyCompletedInteractorDelegate {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
part of 'survey_completed_module.dart'; | ||
|
||
abstract class SurveyCompletedRouter extends Router {} | ||
|
||
class SurveyCompletedRouterImpl extends SurveyCompletedRouter {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
part of 'survey_completed_module.dart'; | ||
|
||
abstract class SurveyCompletedViewDelegate {} | ||
|
||
abstract class SurveyCompletedView extends View<SurveyCompletedViewDelegate> {} | ||
|
||
class SurveyCompletedViewImpl extends StatefulWidget { | ||
const SurveyCompletedViewImpl({Key? key}) : super(key: key); | ||
|
||
@override | ||
_SurveyCompletedViewImplState createState() => | ||
_SurveyCompletedViewImplState(); | ||
} | ||
|
||
class _SurveyCompletedViewImplState extends ViewState< | ||
SurveyCompletedViewImpl, | ||
SurveyCompletedModule, | ||
SurveyCompletedViewDelegate> implements SurveyCompletedView { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Container(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.