Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨feat: 문단, 단어 스크린 수정 및 진동 기능 추가(문장스크린) #59

Merged
merged 5 commits into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE"/>
<application
android:label="earlips"
android:name="${applicationName}"
Expand Down
91 changes: 91 additions & 0 deletions assets/icons/vibrate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/output-onlinegiftools.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/sound.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/sound_wave.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions lib/models/word_card_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ class WordCard {
final String speaker;
final String video;
final int type;
final List<int> intensities;
final List<int> pattern;

WordCard({
required this.id,
required this.word,
required this.speaker,
required this.video,
required this.type,
required this.intensities,
required this.pattern,
});

Map<String, dynamic> toMap() {
Expand All @@ -20,16 +24,25 @@ class WordCard {
'speaker': speaker,
'video': video,
'type': type,
'intensities': intensities.join(','),
'pattern': pattern.join(','),
};
}

factory WordCard.fromDocument(Map<String, dynamic> doc) {
List<int> parseToIntList(String numbers) {
return numbers.split(',').map((s) => int.parse(s.trim())).toList();
}

return WordCard(
id: doc['id'],
word: doc['word'],
speaker: doc['speaker'],
video: doc['video'],
type: doc['type'],
intensities: doc['intensities'] != null ? parseToIntList(doc['intensities']) : [],
pattern: doc['pattern'] != null ? parseToIntList(doc['pattern']) : [],

);
}

Expand All @@ -39,13 +52,17 @@ class WordCard {
String? speaker,
String? video,
int? type,
List<int>? intensities,
List<int>? pattern,
}) {
return WordCard(
id: id ?? this.id,
word: word ?? this.word,
speaker: speaker ?? this.speaker,
video: video ?? this.video,
type: type ?? this.type,
intensities: intensities ?? this.intensities,
pattern: pattern ?? this.pattern,
);
}
}
Loading
Loading