- Extract business logic from screens into dedicated controllers - Split large screen files into smaller, reusable widget components - Add controllers for AddSubscriptionScreen and DetailScreen - Create modular widgets for subscription and detail features - Improve code organization and maintainability - Remove duplicated code and improve reusability 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
46 lines
1.4 KiB
Dart
46 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../../controllers/detail_screen_controller.dart';
|
|
import '../common/buttons/primary_button.dart';
|
|
|
|
/// 상세 화면 액션 버튼 섹션
|
|
/// 저장 버튼을 포함하는 섹션입니다.
|
|
class DetailActionButtons extends StatelessWidget {
|
|
final DetailScreenController controller;
|
|
final Animation<double> fadeAnimation;
|
|
final Animation<Offset> slideAnimation;
|
|
|
|
const DetailActionButtons({
|
|
super.key,
|
|
required this.controller,
|
|
required this.fadeAnimation,
|
|
required this.slideAnimation,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final baseColor = controller.getCardColor();
|
|
|
|
return FadeTransition(
|
|
opacity: fadeAnimation,
|
|
child: SlideTransition(
|
|
position: Tween<Offset>(
|
|
begin: const Offset(0.0, 0.8),
|
|
end: Offset.zero,
|
|
).animate(CurvedAnimation(
|
|
parent: controller.animationController!,
|
|
curve: const Interval(0.4, 1.0, curve: Curves.easeOutCubic),
|
|
)),
|
|
child: Padding(
|
|
padding: const EdgeInsets.only(bottom: 80),
|
|
child: PrimaryButton(
|
|
text: '변경사항 저장',
|
|
icon: Icons.save_rounded,
|
|
onPressed: controller.updateSubscription,
|
|
isLoading: controller.isLoading,
|
|
backgroundColor: baseColor,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |