-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/2024-summer' into feature/lint
- Loading branch information
Showing
38 changed files
with
1,177 additions
and
195 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
import '../widgets/mbti/MBTIHomeWidget.dart'; | ||
|
||
part 'generated/MBTIModel.freezed.dart'; | ||
part 'generated/MBTIModel.g.dart'; | ||
|
||
@freezed | ||
class MBTIModel with _$MBTIModel { | ||
const factory MBTIModel({ | ||
required Extroversion extroversion, | ||
required Sensing sensing, | ||
required Thinking thinking, | ||
required Judging judging, | ||
}) = _MBTIModel; | ||
|
||
factory MBTIModel.fromJson(Map<String, dynamic> json) => | ||
_$MBTIModelFromJson(json); | ||
|
||
// 2진수 각 자리 index 위치 MBTI 검색 | ||
MBTIType getMBTI() { | ||
int index = 0; | ||
|
||
if (extroversion == Extroversion.E) index += 8; | ||
if (sensing == Sensing.S) index += 4; | ||
if (thinking == Thinking.T) index += 2; | ||
if (judging == Judging.J) index += 1; | ||
|
||
return MBTIType.values[index]; | ||
} | ||
} |
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,16 @@ | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
part 'generated/MBTIQuestionModel.freezed.dart'; | ||
part 'generated/MBTIQuestionModel.g.dart'; | ||
|
||
@freezed | ||
class MBTIQuestionModel with _$MBTIQuestionModel { | ||
const factory MBTIQuestionModel({ | ||
required String question, | ||
required String type, | ||
required String imageUrl, | ||
}) = _MBTIQuestionModel; | ||
|
||
factory MBTIQuestionModel.fromJson(Map<String, dynamic> json) => | ||
_$MBTIQuestionModelFromJson(json); | ||
} |
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.