feat: 新增 AppLoadingIndicator 和 AppPressable 组件

- 新增 AppLoadingIndicator 加载指示器组件
- 新增 AppPressable 按压反馈组件
- 新增 AppSheetInputField 输入框组件
- 更新 AppButton 和其他共享组件
This commit is contained in:
qzl
2026-03-16 16:11:16 +08:00
parent e55f12cdc1
commit a75c868bca
6 changed files with 360 additions and 38 deletions
@@ -0,0 +1,52 @@
import 'package:flutter/material.dart';
import '../../core/theme/design_tokens.dart';
class AppPressable extends StatefulWidget {
const AppPressable({
super.key,
required this.child,
this.onTap,
this.borderRadius,
this.pressedScale = 0.97,
});
final Widget child;
final VoidCallback? onTap;
final BorderRadius? borderRadius;
final double pressedScale;
@override
State<AppPressable> createState() => _AppPressableState();
}
class _AppPressableState extends State<AppPressable> {
bool _isPressed = false;
@override
Widget build(BuildContext context) {
return AnimatedScale(
scale: _isPressed ? widget.pressedScale : 1,
duration: const Duration(milliseconds: 110),
curve: Curves.easeOut,
child: Material(
color: Colors.transparent,
child: InkWell(
borderRadius: widget.borderRadius,
onTap: widget.onTap,
onHighlightChanged: (pressed) {
if (_isPressed == pressed) {
return;
}
setState(() {
_isPressed = pressed;
});
},
splashColor: AppColors.blue100.withValues(alpha: 0.32),
highlightColor: AppColors.blue50.withValues(alpha: 0.28),
child: widget.child,
),
),
);
}
}