Skip to content

Commit

Permalink
fix: memo최대글자수 100자로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
nain93 committed Aug 15, 2023
1 parent 868cb20 commit b46138e
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 8 deletions.
4 changes: 4 additions & 0 deletions lib/screens/add_content/add_link_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ class AddLinkContent extends HookConsumerWidget {
var crawledDescription = document.head
?.querySelector("meta[property='og:description']")
?.attributes['content'];

if (crawledDescription != null && crawledDescription.length > 100) {
crawledDescription = crawledDescription.substring(0, 100);
}
// var crawledImage = document.head
// ?.querySelector("meta[property='og:image']")
// ?.attributes['content'];
Expand Down
11 changes: 6 additions & 5 deletions lib/screens/add_content/widgets/add_content_bottom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,12 @@ class AddContentBottom extends HookWidget {
child: Text(
'${memo.value.length}/100',
style: TextStyle(
color: memo.value.length == 100
? AppColors.danger
: AppColors.blackColor.withOpacity(0.3),
fontSize: 12,
fontFamily: FontConstants.pretendard),
color: memo.value.length >= 100
? AppColors.danger
: AppColors.blackColor.withOpacity(0.3),
fontSize: 12,
fontFamily: FontConstants.pretendard,
),
),
),
],
Expand Down
45 changes: 42 additions & 3 deletions lib/screens/home/edit_content_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class EditContentView extends HookConsumerWidget {
var hashtagList = useState<List<String>>(
content.contentHashTags.map((e) => e.hashTag).toList());

var title = useState(content.contentName);
var memo = useState(content.contentMemo);

var loading = useState(false);

Future<void> saveEditContent() async {
Expand Down Expand Up @@ -130,9 +133,27 @@ class EditContentView extends HookConsumerWidget {
borderRadius: const BorderRadius.all(Radius.circular(15)),
controller: titleController,
maxLength: 30,
onChanged: (value) {},
onChanged: (value) {
title.value = value;
},
hintText: '1~30자로 입력할 수 있어요.',
),
const SizedBox(height: 5),
Row(
children: [
const Spacer(),
Text(
'${titleController.text.length}/30',
style: TextStyle(
color: titleController.text.length >= 30
? AppColors.danger
: AppColors.blackColor.withOpacity(0.3),
fontSize: 12,
fontFamily: FontConstants.pretendard,
),
),
],
),
const SizedBox(height: 30),
const Text(
'메모',
Expand All @@ -142,11 +163,29 @@ class EditContentView extends HookConsumerWidget {
EditText(
borderRadius: const BorderRadius.all(Radius.circular(15)),
controller: memoController,
maxLength: 30,
maxLength: 100,
maxLines: 4,
onChanged: (value) {},
onChanged: (value) {
memo.value = value;
},
hintText: '메모를 입력하세요.',
),
const SizedBox(height: 5),
Row(
children: [
const Spacer(),
Text(
'${memoController.text.length}/100',
style: TextStyle(
color: memoController.text.length >= 100
? AppColors.danger
: AppColors.blackColor.withOpacity(0.3),
fontSize: 12,
fontFamily: FontConstants.pretendard,
),
),
],
),
Wrap(
spacing: 10,
crossAxisAlignment: WrapCrossAlignment.center,
Expand Down

0 comments on commit b46138e

Please sign in to comment.