Skip to content

Commit

Permalink
Merge pull request #59 from ✨feat: 문단, 단어 스크린 수정 및 진동 기능 추가(문장스크린)
Browse files Browse the repository at this point in the history
✨feat: 문단, 단어 스크린 수정 및 진동 기능 추가(문장스크린)
  • Loading branch information
seochan99 authored May 4, 2024
2 parents 7f0666c + a6230d5 commit 31ca0fa
Show file tree
Hide file tree
Showing 14 changed files with 453 additions and 262 deletions.
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

0 comments on commit 31ca0fa

Please sign in to comment.