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_loading_indicator.dart';
|
||||
|
||||
@@ -7,16 +8,17 @@ class AppPullRefreshFeedback extends StatelessWidget {
|
||||
const AppPullRefreshFeedback({
|
||||
super.key,
|
||||
required this.visible,
|
||||
this.label = '正在刷新',
|
||||
this.label,
|
||||
this.margin = const EdgeInsets.only(top: AppSpacing.sm),
|
||||
});
|
||||
|
||||
final bool visible;
|
||||
final String label;
|
||||
final String? label;
|
||||
final EdgeInsetsGeometry margin;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final resolvedLabel = label ?? context.l10n.commonRefreshing;
|
||||
return IgnorePointer(
|
||||
child: AnimatedOpacity(
|
||||
opacity: visible ? 1 : 0,
|
||||
@@ -44,7 +46,7 @@ class AppPullRefreshFeedback extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: AppSpacing.sm),
|
||||
Text(
|
||||
label,
|
||||
resolvedLabel,
|
||||
style: Theme.of(context).textTheme.labelSmall?.copyWith(
|
||||
color: AppColors.slate600,
|
||||
fontWeight: FontWeight.w500,
|
||||
|
||||
Reference in New Issue
Block a user