🐛 Fixes and optimzation on post

♻️ Replace freezed abstract classes with sealed
This commit is contained in:
2025-05-24 22:38:07 +08:00
parent 81103ba8b6
commit a2053aa772
19 changed files with 315 additions and 134 deletions

View File

@ -17,7 +17,7 @@ part 'event_calendar.g.dart';
part 'event_calendar.freezed.dart';
@freezed
abstract class EventCalendarQuery with _$EventCalendarQuery {
sealed class EventCalendarQuery with _$EventCalendarQuery {
const factory EventCalendarQuery({
required String? uname,
required int year,

View File

@ -229,7 +229,7 @@ class _ChatRoomActionMenu extends HookConsumerWidget {
}
@freezed
abstract class ChatRoomMemberState with _$ChatRoomMemberState {
sealed class ChatRoomMemberState with _$ChatRoomMemberState {
const factory ChatRoomMemberState({
required List<SnChatMember> members,
required bool isLoading,

View File

@ -310,7 +310,7 @@ class _StickerPackActionMenu extends HookConsumerWidget {
}
@freezed
abstract class StickerWithPackQuery with _$StickerWithPackQuery {
sealed class StickerWithPackQuery with _$StickerWithPackQuery {
const factory StickerWithPackQuery({
required String packId,
required String id,

View File

@ -64,7 +64,12 @@ class PostDetailScreen extends HookConsumerWidget {
child: Material(
elevation: 2,
color: Colors.transparent,
child: PostQuickReply(parent: post).padding(
child: PostQuickReply(
parent: post,
onPosted: () {
ref.invalidate(postRepliesNotifierProvider(id));
},
).padding(
bottom: MediaQuery.of(context).padding.bottom + 16,
top: 16,
horizontal: 16,