37 lines
918 B
Dart
37 lines
918 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class LabelTextField extends StatelessWidget {
|
|
final String label;
|
|
final double fontSize;
|
|
final FontWeight fontWeight;
|
|
final Alignment alignment;
|
|
final Color? color;
|
|
|
|
const LabelTextField({
|
|
super.key,
|
|
required this.label,
|
|
this.fontSize = 16,
|
|
this.fontWeight = FontWeight.bold,
|
|
this.alignment = Alignment.centerLeft,
|
|
this.color, // Tambahkan warna opsional
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Align(
|
|
alignment: alignment,
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 4), // padding lebih natural
|
|
child: Text(
|
|
label,
|
|
style: TextStyle(
|
|
fontSize: fontSize,
|
|
fontWeight: fontWeight,
|
|
color: color ?? const Color(0xFF172B4D), // default modern dark text
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|