|
@@ -78,6 +78,7 @@ class ExpenseDetailDialog extends StatefulWidget {
|
|
|
final AppLocalizations l10n;
|
|
final AppLocalizations l10n;
|
|
|
final ExpenseDetailInputData? initialData;
|
|
final ExpenseDetailInputData? initialData;
|
|
|
final Future<bool> Function()? checkAttachHealth;
|
|
final Future<bool> Function()? checkAttachHealth;
|
|
|
|
|
+ final bool showAttachments;
|
|
|
|
|
|
|
|
const ExpenseDetailDialog({
|
|
const ExpenseDetailDialog({
|
|
|
super.key,
|
|
super.key,
|
|
@@ -89,6 +90,7 @@ class ExpenseDetailDialog extends StatefulWidget {
|
|
|
required this.l10n,
|
|
required this.l10n,
|
|
|
this.initialData,
|
|
this.initialData,
|
|
|
this.checkAttachHealth,
|
|
this.checkAttachHealth,
|
|
|
|
|
+ this.showAttachments = true,
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
/// 显示弹窗,返回 [ExpenseDetailInputData] 或 `null`(取消时)。
|
|
/// 显示弹窗,返回 [ExpenseDetailInputData] 或 `null`(取消时)。
|
|
@@ -102,6 +104,7 @@ class ExpenseDetailDialog extends StatefulWidget {
|
|
|
required AppLocalizations l10n,
|
|
required AppLocalizations l10n,
|
|
|
ExpenseDetailInputData? initialData,
|
|
ExpenseDetailInputData? initialData,
|
|
|
Future<bool> Function()? checkAttachHealth,
|
|
Future<bool> Function()? checkAttachHealth,
|
|
|
|
|
+ bool showAttachments = true,
|
|
|
}) {
|
|
}) {
|
|
|
FocusScope.of(context).unfocus();
|
|
FocusScope.of(context).unfocus();
|
|
|
return Navigator.push<ExpenseDetailInputData>(
|
|
return Navigator.push<ExpenseDetailInputData>(
|
|
@@ -118,6 +121,7 @@ class ExpenseDetailDialog extends StatefulWidget {
|
|
|
l10n: l10n,
|
|
l10n: l10n,
|
|
|
initialData: initialData,
|
|
initialData: initialData,
|
|
|
checkAttachHealth: checkAttachHealth,
|
|
checkAttachHealth: checkAttachHealth,
|
|
|
|
|
+ showAttachments: showAttachments,
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
);
|
|
);
|
|
@@ -391,7 +395,7 @@ class _ExpenseDetailDialogState extends State<ExpenseDetailDialog> {
|
|
|
_buildBankInfoCard(colors),
|
|
_buildBankInfoCard(colors),
|
|
|
const SizedBox(height: 12),
|
|
const SizedBox(height: 12),
|
|
|
_buildRemarkInput(colors),
|
|
_buildRemarkInput(colors),
|
|
|
- if (widget.initialData == null) ...[
|
|
|
|
|
|
|
+ if (widget.showAttachments) ...[
|
|
|
const SizedBox(height: 12),
|
|
const SizedBox(height: 12),
|
|
|
_buildAttachmentCard(colors),
|
|
_buildAttachmentCard(colors),
|
|
|
],
|
|
],
|