-
Notifications
You must be signed in to change notification settings - Fork 0
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] 신고하기 UI #90
Open
HI-JIN2
wants to merge
6
commits into
main
Choose a base branch
from
feat/user-report
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+255
−0
Open
[Feat] 신고하기 UI #90
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import 'package:cogo/common/widgets/atoms/texts/styles.dart'; | ||
import 'package:cogo/common/widgets/components/basic_button.dart'; | ||
import 'package:cogo/common/widgets/components/basic_textfield.dart'; | ||
import 'package:cogo/common/widgets/components/secondary_button.dart'; | ||
import 'package:cogo/constants/colors.dart'; | ||
import 'package:cogo/features/home/report/report_view_model.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_svg/svg.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
class ReportDetailScreen extends StatelessWidget { | ||
const ReportDetailScreen({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ChangeNotifierProvider( | ||
create: (context) => ReportViewModel(), | ||
child: Scaffold( | ||
backgroundColor: CogoColor.white50, | ||
resizeToAvoidBottomInset: true, | ||
appBar: AppBar( | ||
backgroundColor: CogoColor.white50, | ||
title: const Text( | ||
"신고하기", | ||
style: CogoTextStyle.body20, | ||
), | ||
centerTitle: true, | ||
leading: IconButton( | ||
icon: SvgPicture.asset('assets/icons/button/chevron_left.svg'), | ||
onPressed: () => Navigator.of(context).pop(), | ||
), | ||
), | ||
body: SingleChildScrollView( | ||
child: SafeArea( | ||
child: Padding( | ||
padding: const EdgeInsets.all(20.0), | ||
child: Consumer<ReportViewModel>( | ||
builder: (context, viewModel, child) { | ||
return Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
const Text( | ||
"신고 세부 내용", | ||
style: CogoTextStyle.body16, | ||
), | ||
const SizedBox(height: 10), | ||
BasicTextField( | ||
controller: viewModel.reportController, | ||
hintText: '신고하실 내용을 자세히 작성해주세요', | ||
currentCount: viewModel.reportCharCount, | ||
maxCount: 200, | ||
size: BasicTextFieldSize.LARGE, | ||
maxLines: 1, | ||
), | ||
const SizedBox(height: 10), | ||
const Text('유의사항', style: CogoTextStyle.bodySB14), | ||
const SizedBox(height: 10), | ||
const Text( | ||
'신고 후 신고 내역에 따라 해당 유저에게 안내가 이루어질 예정입니다.\n각 항목 별 세부 사항은 다음과 같습니다.\n\n' | ||
'멘토링의 목적이 아닌것\n- 종교단체\n - 사업목적 (보험, 광고, etc)\n- 기타 멘토링으로 의도되지 않는 모든 행위\n\n' | ||
'멘토링 과정에서 비매너 행위 발생\n- 잘못된 정보 제공\n- 상대방에 부적절한 언행\n- 기타 양자간 분쟁 가능성이 있는 비매너 행위', | ||
style: CogoTextStyle.body9, | ||
), | ||
const SizedBox(height: 80), | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
SecondaryButton( | ||
text: '취소', | ||
onPressed: () => Navigator.of(context).pop(), | ||
), | ||
const SizedBox(width: 16), // 버튼들 사이에 16만큼 간격을 추가 | ||
BasicButton( | ||
text: '신고', | ||
isClickable: true, | ||
onPressed: viewModel.postReport, | ||
) | ||
], | ||
) | ||
], | ||
); | ||
}), | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import 'package:cogo/common/widgets/atoms/texts/styles.dart'; | ||
import 'package:cogo/constants/colors.dart'; | ||
import 'package:cogo/constants/paths.dart'; | ||
import 'package:cogo/features/home/report/report_view_model.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_svg/svg.dart'; | ||
import 'package:go_router/go_router.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
class ReportScreen extends StatelessWidget { | ||
const ReportScreen({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ChangeNotifierProvider( | ||
create: (context) => ReportViewModel(), | ||
child: Scaffold( | ||
backgroundColor: CogoColor.white50, | ||
resizeToAvoidBottomInset: true, | ||
appBar: AppBar( | ||
backgroundColor: CogoColor.white50, | ||
title: const Text( | ||
"신고하기", | ||
style: CogoTextStyle.body20, | ||
), | ||
centerTitle: true, | ||
leading: IconButton( | ||
icon: SvgPicture.asset('assets/icons/button/chevron_left.svg'), | ||
onPressed: () => Navigator.of(context).pop(), | ||
), | ||
), | ||
body: SingleChildScrollView( | ||
child: SafeArea( | ||
child: Padding( | ||
padding: const EdgeInsets.all(20.0), | ||
child: Consumer<ReportViewModel>( | ||
builder: (context, viewModel, child) { | ||
return Column( | ||
children: [ | ||
ListTile( | ||
title: const Text( | ||
'멘토링의 목적을 가지고 멘토가 만난것 같지 않아요', | ||
style: CogoTextStyle.body16, | ||
), | ||
trailing: const Icon(Icons.chevron_right), | ||
onTap: () { | ||
context.push(Paths.reportDetail); | ||
}, | ||
), | ||
const Divider(height: 1, color: CogoColor.systemGray02), | ||
ListTile( | ||
title: const Text( | ||
'멘토링 중에 분쟁 발생했어요', | ||
style: CogoTextStyle.body16, | ||
), | ||
trailing: const Icon(Icons.chevron_right), | ||
onTap: () { | ||
context.push(Paths.reportDetail); | ||
}, | ||
), | ||
const Divider(height: 1, color: CogoColor.systemGray02), | ||
ListTile( | ||
title: const Text( | ||
'멘토의 소속이나, 인적사항이 거짓인것 같아요', | ||
style: CogoTextStyle.body16, | ||
), | ||
trailing: const Icon(Icons.chevron_right), | ||
onTap: () { | ||
context.push(Paths.reportDetail); | ||
}, | ||
), | ||
const Divider(height: 1, color: CogoColor.systemGray02), | ||
ListTile( | ||
title: const Text('기타 부적절한 행위가 있었어요', | ||
style: CogoTextStyle.body16), | ||
trailing: const Icon(Icons.chevron_right), | ||
onTap: () { | ||
context.push(Paths.reportDetail); | ||
}), | ||
], | ||
); | ||
}), | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
|
||
class ReportViewModel extends ChangeNotifier { | ||
final TextEditingController reportController = TextEditingController(); | ||
|
||
int get reportCharCount => reportController.text.length; | ||
|
||
ReportViewModel() { | ||
reportController.addListener(() { | ||
notifyListeners(); | ||
}); | ||
} | ||
|
||
bool postReport() { | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아래 바텀 버튼을 내리기 위해서 사이즈 박스로 임의로 빈공간을 주신 것 같은데 이러면 폰 마다 사이즈가 달라서 완벽하게 버튼이 아래로 위치하도록 만들기 어렵지 않나요???
Padding을 사용해서 (padding: const EdgeInsets.only(bottom: 20.0)이렇게!!) 하면 폰 화면 아래서부터 20 떨어진 곳에 위치하도록 만들 수 있어요!