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

M3-191 약관 동의 화면 #44

Merged
merged 31 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a65a3d9
M3-191 Feat : 약관 페이지 생성
tkdals802 Jul 23, 2024
c38c71e
M3-191 Feat : 약관 페이지 생성
tkdals802 Jul 23, 2024
e8c7a8b
M3-191 Feat : 페이지 라우트 수정
tkdals802 Jul 23, 2024
5a201cd
M3-191 Feat : 약관 등록 전체 동의, 부분 동의, 글자 크기 고정
tkdals802 Jul 23, 2024
4f51048
M3-191 Feat : 다음 버튼 설정
tkdals802 Jul 23, 2024
3a490a6
M3-191 Feat : 세부 페이지 생성
tkdals802 Jul 23, 2024
3fcb690
M3-191 Feat : 약관 작성
tkdals802 Jul 24, 2024
0a700ea
M3-191 Feat : 만 14세 이상 추가
tkdals802 Jul 24, 2024
3dfc1e1
M3-191 Feat : user info 롤백
tkdals802 Jul 24, 2024
3b4b149
M3-191 Feat : 화면 순서 조정
tkdals802 Jul 24, 2024
836fcb3
M3-191 Feat : 설정 페이지 약관 링크 연결
tkdals802 Jul 24, 2024
e0173be
M3-191 Feat : dart fix
tkdals802 Jul 24, 2024
78b5ef9
M3-191 Feat : dart fix
tkdals802 Jul 24, 2024
2aa8c6d
M3-191 Feat : dart fix
tkdals802 Jul 24, 2024
0de2535
Merge branch 'develop' into feature/M3-191-agreePolicyScreen
tkdals802 Jul 24, 2024
10659fe
M3-191 Feat : 약관 페이지 생성
tkdals802 Jul 23, 2024
31ac65d
M3-191 Feat : 약관 페이지 생성
tkdals802 Jul 23, 2024
5815f1c
M3-191 Feat : 페이지 라우트 수정
tkdals802 Jul 23, 2024
0ee210f
M3-191 Feat : 약관 등록 전체 동의, 부분 동의, 글자 크기 고정
tkdals802 Jul 23, 2024
852e794
M3-191 Feat : 다음 버튼 설정
tkdals802 Jul 23, 2024
66047b1
M3-191 Feat : 세부 페이지 생성
tkdals802 Jul 23, 2024
bafced9
M3-191 Feat : 약관 작성
tkdals802 Jul 24, 2024
0a456dd
M3-191 Feat : 만 14세 이상 추가
tkdals802 Jul 24, 2024
f8fbcc1
M3-191 Feat : user info 롤백
tkdals802 Jul 24, 2024
7674e42
M3-191 Feat : 화면 순서 조정
tkdals802 Jul 24, 2024
0b30c14
M3-191 Feat : 설정 페이지 약관 링크 연결
tkdals802 Jul 24, 2024
f047e15
M3-191 Feat : dart fix
tkdals802 Jul 24, 2024
cef81af
M3-191 Feat : dart fix
tkdals802 Jul 24, 2024
e32d105
M3-191 Feat : dart fix
tkdals802 Jul 24, 2024
d4f5936
M3-191 Feat : git conflict
tkdals802 Jul 24, 2024
8949879
M3-191 Feat : dart fix
tkdals802 Jul 24, 2024
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
4 changes: 4 additions & 0 deletions lib/constants/app_colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ import 'package:flutter/material.dart';
class AppColors {
static const Color primary = Color(0xFF0DF69E);
static const Color secondary = Color(0x290DF69E);
static const Color third = Color(0xFF022719);
static const Color primaryGradient = Color(0xFF08905C);
static const Color accent = Color(0xFFFF453A);
static const Color textPrimary = Colors.white;
static const Color textSecondary = Color(0xFFB6BABA);
static const Color textThird = Colors.black;
static const Color background = Colors.black;
static const Color backgroundSecondary = Color(0xFF1D1D1D);
static const Color backgroundThird = Color(0xFF333333);
static const Color boxColor = Color(0xFF1F1F1F);
static const Color boxColorSecond = Color(0xFF555555);
static const Color buttonColor = Colors.white;
static const Color navigationBarColor = Color(0xA6212121);
}
12 changes: 12 additions & 0 deletions lib/constants/text_styles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,16 @@ class TextStyles {
fontSize: 32,
fontWeight: FontWeight.w900,
);

static TextStyle fs28w800cTextPrimary = TextStyle(
color: AppColors.textPrimary,
fontSize: 28,
fontWeight: FontWeight.w800,
);

