-
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.
# Conflicts: # coverage/lcov.info # lib/models/survey_info.dart # lib/repositories/survey_repository.dart # lib/services/api/api_service.dart # test/modules/side_menu/side_menu_presenter_test.dart
- Loading branch information
1 parent
ba47934
commit 762bbab
Showing
25 changed files
with
464 additions
and
156 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,6 @@ | ||
import 'package:survey/models/survey_info.dart'; | ||
import 'package:survey/models/survey_question_info.dart'; | ||
|
||
class DetailedSurveyInfo extends SurveyInfo { | ||
late List<SurveyQuestionInfo> questions; | ||
} |
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,87 @@ | ||
import 'package:object_mapper/object_mapper.dart'; | ||
|
||
class SurveyQuestionInfo with Mappable { | ||
String? id; | ||
String? content; | ||
int? displayOrder; | ||
SurveyQuestionPickType? pickType; | ||
SurveyQuestionDisplayType? displayType; | ||
bool? isMandatory; | ||
String? coverImageUrl; | ||
double? coverImageOpacity; | ||
|
||
@override | ||
void mapping(Mapper map) { | ||
map<String>( | ||
"id", | ||
id, | ||
(v) => id = v as String, | ||
); | ||
map<String>( | ||
"attributes.text", | ||
content, | ||
(v) => content = v as String, | ||
); | ||
map<int>( | ||
"attributes.display_order", | ||
displayOrder, | ||
(v) => displayOrder = v as int, | ||
); | ||
map<SurveyQuestionPickType>( | ||
"attributes.pick", | ||
pickType, | ||
(v) => pickType = v as SurveyQuestionPickType?, | ||
const EnumTransform<SurveyQuestionPickType, String>(), | ||
); | ||
map<SurveyQuestionDisplayType>( | ||
"attributes.display_type", | ||
displayType, | ||
(v) => displayType = v as SurveyQuestionDisplayType?, | ||
const EnumTransform<SurveyQuestionDisplayType, String>(), | ||
); | ||
map<bool>( | ||
"attributes.is_mandatory", | ||
isMandatory, | ||
(v) => isMandatory = v as bool, | ||
); | ||
map<String>( | ||
"attributes.cover_image_url", | ||
coverImageUrl, | ||
(v) => coverImageUrl = v as String?, | ||
); | ||
map<double>( | ||
"attributes.cover_image_opacity", | ||
coverImageOpacity, | ||
(v) => coverImageOpacity = v as double?, | ||
); | ||
} | ||
} | ||
|
||
// ignore: avoid_implementing_value_types | ||
class SurveyQuestionDisplayType extends Enumerable<String> { | ||
const SurveyQuestionDisplayType(this.rawValue); | ||
|
||
@override | ||
final String rawValue; | ||
|
||
static const intro = SurveyQuestionDisplayType("intro"); | ||
static const star = SurveyQuestionDisplayType("star"); | ||
static const heart = SurveyQuestionDisplayType("heart"); | ||
static const smiley = SurveyQuestionDisplayType("smiley"); | ||
static const choice = SurveyQuestionDisplayType("choice"); | ||
static const nps = SurveyQuestionDisplayType("NPS"); | ||
static const textarea = SurveyQuestionDisplayType("textarea"); | ||
static const textField = SurveyQuestionDisplayType("textfield"); | ||
static const outro = SurveyQuestionDisplayType("outro"); | ||
} | ||
|
||
class SurveyQuestionPickType extends Enumerable<String> { | ||
const SurveyQuestionPickType(this.rawValue); | ||
|
||
@override | ||
final String rawValue; | ||
|
||
static const none = SurveyQuestionDisplayType("none"); | ||
static const one = SurveyQuestionDisplayType("one"); | ||
static const any = SurveyQuestionDisplayType("any"); | ||
} |
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.