58 lines
1.5 KiB
Dart
58 lines
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:superport/screens/common/theme_tailwind.dart';
|
|
|
|
/// 메트로닉 스타일 폼 필드 래퍼 위젯 (SRP 분리)
|
|
class MetronicFormField extends StatelessWidget {
|
|
final String label;
|
|
final Widget child;
|
|
final bool isRequired;
|
|
final String? helperText;
|
|
|
|
const MetronicFormField({
|
|
Key? key,
|
|
required this.label,
|
|
required this.child,
|
|
this.isRequired = false,
|
|
this.helperText,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Padding(
|
|
padding: const EdgeInsets.only(bottom: 16.0),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Row(
|
|
children: [
|
|
Text(
|
|
label,
|
|
style: const TextStyle(
|
|
fontWeight: FontWeight.w600,
|
|
fontSize: 14,
|
|
color: AppThemeTailwind.dark,
|
|
),
|
|
),
|
|
if (isRequired)
|
|
const Text(
|
|
' *',
|
|
style: TextStyle(
|
|
color: AppThemeTailwind.danger,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(height: 8),
|
|
child,
|
|
if (helperText != null)
|
|
Padding(
|
|
padding: const EdgeInsets.only(top: 4.0),
|
|
child: Text(helperText!, style: AppThemeTailwind.smallText),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|