Skip to content

Commit

Permalink
Merge branch 'develop' into yeonjin_fix/#146
Browse files Browse the repository at this point in the history
  • Loading branch information
yeoncheong authored Jun 2, 2023
2 parents 082de0f + 8bd9c1b commit ff56b64
Show file tree
Hide file tree
Showing 8 changed files with 725 additions and 20 deletions.
597 changes: 597 additions & 0 deletions assets/fword_list.txt

Large diffs are not rendered by default.

23 changes: 13 additions & 10 deletions lib/learn/accent_learn/presentation/accent_learn_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -720,9 +720,10 @@ class _AccentPracticePageState extends State<AccentPracticePage> with TickerProv
child: Container(
width: 20,
height: 21,
child: Image.network("${_authManager.getPhoto()}"),
child: Image.network("${_authManager.getPhoto()}",
fit: BoxFit.cover,
),
)

),
const SizedBox(width: 9,),
Text(
Expand Down Expand Up @@ -1112,23 +1113,25 @@ class _AccentPracticePageState extends State<AccentPracticePage> with TickerProv
return practiceGraph();
}(),

const SizedBox(height: 20,),
const SizedBox(height: 12,),

Container(
padding: const EdgeInsets.symmetric(horizontal: 20),
// padding: const EdgeInsets.symmetric(horizontal: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text(
"표준 억양 그래프 보기",
style: TextStyles.medium25TextStyle,
style: TextStyles.regular55TextStyle,
),
const SizedBox(width: 12,),
FlutterSwitch(
width: 60,
height: 32,
toggleSize: 32,
width: 52,
height: 28,
// toggleSize: 28,
value: isSwitched,
padding: 3,
activeColor: ColorStyles.saeraPink,
onToggle: (val) {
setState(() {
Expand Down Expand Up @@ -1171,7 +1174,7 @@ class _AccentPracticePageState extends State<AccentPracticePage> with TickerProv
practiceSentenceSection(),
exampleSection(),
practiceSection(),
SizedBox(height: 20,),
const SizedBox(height: 20,),
],
),
)
Expand Down
19 changes: 11 additions & 8 deletions lib/learn/accent_learn/presentation/accent_todaylearn_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,9 @@ class _AccentTodayPracticePageState extends State<AccentTodayPracticePage> with
child: Container(
width: 20,
height: 21,
child: Image.network("${_authManager.getPhoto()}"),
child: Image.network(
"${_authManager.getPhoto()}",
fit: BoxFit.cover,),
)

),
Expand Down Expand Up @@ -1252,28 +1254,29 @@ class _AccentTodayPracticePageState extends State<AccentTodayPracticePage> with
const SizedBox(height: 12,),

Container(
padding: const EdgeInsets.symmetric(horizontal: 20),
// padding: const EdgeInsets.symmetric(horizontal: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text(
"표준 억양 그래프 보기",
style: TextStyles.medium25TextStyle,
style: TextStyles.regular55TextStyle,
),
const SizedBox(width: 12,),
FlutterSwitch(
width: 60,
height: 32,
toggleSize: 32,
width: 52,
height: 28,
// toggleSize: 28,
value: isSwitched,
padding: 3,
activeColor: ColorStyles.saeraPink,
onToggle: (val) {
setState(() {
isSwitched = val;
});
},
),

],
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart';
import 'package:get/get.dart';
import 'package:flutter/services.dart' show rootBundle;

import 'package:saera/learn/custom_learn/create_sentence/presentation/custom_statement_done_screen.dart';
import 'package:saera/learn/custom_learn/create_sentence/presentation/widgets/check_badword.dart';
import 'package:saera/learn/custom_learn/create_sentence/presentation/widgets/subtitle_section.dart';
import 'package:http/http.dart' as http;

import 'package:saera/style/font.dart';
import 'package:saera/style/color.dart';

