feat(apps): 重构 UI 架构为 presentation 层并新增 l10n 国际化支持
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../core/l10n/l10n.dart';
|
||||
import '../../core/theme/design_tokens.dart';
|
||||
import 'app_button.dart';
|
||||
|
||||
@@ -7,10 +8,13 @@ Future<bool> showConfirmSheet(
|
||||
BuildContext context, {
|
||||
required String title,
|
||||
required String message,
|
||||
String confirmText = '确认',
|
||||
String cancelText = '取消',
|
||||
String? confirmText,
|
||||
String? cancelText,
|
||||
bool isDestructive = false,
|
||||
}) async {
|
||||
final l10n = context.l10n;
|
||||
final resolvedConfirmText = confirmText ?? l10n.commonConfirm;
|
||||
final resolvedCancelText = cancelText ?? l10n.commonCancel;
|
||||
final result = await showModalBottomSheet<bool>(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
@@ -64,7 +68,7 @@ Future<bool> showConfirmSheet(
|
||||
borderRadius: BorderRadius.circular(AppRadius.full),
|
||||
),
|
||||
child: Text(
|
||||
confirmText,
|
||||
resolvedConfirmText,
|
||||
style: const TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w700,
|
||||
@@ -78,7 +82,7 @@ Future<bool> showConfirmSheet(
|
||||
SizedBox(
|
||||
height: 52,
|
||||
child: AppButton(
|
||||
text: cancelText,
|
||||
text: resolvedCancelText,
|
||||
isOutlined: true,
|
||||
onPressed: () => Navigator.of(sheetContext).pop(false),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user