프로젝트 최초 커밋
This commit is contained in:
57
lib/screens/common/metronic_form_field.dart
Normal file
57
lib/screens/common/metronic_form_field.dart
Normal file
@@ -0,0 +1,57 @@
|
||||
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),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user