Expand Down Expand Up @@ -169,6 +173,71 @@ class _CreateSentenceScreenState extends State<CreateSentenceScreen> {

Widget createBtn(){
return GestureDetector(
onTap: () async {
// 비속어 검사 진행
var check = await isBadWord(customStatement);
print("check: $check");

if(check){
showDialog(
context: context,
builder: (BuildContext context) => AlertDialog(
insetPadding: EdgeInsets.symmetric(horizontal: 18),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(20))
),
title: const Center(
child: Text("\u{1f625}"),
),
content: Container(
child: Text(
"비속어가 포함된 문장은 생성할 수 없어요.",
style: TextStyles.medium00TextStyle,
textAlign: TextAlign.center,
),
),
actions: [
Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Padding(padding: EdgeInsets.all(4)),
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
style: TextButton.styleFrom(
fixedSize: Size(MediaQuery.sizeOf(context).width - 80, 48),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16)
),
backgroundColor: ColorStyles.saeraAppBar
),
child: const Text(
"다른 문장 만들러 가기",
style: TextStyles.mediumWhiteTextStyle,
)
),
const Padding(padding: EdgeInsets.all(4))
],
),
const Padding(padding: EdgeInsets.all(4))
],
)
],
)
);
}
else{
Future<int> id;
id = createStatement();
id.then((id){
Navigator.push(
context, MaterialPageRoute(builder: (context) => CustomDonePage(id: id,))
);
});
}
onTap: (){
Future<dynamic> state = checkDuplication(customStatement);
state.then((result){
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart' show rootBundle;

Future<String> getData() async {
try {
return await rootBundle.loadString('assets/fword_list.txt');
} catch (e) {
throw (e.toString());
}
}

Future<bool> isBadWord(String str) async {
var contents = "";
var badwords = List.empty(growable : true);

contents = await getData();

final rows = await contents.split('\n');

for(var row in rows){
badwords.add(row);
}

for(int i = 0; i < badwords.length; i++){
if(str.contains(badwords[i])){
return true;
}
}

return false;
}
3 changes: 2 additions & 1 deletion lib/learn/pronounce_learn/pronounce_learn_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,8 @@ class _PronouncePracticePageState extends State<PronouncePracticePage> with Tick
child: Container(
width: 20,
height: 21,
child: Image.network("${_authManager.getPhoto()}"),
child: Image.network("${_authManager.getPhoto()}",
fit: BoxFit.cover,),
)

),
Expand Down
2 changes: 1 addition & 1 deletion lib/style/font.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class TextStyles {
static const medium99TextStyle = TextStyle(fontFamily: "NotoSansKR", fontSize: 16, fontWeight: FontWeight.normal, color: Color(0xff999999));
static const medium99BoldTextStyle = TextStyle(fontFamily: "NotoSansKR", fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff999999));
static const mediumAATextStyle = TextStyle(fontFamily: "NotoSansKR", fontSize: 16, fontWeight: FontWeight.normal, color: Color(0xffAAAAAA));
static const mediumWhiteTextStyle = TextStyle(fontFamily: "NotoSansKR", fontSize: 16, fontWeight: FontWeight.normal, color: Color(0xffFFFFFF));
static const mediumWhiteTextStyle = TextStyle(fontFamily: "NotoSansKR", fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xffFFFFFF));
static const mediumWhiteVeryBoldTextStyle = TextStyle(fontFamily: "NotoSansKR", fontSize: 16, fontWeight: FontWeight.w700, color: Color(0xffFFFFFF));
static const mediumGrayTextStyle = TextStyle(fontFamily: "NotoSansKR", fontSize: 16, fontWeight: FontWeight.normal, color: Color(0xff75817E));
static const mediumEFTextStyle = TextStyle(fontFamily: "NotoSansKR", fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xffEFEFEF), decoration: TextDecoration.none,);
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ flutter:
uses-material-design: true

assets:
- assets/
- assets/images/
- assets/icons/
- assets/mp3/
Expand Down

0 comments on commit ff56b64

Please sign in to comment.