From eabb3154f10b740518ed84ca3c229711ac85acf9 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 14 Oct 2025 01:16:02 +0800 Subject: [PATCH] :lipstick: Optimize card colors --- lib/pods/theme.dart | 1 + lib/screens/explore.dart | 2 +- lib/widgets/account/event_details_widget.dart | 2 +- lib/widgets/post/compose_card.dart | 17 ++++++++--------- lib/widgets/post/compose_dialog.dart | 4 ++-- lib/widgets/post/post_item.dart | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/pods/theme.dart b/lib/pods/theme.dart index 2e4274b7..266ef59a 100644 --- a/lib/pods/theme.dart +++ b/lib/pods/theme.dart @@ -88,6 +88,7 @@ ThemeData createAppTheme(Brightness brightness, AppSettings settings) { color: colorScheme.surfaceContainer.withOpacity( settings.cardTransparency, ), + elevation: settings.cardTransparency <= 1 ? 0 : null, ), pageTransitionsTheme: PageTransitionsTheme( builders: { diff --git a/lib/screens/explore.dart b/lib/screens/explore.dart index 1c6d9d11..ae1e30c9 100644 --- a/lib/screens/explore.dart +++ b/lib/screens/explore.dart @@ -330,7 +330,7 @@ class ExploreScreen extends HookConsumerWidget { ), PostFeaturedList(), PostComposeCard( - onSubmit: (post) { + onSubmit: () { activitiesNotifier.forceRefresh(); }, ), diff --git a/lib/widgets/account/event_details_widget.dart b/lib/widgets/account/event_details_widget.dart index 3f549c25..845eb0e4 100644 --- a/lib/widgets/account/event_details_widget.dart +++ b/lib/widgets/account/event_details_widget.dart @@ -99,7 +99,7 @@ class EventDetailsWidget extends StatelessWidget { ], ), if (event?.checkInResult == null && (event?.statuses.isEmpty ?? true)) - Text('eventCalandarEmpty').tr(), + Text('eventCalendarEmpty').tr(), ], ).padding(vertical: 24, horizontal: 24); } diff --git a/lib/widgets/post/compose_card.dart b/lib/widgets/post/compose_card.dart index 85f85539..5ffc767f 100644 --- a/lib/widgets/post/compose_card.dart +++ b/lib/widgets/post/compose_card.dart @@ -34,9 +34,9 @@ class PostComposeCard extends HookConsumerWidget { final SnPost? originalPost; final PostComposeInitialState? initialState; final VoidCallback? onCancel; - final Function(SnPost)? onSubmit; + final Function()? onSubmit; final Function(ComposeState)? onStateChanged; - final bool isInDialog; + final bool isDialog; const PostComposeCard({ super.key, @@ -45,7 +45,7 @@ class PostComposeCard extends HookConsumerWidget { this.onCancel, this.onSubmit, this.onStateChanged, - this.isInDialog = false, + this.isDialog = false, }); @override @@ -164,20 +164,19 @@ class PostComposeCard extends HookConsumerWidget { // Reset the form for new composition ComposeStateUtils.resetForm(state); - // Call the widget's onSubmit callback to trigger activity list refresh - // Note: onSubmit still receives the post from the return value + onSubmit?.call(); }, ); } final maxHeight = math.min( 640.0, - MediaQuery.of(context).size.height * (isInDialog ? 0.8 : 0.72), + MediaQuery.of(context).size.height * (isDialog ? 0.8 : 0.72), ); return Card( margin: EdgeInsets.zero, - color: Theme.of(context).colorScheme.surfaceContainer, + color: isDialog ? Theme.of(context).colorScheme.surfaceContainer : null, child: Container( constraints: BoxConstraints(maxHeight: maxHeight), child: Column( @@ -311,7 +310,7 @@ class PostComposeCard extends HookConsumerWidget { onTap: () { if (state.currentPublisher.value == null) { // No publisher loaded, guide user to create one - if (isInDialog) { + if (isDialog) { Navigator.of(context).pop(); } context.pushNamed('creatorNew').then((value) { @@ -348,7 +347,7 @@ class PostComposeCard extends HookConsumerWidget { onPublisherTap: () { if (state.currentPublisher.value == null) { // No publisher loaded, guide user to create one - if (isInDialog) { + if (isDialog) { Navigator.of(context).pop(); } context.pushNamed('creatorNew').then(( diff --git a/lib/widgets/post/compose_dialog.dart b/lib/widgets/post/compose_dialog.dart index 1f7e8f23..817e689a 100644 --- a/lib/widgets/post/compose_dialog.dart +++ b/lib/widgets/post/compose_dialog.dart @@ -74,8 +74,8 @@ class PostComposeDialog extends HookConsumerWidget { originalPost: originalPost, initialState: restoredInitialState.value ?? initialState, onCancel: () => Navigator.of(context).pop(), - onSubmit: (post) => Navigator.of(context).pop(post), - isInDialog: true, + onSubmit: () => Navigator.of(context).pop(true), + isDialog: true, ), ), ); diff --git a/lib/widgets/post/post_item.dart b/lib/widgets/post/post_item.dart index 9db0c9e1..8c488f7e 100644 --- a/lib/widgets/post/post_item.dart +++ b/lib/widgets/post/post_item.dart @@ -334,7 +334,7 @@ class PostActionableItem extends HookConsumerWidget { ); }, child: Material( - color: Theme.of(context).colorScheme.surfaceContainerLow, + color: Theme.of(context).cardTheme.color, borderRadius: borderRadius != null ? BorderRadius.all(Radius.circular(borderRadius!))