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: 오류 수정 및 동영상 GIF수정 #63

Merged
merged 1 commit 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
Binary file added assets/images/sentance.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/word.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions lib/bindings/root_binding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:earlips/viewModels/home/home_viewmodel.dart';
import 'package:earlips/viewModels/root/root_viewmodel.dart';
import 'package:earlips/viewModels/study/study_viewmodel.dart';
import 'package:earlips/viewModels/realtime/real_create_viewmodel.dart';
import 'package:earlips/viewModels/word/word_viewmodel.dart';

class RootBinding extends Bindings {
@override
Expand Down
1 change: 1 addition & 0 deletions lib/models/phoneme_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,4 @@ List<Phoneme> rControlledVowels = [
description: 'Fort, more, door',
imageSrc: 'assets/images/phoneme/vowels_1.png'),
];

166 changes: 69 additions & 97 deletions lib/views/phoneme/phoneme_detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:earlips/utilities/style/color_system.dart';
import 'package:earlips/viewModels/word/word_viewmodel.dart';
import 'package:earlips/views/phoneme/widget/phoneme_list_widget.dart';
import 'package:earlips/views/word/widget/blue_back_appbar.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
Expand All @@ -15,120 +14,93 @@ class PhonemeDetailScreen extends StatelessWidget {
PhonemeDetailScreen(
{super.key, required this.phoneme, required this.realString});


final wordViewModel = Get.find<WordViewModel>();

@override
Widget build(BuildContext context) {
Get.put(WordViewModel(type: 0));
wordViewModel.generateDescription(phoneme.symbol);

return Scaffold(
appBar: PreferredSize(
preferredSize: const Size.fromHeight(kToolbarHeight),
child: BlueBackAppbar(title: 'Details for ${phoneme.symbol}'),
),
body: SingleChildScrollView(
child: Center(
child: Column(
children: [
Container(
decoration: const BoxDecoration(
color: ColorSystem.main2,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(24),
bottomRight: Radius.circular(24),
),
body: Center(
child: Column(
children: [
Container(
decoration: const BoxDecoration(
color: ColorSystem.main2,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(24),
bottomRight: Radius.circular(24),
),
child: Column(
children: [
const SizedBox(height: 20),
// --------------------------- 발음 카드
PhonemeListWidget(
phoneme: phoneme,
realString: realString,
),
SizedBox(
height: 70,
child: Column(
children: [
const SizedBox(
height: 15,
),
child: Column(
children: [
const SizedBox(height: 20),
// --------------------------- 발음 카드
PhonemeListWidget(
phoneme: phoneme,
realString: realString,
),
SizedBox(
height: 70,
child: Column(
children: [
const SizedBox(
height: 15,
),
// --------------------------- 발음 안내
Text(
"word_type_12_height".tr,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: ColorSystem.white,
),
// --------------------------- 발음 안내
Text(
"word_type_12_height".tr,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: ColorSystem.white,
),
)
],
),
),
],
),
],
),
),
// --------------------------- 발음 세부 내용 기입
const Padding(
padding: EdgeInsets.all(20),
child: Column(
children: [
// SvgPicture.asset(
// 'assets/images/phoneme/vowels_1.svg',
// width: 90,
// height: 90,
// ),
],
),
),
],
),
_BottomBox(phoneme: phoneme),
],
),
),
),
);
}
}

class _BottomBox extends StatelessWidget {
const _BottomBox({super.key, required this.phoneme});

final Phoneme phoneme;
),

@override
Widget build(BuildContext context) {
return Column(
children: [
Image.asset(
phoneme.imageSrc,
width: Get.width * 0.50,
),
const SizedBox(height: 25),
Container(
padding: const EdgeInsets.all(20.0),
width: Get.width - 40,
margin: const EdgeInsets.only(bottom: 40),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.0),
color: const Color(0x80FFFFFF), // 80은 50%
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.1),
spreadRadius: 0,
blurRadius: 20,
offset: const Offset(0, 4),
// --------------------------- 발음 세부 내용 기입
// image
Padding(
padding: const EdgeInsets.all(20),
child: Column(
children: [
Obx(() {
// isLoading이 true이면 로딩 인디케이터를 보여줌
if (wordViewModel.isLoadingGemini.value) {
return const Center(
child: CircularProgressIndicator(), // 로딩 인디케이터
);
} else {
// isLoading이 false이면 설명 텍스트를 보여줌
return Text(
wordViewModel.description.value,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Colors.black, // ColorSystem.black으로 가정
),
);
}
}),
],
),
],
),
child: Text(
phoneme.description,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
),
),

const Spacer(),
],
),
],
),
);
}
}
}
126 changes: 126 additions & 0 deletions lib/views/phoneme/vowel_datail_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import 'package:earlips/models/phoneme_model.dart';
import 'package:earlips/utilities/style/color_system.dart';
import 'package:earlips/views/phoneme/widget/phoneme_list_widget.dart';
import 'package:earlips/views/word/widget/blue_back_appbar.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';

class VowelDetailScreen extends StatelessWidget {
final Phoneme phoneme;

const VowelDetailScreen({super.key, required this.phoneme, required String realString});

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: PreferredSize(
preferredSize: const Size.fromHeight(kToolbarHeight),
child: BlueBackAppbar(title: 'Details for ${phoneme.symbol}'),
),
body: SingleChildScrollView(
child: Center(
child: Column(
children: [
Container(
decoration: const BoxDecoration(
color: ColorSystem.main2,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(24),
bottomRight: Radius.circular(24),
),
),
child: Column(
children: [
const SizedBox(height: 20),
// --------------------------- 발음 카드
PhonemeListWidget(phoneme: phoneme, realString: '',),
SizedBox(
height: 70,
child: Column(
children: [
const SizedBox(
height: 15,
),
// --------------------------- 발음 안내
Text(
"word_type_12_height".tr,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: ColorSystem.white,
),
),
],
),
),
],
),
),

// --------------------------- 발음 세부 내용 기입
// image
const Padding(
padding: EdgeInsets.all(20),
child: Column(
children: [
// SvgPicture.asset(
// 'assets/images/phoneme/vowels_1.svg',
// width: 90,
// height: 90,
// ),
],
),
),
_BottomBox(phoneme: phoneme),
],
),
),
),
);
}
}

class _BottomBox extends StatelessWidget {
const _BottomBox({super.key, required this.phoneme});

final Phoneme phoneme;

@override
Widget build(BuildContext context) {
return Column(
children: [
Image.asset(
phoneme.imageSrc,
width: Get.width * 0.50,
),
const SizedBox(height: 25),
Container(
padding: const EdgeInsets.all(20.0),
width: Get.width - 40,
margin: EdgeInsets.only(bottom: 40),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.0),
color: Color(0x80FFFFFF), // 80은 50%
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.1),
spreadRadius: 0,
blurRadius: 20,
offset: const Offset(0, 4),
),
],
),
child: Text(
phoneme.description,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
),
],
);
}
}
4 changes: 3 additions & 1 deletion lib/views/phoneme/widget/vowles_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import 'package:earlips/views/phoneme/phoneme_detail_screen.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../vowel_datail_screen.dart';

class VowelsWidget extends StatelessWidget {
final int type; // 0 for vowels, 1 for consonants, 2 for R-Controlled Vowels
const VowelsWidget({
Expand All @@ -28,7 +30,7 @@ class VowelsWidget extends StatelessWidget {
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
Get.to(() => PhonemeDetailScreen(
Get.to(() => VowelDetailScreen(
phoneme: phonemes[index],
realString: phonemes[index].symbol,
));
Expand Down
Loading
Loading