💄 Optimzations

This commit is contained in:
2025-11-17 01:23:27 +08:00
parent d4f95bbbf4
commit 2445d8adf8
2 changed files with 39 additions and 47 deletions

View File

@@ -197,49 +197,46 @@ class _CreateFundSheetState extends State<CreateFundSheet> {
}, },
), ),
// Split Type Section (only show when there are 2+ recipients) const Gap(16),
if (selectedRecipients.length >= 2) ...[ Text(
const Gap(16), 'splitType'.tr(),
Text( style: TextStyle(
'splitType'.tr(), fontSize: 16,
style: TextStyle( fontWeight: FontWeight.w600,
fontSize: 16, color: Theme.of(context).colorScheme.primary,
fontWeight: FontWeight.w600, ),
color: Theme.of(context).colorScheme.primary, ),
const Gap(8),
Row(
children: [
Expanded(
child: RadioListTile<int>(
title: Text('evenSplit'.tr()),
subtitle: Text('equalAmountEach'.tr()),
value: 0,
groupValue: selectedSplitType,
onChanged: (value) {
if (value != null) {
setState(() => selectedSplitType = value);
}
},
),
), ),
), Expanded(
const Gap(8), child: RadioListTile<int>(
Row( title: Text('randomSplit'.tr()),
children: [ subtitle: Text('randomAmountEach'.tr()),
Expanded( value: 1,
child: RadioListTile<int>( groupValue: selectedSplitType,
title: Text('evenSplit'.tr()), onChanged: (value) {
subtitle: Text('equalAmountEach'.tr()), if (value != null) {
value: 0, setState(() => selectedSplitType = value);
groupValue: selectedSplitType, }
onChanged: (value) { },
if (value != null) {
setState(() => selectedSplitType = value);
}
},
),
), ),
Expanded( ),
child: RadioListTile<int>( ],
title: Text('randomSplit'.tr()), ),
subtitle: Text('randomAmountEach'.tr()),
value: 1,
groupValue: selectedSplitType,
onChanged: (value) {
if (value != null) {
setState(() => selectedSplitType = value);
}
},
),
),
],
),
],
const Gap(16), const Gap(16),

View File

@@ -685,12 +685,7 @@ class ComposeLogic {
final hasAttachments = state.attachments.value.isNotEmpty; final hasAttachments = state.attachments.value.isNotEmpty;
if (!hasContent && !hasAttachments) { if (!hasContent && !hasAttachments) {
// Show error message if context is mounted showErrorAlert('postContentEmpty'.tr());
if (context.mounted) {
ScaffoldMessenger.of(
context,
).showSnackBar(SnackBar(content: Text('postContentEmpty')));
}
throw Exception('Post content is empty'); // Don't submit empty posts throw Exception('Post content is empty'); // Don't submit empty posts
} }