static TextStyle fx17w700cTextThird = TextStyle(
color: AppColors.textThird,
fontSize: 17,
fontWeight: FontWeight.w700,
);
}
2 changes: 1 addition & 1 deletion lib/controllers/login_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class LoginController extends GetxController {

_navigateAfterLogin(LoginResponse loginResponse) {
if (loginResponse.isSignUp!) {
Get.toNamed('/signup');
Get.toNamed('/policy');
} else {
Get.offAllNamed('/main');
}
Expand Down
53 changes: 53 additions & 0 deletions lib/controllers/policy_controller.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import 'package:get/get.dart';

class PolicyController extends GetxController {
late RxInt allPolicyChecked;
late RxList<int> checkPolicyList;

@override
void onInit() async{
super.onInit();
await init();
}

Future<void> init() async{
allPolicyChecked = 0.obs;
checkPolicyList = [0, 0, 0, 0].obs;
}

void changeValue(int valueNum) {
if (checkPolicyList[valueNum] == 0) {
checkPolicyList[valueNum] = 1;
} else {
checkPolicyList[valueNum] = 0;
}
}

bool checkAllChecked() {
int sum = 0;
for (var i in checkPolicyList) {
sum += i;
}
if (sum == 4) {
allPolicyChecked.value = 1;
return true;
} else {
allPolicyChecked.value = 0;
return false;
}
}

void allPolicyCheck() {
if (allPolicyChecked.value == 0) {
allPolicyChecked.value = 1;
for (int i = 0; i < 4; i++) {
checkPolicyList[i] = 1;
}
} else {
allPolicyChecked.value = 0;
for (int i = 0; i < 4; i++) {
checkPolicyList[i] = 0;
}
}
}
}
29 changes: 17 additions & 12 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:kakao_flutter_sdk/kakao_flutter_sdk_common.dart';
import 'controllers/permission_controller.dart';
import 'screens/login_screen.dart';
import 'screens/main_screen.dart';
import 'screens/policy_screen.dart';
import 'screens/setting_screen.dart';
import 'screens/sign_up_screen.dart';
import 'service/auth_service.dart';
Expand Down Expand Up @@ -36,19 +37,23 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
Get.put(PermissionController());

return GetMaterialApp(
title: 'Ground Flip',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
return MediaQuery(
data: MediaQuery.of(context).copyWith(textScaler: TextScaler.noScaling),
child: GetMaterialApp(
title: 'Ground Flip',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
initialRoute: initialRoute,
getPages: [
GetPage(name: '/main', page: () => const MainScreen()),
GetPage(name: '/login', page: () => const LoginScreen()),
GetPage(name: '/setting', page: () => const SettingScreen()),
GetPage(name: '/signup', page: () => const SignUpScreen()),
GetPage(name: '/policy', page: () => const PolicyScreen()),
],
),
initialRoute: initialRoute,
getPages: [
GetPage(name: '/main', page: () => const MainScreen()),
GetPage(name: '/login', page: () => const LoginScreen()),
GetPage(name: '/setting', page: () => const SettingScreen()),
GetPage(name: '/signup', page: () => const SignUpScreen()),
],
);
}
}
91 changes: 91 additions & 0 deletions lib/screens/policy_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../constants/app_colors.dart';
import '../constants/text_styles.dart';
import '../controllers/policy_controller.dart';
import '../widgets/policy/check_policy.dart';
import '../widgets/policy/policy_all_check.dart';
import 'sign_up_screen.dart';

class PolicyScreen extends StatelessWidget {
const PolicyScreen({super.key});

@override
Widget build(BuildContext context) {
PolicyController policyController = Get.put(PolicyController());

return Scaffold(
backgroundColor: AppColors.background,
body: SingleChildScrollView(
child: Column(
children: [
SizedBox(height: 87),
Padding(
padding: EdgeInsets.symmetric(vertical: 0, horizontal: 10),
child: Column(
children: [
Align(
alignment: Alignment.centerLeft,
child: Text(
'서비스 사용을 위해 \n약관의 동의가 필요합니다',
style: TextStyles.fs28w800cTextPrimary,
),
),
SizedBox(height: 300),
PolicyAllCheck(),
SizedBox(height: 20),
CheckPolicy(
inputString: '개인정보 수집 및 이용 동의',
policyNum: 0,
),
SizedBox(height: 12),
CheckPolicy(
inputString: '서비스 이용 약관',
policyNum: 1,
),
SizedBox(height: 12),
CheckPolicy(
inputString: '위치 기반 서비스 이용 약관',
policyNum: 2,
),
SizedBox(height: 12),
CheckPolicy(
inputString: '만 14세 이상입니다',
policyNum: 3,
),SizedBox(height: 12),
SizedBox(height: 40),
Obx(
() => InkWell(
borderRadius: BorderRadius.circular(16),
onTap: () {
policyController.allPolicyChecked.value == 1
? Get.to(() => SignUpScreen())
: null;
},
child: Container(
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
color: policyController.allPolicyChecked.value == 0
? AppColors.boxColorSecond
: AppColors.primary,
),
child: Center(
child: Text(
'다음',
style: TextStyles.fx17w700cTextThird,
),
),
),
),
),
],
),
),
],
),
),
);
}
}
25 changes: 21 additions & 4 deletions lib/screens/setting_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ class SettingScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
SettingController settingController = Get.put(SettingController());
String individualInfoPolicyUrl =
'https://autumn-blouse-355.notion.site/e338b4179e5248eebe4c5827b347307b?pvs=4';
String serviceUsePolicyUrl =
'https://autumn-blouse-355.notion.site/58919803d41b40fba9ec0344625e94da?pvs=4';
String placeServicePolicyUrl =
'https://autumn-blouse-355.notion.site/ab3799e4818249daa3bfc32c7f44089d?pvs=4';

