Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
nain93 authored Nov 7, 2023
2 parents 4bb84ff + 4128c6e commit dca0fd1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
8 changes: 8 additions & 0 deletions lib/providers/folder_detail_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,12 @@ class FolderDetail extends _$FolderDetail {

return res.length;
}

Future<void> refresh({required String folderName}) async {
state = const AsyncValue.loading();

state = await AsyncValue.guard(() async {
return fetchItem(folderName: folderName);
});
}
}
1 change: 1 addition & 0 deletions lib/screens/home/edit_content_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class EditContentView extends HookConsumerWidget {
// await ref.read(hashtagViewProvider.notifier).refresh();
// await ref.read(folderViewProvider.notifier).refresh();
isEditMode.value = false;

}

void showEditHashtagModal() {
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/home/folder_detail_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class FolderDetailView extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
var controller = useScrollController();
var contentList = useState<List<ContentModel>>([]);
var pageNum = useState(0);
var hasMore = useState(true);
var loading = useState(false);
var folderDetailAsync = ref.watch(folderDetailProvider(folderId: id));

Future<void> pullToRefresh() async {
ref.refresh(folderDetailProvider(folderId: id)).value;
}
Expand All @@ -52,6 +52,7 @@ class FolderDetailView extends HookConsumerWidget {
BranchUniversalObject buo = BranchUniversalObject(
canonicalIdentifier:
'${GoRoutes.folder.fullPath}/$id?folderName=$encodeFolderName&c=$contentCount',

title: '모아 폴더 공유',
contentDescription: folderName,
// imageUrl:
Expand Down Expand Up @@ -79,7 +80,6 @@ class FolderDetailView extends HookConsumerWidget {
var length = await ref
.read(folderDetailProvider(folderId: id).notifier)
.loadMore(folderId: id, page: page);

loading.value = false;
if (length < 10) {
hasMore.value = false;
Expand Down
1 change: 1 addition & 0 deletions lib/widgets/moa_widgets/dynamic_grid_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class DynamicGridList extends HookWidget {
contentUrl != '' ? AddContentType.url : AddContentType.image,
),
);
folderDetailRefresher?.value = val as bool;
}

return RefreshIndicator(
Expand Down
1 change: 0 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html

version: 1.0.3+18

environment:
sdk: ">=3.0.0 <4.0.0"

Expand Down

0 comments on commit dca0fd1

Please sign in to comment.