chore: 更新国际化翻译及 UI 组件优化
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../core/theme/design_tokens.dart';
|
||||
|
||||
class AppInput extends StatelessWidget {
|
||||
final String label;
|
||||
final String hint;
|
||||
@@ -43,7 +45,20 @@ class AppInput extends StatelessWidget {
|
||||
keyboardType: keyboardType,
|
||||
maxLines: maxLines,
|
||||
enabled: enabled,
|
||||
decoration: InputDecoration(hintText: hint, suffixIcon: suffix),
|
||||
decoration: InputDecoration(
|
||||
hintText: hint,
|
||||
suffixIcon: suffix,
|
||||
filled: true,
|
||||
fillColor: colorScheme.surfaceContainerLow,
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: AppSpacing.lg,
|
||||
vertical: AppSpacing.lg,
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(AppRadius.lg),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../data/models/dial_codes.dart';
|
||||
|
||||
class PhonePrefixSelector extends StatelessWidget {
|
||||
const PhonePrefixSelector({
|
||||
super.key,
|
||||
required this.value,
|
||||
required this.items,
|
||||
List<DialCode>? items,
|
||||
this.onChanged,
|
||||
});
|
||||
}) : items = items ?? kDialCodes;
|
||||
|
||||
final String value;
|
||||
final List<String> items;
|
||||
final List<DialCode> items;
|
||||
final ValueChanged<String>? onChanged;
|
||||
|
||||
@override
|
||||
@@ -21,7 +23,10 @@ class PhonePrefixSelector extends StatelessWidget {
|
||||
onSelected: onChanged,
|
||||
itemBuilder: (context) => items
|
||||
.map(
|
||||
(item) => PopupMenuItem<String>(value: item, child: Text(item)),
|
||||
(item) => PopupMenuItem<String>(
|
||||
value: item.value,
|
||||
child: Text(item.value),
|
||||
),
|
||||
)
|
||||
.toList(growable: false),
|
||||
color: colorScheme.surface,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../core/l10n/l10n.dart';
|
||||
import '../../../core/theme/design_tokens.dart';
|
||||
import 'toast_type.dart';
|
||||
|
||||
class ToastTypeConfig {
|
||||
@@ -25,18 +26,22 @@ class ToastTypeConfig {
|
||||
|
||||
return switch (type) {
|
||||
ToastType.success => ToastTypeConfig(
|
||||
surfaceColor: colorScheme.tertiaryContainer,
|
||||
borderColor: colorScheme.tertiary,
|
||||
iconColor: colorScheme.tertiary,
|
||||
textColor: colorScheme.onTertiaryContainer,
|
||||
surfaceColor: colorScheme.primaryContainer,
|
||||
borderColor: colorScheme.primary,
|
||||
iconColor: colorScheme.primary,
|
||||
textColor: colorScheme.onPrimaryContainer,
|
||||
label: l10n.toastLabelSuccess,
|
||||
icon: Icons.check_circle_outline,
|
||||
),
|
||||
ToastType.warning => ToastTypeConfig(
|
||||
surfaceColor: colorScheme.secondaryContainer,
|
||||
borderColor: colorScheme.secondary,
|
||||
iconColor: colorScheme.secondary,
|
||||
textColor: colorScheme.onSecondaryContainer,
|
||||
surfaceColor: Theme.of(
|
||||
context,
|
||||
).extension<AppColorPalette>()!.warningContainer,
|
||||
borderColor: Theme.of(context).extension<AppColorPalette>()!.warning,
|
||||
iconColor: Theme.of(context).extension<AppColorPalette>()!.warning,
|
||||
textColor: Theme.of(
|
||||
context,
|
||||
).extension<AppColorPalette>()!.onWarningContainer,
|
||||
label: l10n.toastLabelWarning,
|
||||
icon: Icons.warning_amber_rounded,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user