return Scaffold(
backgroundColor: AppColors.background,
Expand All @@ -39,7 +45,8 @@ class SettingScreen extends StatelessWidget {
children: [
SettingsSection(
items: [
SettingsItem(title: 'App Store 리뷰 남기기'),
SettingsItem(title: 'App Store 리뷰 남기기',
isLast: true,),
],
),
SettingsSection(
Expand Down Expand Up @@ -72,9 +79,19 @@ class SettingScreen extends StatelessWidget {
SettingsSection(
title: '기타',
items: [
SettingsItem(title: '서비스 이용약관'),
SettingsItem(title: '위치기반서비스 이용약관'),
SettingsItem(title: '개인정보 처리 방침'),
SettingsItem(title: '서비스 이용약관',
onTap: (){
launchUrl(Uri.parse(individualInfoPolicyUrl));
},
),
SettingsItem(title: '위치기반서비스 이용약관',
onTap: (){
launchUrl(Uri.parse(serviceUsePolicyUrl));
},),
SettingsItem(title: '개인정보 처리 방침',
onTap: (){
launchUrl(Uri.parse(placeServicePolicyUrl));
},),
SettingsItem(
title: '버전 정보',
subTitle: "1.0.0",
Expand Down
111 changes: 111 additions & 0 deletions lib/widgets/policy/check_policy.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:url_launcher/url_launcher.dart';

import '../../constants/app_colors.dart';
import '../../controllers/policy_controller.dart';

class CheckPolicy extends StatelessWidget {
final String inputString;
final int policyNum;

final String individualInfoPolicyUrl =
'https://autumn-blouse-355.notion.site/e338b4179e5248eebe4c5827b347307b?pvs=4';
final String serviceUsePolicyUrl =
'https://autumn-blouse-355.notion.site/58919803d41b40fba9ec0344625e94da?pvs=4';
final String placeServicePolicyUrl =
'https://autumn-blouse-355.notion.site/ab3799e4818249daa3bfc32c7f44089d?pvs=4';

CheckPolicy({
super.key,
required this.inputString,
required this.policyNum,
});

@override
Widget build(BuildContext context) {
final PolicyController policyController = Get.find<PolicyController>();

return Container(
height: 38,
decoration: BoxDecoration(
color: AppColors.background,
),
child: Row(
children: [
SizedBox(width: 28),
Obx(
() => IconButton(
icon: Icon(
Icons.check,
color: policyController.checkPolicyList[policyNum] == 0
? AppColors.textPrimary
: AppColors.primary,
),
onPressed: () {
policyController.changeValue(policyNum);
policyController.checkAllChecked();
},
),
),
SizedBox(width: 16),
InkWell(
onTap: () {
policyController.changeValue(policyNum);
policyController.checkAllChecked();
},
child: Text(
inputString,
style: TextStyle(
fontSize: 17,
color: AppColors.textPrimary,
),
),
),
Spacer(),
policyNum != 3
? GestureDetector(
onTap: () {
switch (policyNum) {
case 0:
launchUrl(Uri.parse(individualInfoPolicyUrl));
break;
case 1:
launchUrl(Uri.parse(serviceUsePolicyUrl));
break;
case 2:
launchUrl(Uri.parse(placeServicePolicyUrl));
break;
}
},
child: Container(width: 10),
)
: Container(),
policyNum != 3
? IconButton(
icon: Icon(
Icons.arrow_forward_ios,
color: AppColors.textPrimary,
size: 18,
),
onPressed: () {
switch (policyNum) {
case 0:
launchUrl(Uri.parse(individualInfoPolicyUrl));
break;
case 1:
launchUrl(Uri.parse(serviceUsePolicyUrl));
break;
case 2:
launchUrl(Uri.parse(placeServicePolicyUrl));
break;
}
},
)
: Container(),
SizedBox(width: 20),
],
),
);
}
}
Loading