48 lines
1.3 KiB
Dart
48 lines
1.3 KiB
Dart
import 'package:common_utils/common_utils.dart';
|
|
import 'package:ducafe_ui_core/ducafe_ui_core.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:forui/forui.dart';
|
|
|
|
/// 设置页的列表图标与文本需要保持统一留白,集中封装后各设置分区只描述业务内容。
|
|
Widget appPrefixIcon(
|
|
BuildContext context,
|
|
SvgAsset icon, {
|
|
double padding = 20,
|
|
}) {
|
|
final theme = FTheme.of(context);
|
|
return FIcon(
|
|
icon,
|
|
size: theme.typography.xl.fontSize,
|
|
color: theme.colorScheme.primary,
|
|
).paddingLeft(padding.w);
|
|
}
|
|
|
|
Widget appSuffixIcon(BuildContext context, SvgAsset icon) {
|
|
final theme = FTheme.of(context);
|
|
return FIcon(
|
|
icon,
|
|
size: theme.typography.xl.fontSize,
|
|
color: theme.colorScheme.mutedForeground,
|
|
).paddingRight(20.w);
|
|
}
|
|
|
|
Widget appPrefixTitle(
|
|
BuildContext context,
|
|
String? text, {
|
|
double padding = 20,
|
|
}) {
|
|
final theme = FTheme.of(context);
|
|
final value = ObjectUtil.isEmpty(text) ? '--' : text!;
|
|
return Text(value, style: theme.typography.xl).paddingLeft(padding.w);
|
|
}
|
|
|
|
Widget appSuffixTitle(BuildContext context, String? text) {
|
|
final theme = FTheme.of(context);
|
|
final value = ObjectUtil.isEmpty(text) ? '--' : text!;
|
|
return Text(
|
|
value,
|
|
style:
|
|
theme.typography.xl.copyWith(color: theme.colorScheme.mutedForeground),
|
|
).paddingRight(20.w);
|
|
}
|