Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
jwson-automation committed Aug 28, 2024
1 parent 4b28022 commit 12266d9
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 27 deletions.
4 changes: 4 additions & 0 deletions assets/images/1_smile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/images/2_angry.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/images/3_funny.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 removed assets/voice/voice_1.mp3
Binary file not shown.
Binary file added assets/voice/voice_1.wav
Binary file not shown.
Binary file removed assets/voice/voice_2.mp3
Binary file not shown.
Binary file added assets/voice/voice_2.wav
Binary file not shown.
Binary file removed assets/voice/voice_3.mp3
Binary file not shown.
Binary file added assets/voice/voice_3.wav
Binary file not shown.
Binary file removed assets/voice/voice_4.mp3
Binary file not shown.
5 changes: 4 additions & 1 deletion lib/feature/voiceOutput/widget/VoiceOutputButton.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import 'package:audioplayers/audioplayers.dart';
import 'package:blueberry_flutter_template/feature/voiceOutput/provider/CategoryIondexProvider.dart';
import 'package:blueberry_flutter_template/utils/AppColors.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

final player = AudioPlayer();

class VoiceOutputButton extends ConsumerWidget {
const VoiceOutputButton({super.key});

Expand All @@ -14,7 +17,7 @@ class VoiceOutputButton extends ConsumerWidget {
radius: 50,
child: IconButton(
onPressed: () {
print('음성 출력: ${categoryIndex}');
player.play(AssetSource('voice/voice_${categoryIndex + 1}.wav'));
},
icon: const Icon(Icons.volume_up),
color: Colors.white,
Expand Down
19 changes: 10 additions & 9 deletions lib/feature/voiceOutput/widget/VoiceOutputCategoryListView.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import 'package:blueberry_flutter_template/feature/voiceOutput/provider/CategoryIondexProvider.dart';
import 'package:blueberry_flutter_template/gen/assets.gen.dart';
import 'package:blueberry_flutter_template/utils/AppColors.dart';
import 'package:flutter/material.dart';
import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/flutter_svg.dart';

class VoiceOutputCategoryListView extends ConsumerWidget {
const VoiceOutputCategoryListView({super.key});

@override
Widget build(BuildContext context, WidgetRef ref) {
// 카테고리 데이터를 리스트로 정의
final categories = ['화내는 남편', '놀러온 남자', '데이트 준비중', '조직폭력배 남자'];
final categories = ['마중 나온 남자', '약간 다투는 남자', '혼자 이야기 하는 남자'];
final svgImages = [Assets.images.a1Smile, Assets.images.a2Angry, Assets.images.a3Funny];

return CarouselSlider(
options: CarouselOptions(
Expand All @@ -31,14 +35,11 @@ class VoiceOutputCategoryListView extends ConsumerWidget {
flex: 2, // 여유 공간의 2/3 사용
child: CircleAvatar(
radius: 80, // 원의 크기 조정
backgroundColor: Colors.blue, // 원의 배경색
child: Text(
category[0], // 카테고리 이름의 첫 글자
style: const TextStyle(
color: Colors.white, // 텍스트 색상
fontSize: 40, // 텍스트 크기
fontWeight: FontWeight.bold, // 텍스트 두께
),
backgroundColor: primaryColor, // 원의 배경색
child: SvgPicture.asset(
svgImages[categories.indexOf(category)], // SVG 이미지 표시
width: 100, // SVG 이미지 너비
height: 100, // SVG 이미지 높이
),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ class VoiceOutputDescriptionTextBox extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final categoryIndex = ref.watch(categoryIndexProvider);

final descriptionList = [
'너는 항상 왜 그러는 거야?',
'늦었네..?',
'오늘도 수고 많았어~',
'뭐? 어떤 놈인데?',
];
final descriptionList = ['잘 갔다 왔어? 오늘 좀 늦었네?', '왔어? 우리 이야기 좀 하자', '아~ 진짜 드디어 왔네..'];

return Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
Expand Down
29 changes: 18 additions & 11 deletions lib/gen/assets.gen.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 12266d9

Please sign in to comment.