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

fix: 노션 수정사항 수정 #59

Merged
merged 1 commit into from
Aug 25, 2023
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
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PODS:
- AppAuth/Core
- Firebase/CoreOnly (10.12.0):
- FirebaseCore (= 10.12.0)
- firebase_core (2.15.0):
- firebase_core (2.15.1):
- Firebase/CoreOnly (= 10.12.0)
- Flutter
- FirebaseCore (10.12.0):
Expand Down Expand Up @@ -153,7 +153,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
AppAuth: 3bb1d1cd9340bd09f5ed189fb00b1cc28e1e8570
Firebase: 07150e75d142fb9399f6777fa56a187b17f833a0
firebase_core: e477125798fc37cd4ab43ca6a8536bf7e0929c00
firebase_core: 4a3246a02f828a01c74a2c26427037786d90f17f
FirebaseCore: f86a1394906b97ac445ae49c92552a9425831bed
FirebaseCoreInternal: 950500ad8a08963657f6d8c67b579740c06d6aa1
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
Expand Down
2 changes: 1 addition & 1 deletion ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1420;
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
6DCA4EEC2A15E5C200B62F90 = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
3 changes: 0 additions & 3 deletions lib/providers/hashtag_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,5 @@ class Hashtag extends _$Hashtag {
var data = await fetchItem();
return data;
});
return;

