-
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.
* add MBTIScreen bases * add MBTI Provider(with Firebase) & PageView Animation * add freezed files * add mbti function * fix Strings to Constant * fix Enum class to Widget remove TODO fix list name obvious
- Loading branch information
Showing
23 changed files
with
870 additions
and
170 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
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.