Skip to content

Commit

Permalink
♻️refactor : #53 실시간 발음테스트 텍스트 자동삭제 및 언어
Browse files Browse the repository at this point in the history
  • Loading branch information
bunju20 committed Apr 9, 2024
1 parent a1c3f5a commit b9a0417
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion lib/bindings/root_binding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ class RootBinding extends Bindings {
Get.put(HomeViewModel());
Get.put(StudyViewModel());
Get.put(RealCreateViewModel());

}
}
3 changes: 3 additions & 0 deletions lib/viewModels/realtime/real_create_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class RealCreateViewModel extends GetxController {
requestPermission();
}

void clearText() {
text.value = '';
}
void toggleRecording() {
print("녹음 버튼 클릭" );
if (isRecording.value) {
Expand Down
9 changes: 6 additions & 3 deletions lib/views/realtime/real_create_script_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class RealCreateScriptPage extends BaseScreen<RealCreateViewModel> {

return Scaffold(
appBar: AppBar(
title: Text('Live Script Title'),
title: Text('live_script_title'.tr),
centerTitle: true,
leading: IconButton(
icon: const Icon(Icons.arrow_back),
Expand All @@ -29,7 +29,7 @@ class RealCreateScriptPage extends BaseScreen<RealCreateViewModel> {
expands: true,
maxLines: null,
decoration: InputDecoration(
hintText: 'Voice Recognition',
hintText: 'voice_recognition'.tr,
fillColor: Colors.white,
filled: true,
border: OutlineInputBorder(
Expand All @@ -53,7 +53,10 @@ class RealCreateScriptPage extends BaseScreen<RealCreateViewModel> {
),
child: InkWell(
borderRadius: BorderRadius.circular(40),
onTap: () => speechController.toggleRecording(),
onTap: (){
speechController.toggleRecording();
speechController.clearText();
},
child: Padding(
padding: const EdgeInsets.all(20),
child: Icon(
Expand Down

0 comments on commit b9a0417

Please sign in to comment.