💄 Optimize card colors

This commit is contained in:
2025-10-14 01:16:02 +08:00
parent 910bf20eef
commit eabb3154f1
6 changed files with 14 additions and 14 deletions

View File

@@ -88,6 +88,7 @@ ThemeData createAppTheme(Brightness brightness, AppSettings settings) {
color: colorScheme.surfaceContainer.withOpacity( color: colorScheme.surfaceContainer.withOpacity(
settings.cardTransparency, settings.cardTransparency,
), ),
elevation: settings.cardTransparency <= 1 ? 0 : null,
), ),
pageTransitionsTheme: PageTransitionsTheme( pageTransitionsTheme: PageTransitionsTheme(
builders: { builders: {

View File

@@ -330,7 +330,7 @@ class ExploreScreen extends HookConsumerWidget {
), ),
PostFeaturedList(), PostFeaturedList(),
PostComposeCard( PostComposeCard(
onSubmit: (post) { onSubmit: () {
activitiesNotifier.forceRefresh(); activitiesNotifier.forceRefresh();
}, },
), ),

View File

@@ -99,7 +99,7 @@ class EventDetailsWidget extends StatelessWidget {
], ],
), ),
if (event?.checkInResult == null && (event?.statuses.isEmpty ?? true)) if (event?.checkInResult == null && (event?.statuses.isEmpty ?? true))
Text('eventCalandarEmpty').tr(), Text('eventCalendarEmpty').tr(),
], ],
).padding(vertical: 24, horizontal: 24); ).padding(vertical: 24, horizontal: 24);
} }

View File

@@ -34,9 +34,9 @@ class PostComposeCard extends HookConsumerWidget {
final SnPost? originalPost; final SnPost? originalPost;
final PostComposeInitialState? initialState; final PostComposeInitialState? initialState;
final VoidCallback? onCancel; final VoidCallback? onCancel;
final Function(SnPost)? onSubmit; final Function()? onSubmit;
final Function(ComposeState)? onStateChanged; final Function(ComposeState)? onStateChanged;
final bool isInDialog; final bool isDialog;
const PostComposeCard({ const PostComposeCard({
super.key, super.key,
@@ -45,7 +45,7 @@ class PostComposeCard extends HookConsumerWidget {
this.onCancel, this.onCancel,
this.onSubmit, this.onSubmit,
this.onStateChanged, this.onStateChanged,
this.isInDialog = false, this.isDialog = false,
}); });
@override @override
@@ -164,20 +164,19 @@ class PostComposeCard extends HookConsumerWidget {
// Reset the form for new composition // Reset the form for new composition
ComposeStateUtils.resetForm(state); ComposeStateUtils.resetForm(state);
// Call the widget's onSubmit callback to trigger activity list refresh onSubmit?.call();
// Note: onSubmit still receives the post from the return value
}, },
); );
} }
final maxHeight = math.min( final maxHeight = math.min(
640.0, 640.0,
MediaQuery.of(context).size.height * (isInDialog ? 0.8 : 0.72), MediaQuery.of(context).size.height * (isDialog ? 0.8 : 0.72),
); );
return Card( return Card(
margin: EdgeInsets.zero, margin: EdgeInsets.zero,
color: Theme.of(context).colorScheme.surfaceContainer, color: isDialog ? Theme.of(context).colorScheme.surfaceContainer : null,
child: Container( child: Container(
constraints: BoxConstraints(maxHeight: maxHeight), constraints: BoxConstraints(maxHeight: maxHeight),
child: Column( child: Column(
@@ -311,7 +310,7 @@ class PostComposeCard extends HookConsumerWidget {
onTap: () { onTap: () {
if (state.currentPublisher.value == null) { if (state.currentPublisher.value == null) {
// No publisher loaded, guide user to create one // No publisher loaded, guide user to create one
if (isInDialog) { if (isDialog) {
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
context.pushNamed('creatorNew').then((value) { context.pushNamed('creatorNew').then((value) {
@@ -348,7 +347,7 @@ class PostComposeCard extends HookConsumerWidget {
onPublisherTap: () { onPublisherTap: () {
if (state.currentPublisher.value == null) { if (state.currentPublisher.value == null) {
// No publisher loaded, guide user to create one // No publisher loaded, guide user to create one
if (isInDialog) { if (isDialog) {
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
context.pushNamed('creatorNew').then(( context.pushNamed('creatorNew').then((

View File

@@ -74,8 +74,8 @@ class PostComposeDialog extends HookConsumerWidget {
originalPost: originalPost, originalPost: originalPost,
initialState: restoredInitialState.value ?? initialState, initialState: restoredInitialState.value ?? initialState,
onCancel: () => Navigator.of(context).pop(), onCancel: () => Navigator.of(context).pop(),
onSubmit: (post) => Navigator.of(context).pop(post), onSubmit: () => Navigator.of(context).pop(true),
isInDialog: true, isDialog: true,
), ),
), ),
); );

View File

@@ -334,7 +334,7 @@ class PostActionableItem extends HookConsumerWidget {
); );
}, },
child: Material( child: Material(
color: Theme.of(context).colorScheme.surfaceContainerLow, color: Theme.of(context).cardTheme.color,
borderRadius: borderRadius:
borderRadius != null borderRadius != null
? BorderRadius.all(Radius.circular(borderRadius!)) ? BorderRadius.all(Radius.circular(borderRadius!))