// return state.value;
}
}
22 changes: 13 additions & 9 deletions lib/screens/add_content/add_image_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import 'package:moa_app/providers/hashtag_provider.dart';
import 'package:moa_app/providers/hashtag_view_provider.dart';
import 'package:moa_app/repositories/content_repository.dart';
import 'package:moa_app/screens/add_content/widgets/add_content_bottom.dart';
import 'package:moa_app/screens/home/home.dart';
import 'package:moa_app/utils/router_provider.dart';
import 'package:moa_app/utils/utils.dart';
import 'package:moa_app/widgets/app_bar.dart';
import 'package:moa_app/widgets/button.dart';
Expand Down Expand Up @@ -107,10 +107,7 @@ class AddImageContent extends HookConsumerWidget {
.addFolder(folderName: 'folderName');

if (context.mounted) {
context.go(
'/',
extra: const Home(isRefresh: true),
);
context.go(GoRoutes.completeAddContent.fullPath);
}
} catch (error) {
if (context.mounted) {
Expand All @@ -136,12 +133,19 @@ class AddImageContent extends HookConsumerWidget {
}

void addHashtag() {
if (selectedTagList.value.map((e) => e.name).contains(hashtag.value)) {
tagError.value = '중복 태그가 존재해요.';
if (hashtagController.text.isEmpty) {
return;
}

if (hashtagController.text.isEmpty) {
if (selectedTagList.value.length == 20) {
if (context.mounted) {
snackbar.alert(context, '더 이상 해시태그를 추가할 수 없습니다.');
}
return;
}

if (selectedTagList.value.map((e) => e.name).contains(hashtag.value)) {
tagError.value = '중복 태그가 존재해요.';
return;
}

Expand Down Expand Up @@ -215,7 +219,7 @@ class AddImageContent extends HookConsumerWidget {
),
const SizedBox(height: 10),
Text(
'대표 이미지 추가하기',
'이미지 취향을 추가해 주세요.',
style: const InputLabelTextStyle().merge(
TextStyle(
color: AppColors.blackColor
Expand Down
20 changes: 12 additions & 8 deletions lib/screens/add_content/add_link_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import 'package:moa_app/providers/hashtag_view_provider.dart';
import 'package:moa_app/repositories/content_repository.dart';
import 'package:moa_app/screens/add_content/add_image_content.dart';
import 'package:moa_app/screens/add_content/widgets/add_content_bottom.dart';
import 'package:moa_app/screens/home/home.dart';
import 'package:moa_app/utils/router_provider.dart';
import 'package:moa_app/utils/utils.dart';
import 'package:moa_app/widgets/app_bar.dart';
import 'package:moa_app/widgets/button.dart';
Expand Down Expand Up @@ -137,10 +137,7 @@ class AddLinkContent extends HookConsumerWidget {
.addFolder(folderName: 'folderName');

if (context.mounted) {
context.go(
'/',
extra: const Home(isRefresh: true),
);
context.go(GoRoutes.completeAddContent.fullPath);
}
} catch (error) {
if (context.mounted) {
Expand Down Expand Up @@ -171,12 +168,19 @@ class AddLinkContent extends HookConsumerWidget {
}

void addHashtag() {
if (selectedTagList.value.map((e) => e.name).contains(hashtag.value)) {
tagError.value = '중복 태그가 존재해요.';
if (hashtagController.text.isEmpty) {
return;
}

if (hashtagController.text.isEmpty) {
if (selectedTagList.value.length == 20) {
if (context.mounted) {
snackbar.alert(context, '더 이상 해시태그를 추가할 수 없습니다.');
}
return;
}

if (selectedTagList.value.map((e) => e.name).contains(hashtag.value)) {
tagError.value = '중복 태그가 존재해요.';
return;
}

Expand Down
47 changes: 47 additions & 0 deletions lib/screens/add_content/complete_add_content_view.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:moa_app/constants/file_constants.dart';
import 'package:moa_app/screens/home/home.dart';
import 'package:moa_app/widgets/app_bar.dart';
import 'package:moa_app/widgets/button.dart';

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

@override
Widget build(BuildContext context) {
void goHome() {
context.go(
'/',
extra: const Home(isRefresh: true),
);
}

return Scaffold(
appBar: const AppBarBack(
isBackButton: false,
title: '취향 모으기',
),
body: SafeArea(
child: Center(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Spacer(),
Image(width: 200, image: Assets.moaWalking),
const Spacer(),
Button(
onPressed: goHome,
text: '지금 저장한 취향 보러가기',
),
const SizedBox(height: 30),
],
),
),
),
),
);
}
}
18 changes: 11 additions & 7 deletions lib/screens/add_content/folder_select.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ class FolderSelect extends HookConsumerWidget {
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 1.3,
mainAxisSpacing: 30.0,
mainAxisSpacing: 20.0,
crossAxisSpacing: 20.0,
mainAxisExtent: 115,
mainAxisExtent: 125,
),
itemBuilder: (context, index) {
return Column(
children: [
SizedBox(
height: 85,
height: 77,
child: Ink(
decoration: BoxDecoration(
image: DecorationImage(
Expand All @@ -111,10 +111,14 @@ class FolderSelect extends HookConsumerWidget {
),
),
const SizedBox(height: 10),
Text(
folderList[index].folderName,
style: const H4TextStyle(),
)
Flexible(
child: Text(
folderList[index].folderName,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: const H4TextStyle(),
),
),
],
);
},
Expand Down
12 changes: 5 additions & 7 deletions lib/screens/add_content/widgets/add_content_bottom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ class AddContentBottom extends HookWidget {
Padding(
padding: const EdgeInsets.only(top: 8),
child: Text(
'${title.value.length}/30',
'${title.value.characters.length}/30',
style: TextStyle(
color: title.value.length >= 30
color: title.value.characters.length >= 30
? AppColors.danger
: AppColors.blackColor.withOpacity(0.3),
fontSize: 12,
Expand Down Expand Up @@ -131,9 +131,7 @@ class AddContentBottom extends HookWidget {
child: CircleIconButton(
backgroundColor: AppColors.primaryColor,
onPressed: addHashtag,
icon: const Icon(
Icons.add,
),
icon: const Icon(Icons.add),
),
),
),
Expand All @@ -148,9 +146,9 @@ class AddContentBottom extends HookWidget {
Padding(
padding: const EdgeInsets.only(top: 8),
child: Text(
'${hashtagController.text.length}/7',
'${hashtagController.text.characters.length}/7',
style: TextStyle(
color: hashtagController.text.length == 7
color: hashtagController.text.characters.length >= 7
? AppColors.danger
: AppColors.blackColor.withOpacity(0.3),
fontSize: 12,
Expand Down
6 changes: 4 additions & 2 deletions lib/screens/home/edit_content_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ class EditContentView extends HookConsumerWidget {
await ref.read(folderViewProvider.notifier).refresh();
isEditMode.value = false;
} catch (e) {
snackbar.alert(
context, kDebugMode ? e.toString() : '오류가 발생했습니다. 다시 시도해주세요.');
if (context.mounted) {
snackbar.alert(
context, kDebugMode ? e.toString() : '오류가 발생했습니다. 다시 시도해주세요.');
}
} finally {
loading.value = false;
}
Expand Down
12 changes: 8 additions & 4 deletions lib/screens/home/hashtag_detail_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ class HashtagDetailView extends HookConsumerWidget {
context.pop();
}
} catch (e) {
snackbar.alert(
context, kDebugMode ? e.toString() : '해시태그 수정에 실패했습니다.');
if (context.mounted) {
snackbar.alert(
context, kDebugMode ? e.toString() : '해시태그 수정에 실패했습니다.');
}
}
},
updatedContentName: updatedHashtagName,
Expand Down Expand Up @@ -100,8 +102,10 @@ class HashtagDetailView extends HookConsumerWidget {
context.pop();
}
} catch (e) {
snackbar.alert(
context, kDebugMode ? e.toString() : '해시태그 삭제에 실패했습니다.');
if (context.mounted) {
snackbar.alert(
context, kDebugMode ? e.toString() : '해시태그 삭제에 실패했습니다.');
}
}
},
),
Expand Down
10 changes: 6 additions & 4 deletions lib/screens/home/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,17 @@ class FolderSource extends LoadingMoreBase<FolderModel> {
var list = await futureList!.future;
folderCount.value = list.length;

add(
const FolderModel(
folderId: 'add', folderName: '폴더 추가', count: 0, thumbnailUrl: ''),
);

for (FolderModel folder in list) {
if (!contains(folder) && _hasMore) {
add(folder);
}
}
add(
const FolderModel(
folderId: 'add', folderName: '폴더 추가', count: 0, thumbnailUrl: ''),
);

_hasMore = false;
pageIndex++;
isSuccess = true;
Expand Down
14 changes: 9 additions & 5 deletions lib/screens/home/tab_view/folder_tab_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,17 @@ class FolderTabView extends HookConsumerWidget {
logger.d(error);
// 폴더 중복 에러 처리
if (error.response!.statusCode == 409) {
snackbar.alert(context,
kDebugMode ? error.toString() : '이미 가지고 있는 폴더이름이에요');
if (context.mounted) {
snackbar.alert(context,
kDebugMode ? error.toString() : '이미 가지고 있는 폴더이름이에요');
}
return;
}

snackbar.alert(context,
kDebugMode ? error.toString() : '오류가 발생했어요 다시 시도해주세요.');
if (context.mounted) {
snackbar.alert(context,
kDebugMode ? error.toString() : '오류가 발생했어요 다시 시도해주세요.');
}
}
},
),
Expand Down Expand Up @@ -200,7 +204,7 @@ class FolderTabView extends HookConsumerWidget {
return const SizedBox();
},
itemBuilder: (c, item, index) {
return index == source.length - 1
return index == 0
? InkWell(
splashColor: Colors.transparent,
borderRadius: BorderRadius.circular(15),
Expand Down
4 changes: 3 additions & 1 deletion lib/screens/on_boarding/input_name_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ class InputNameView extends HookWidget {
await UserRepository.instance.editUserNickname(nickname: name.value);
step.value = StepType.greeting;
} catch (e) {
snackbar.alert(context, kDebugMode ? e.toString() : '중복된 닉네임입니다.');
if (context.mounted) {
snackbar.alert(context, kDebugMode ? e.toString() : '중복된 닉네임입니다.');
}
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions lib/screens/on_boarding/sign_in.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ class SignIn extends HookConsumerWidget {
} catch (e, traceback) {
logger.d(e);
logger.d(traceback);
snackbar.alert(context,
kDebugMode ? e.toString() : '회원가입 중 에러가 발생했습니다. 관리자에게 문의해주세요.');
if (context.mounted) {
snackbar.alert(context,
kDebugMode ? e.toString() : '회원가입 중 에러가 발생했습니다. 관리자에게 문의해주세요.');
}
} finally {
loading.value = false;
}
Expand Down
1 change: 0 additions & 1 deletion lib/screens/setting/edit_my_type_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class EditMyTypeView extends HookConsumerWidget {
body: DefaultTabController(
length: 2,
child: ExtendedNestedScrollView(
physics: const NeverScrollableScrollPhysics(),
onlyOneScrollInBody: true,
floatHeaderSlivers: true,
headerSliverBuilder: (context, innerBoxIsScrolled) {
Expand Down
6 changes: 4 additions & 2 deletions lib/screens/setting/setting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ class Setting extends HookConsumerWidget {
context.go(GoRoutes.signIn.fullPath);
}
} catch (e) {
snackbar.alert(
context, kDebugMode ? e.toString() : '로그아웃에 실패했습니다 다시 시도해주세요.');
if (context.mounted) {
snackbar.alert(context,
kDebugMode ? e.toString() : '로그아웃에 실패했습니다 다시 시도해주세요.');
}
}
},
showCancelButton: true,
Expand Down
Loading