mirror of
https://bitbucket.org/myhomie/myhomie_app.git
synced 2025-12-06 00:51:19 +00:00
49 lines
1.3 KiB
Dart
49 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:myhomie_app/Components/text_field_container.dart';
|
|
import 'package:myhomie_app/constants.dart';
|
|
|
|
class RoundedInputField extends StatelessWidget {
|
|
final String? hintText;
|
|
final IconData? icon;
|
|
final ValueChanged<String>? onChanged;
|
|
final String? initialValue;
|
|
final Color color, textColor, iconColor;
|
|
final int? maxLength;
|
|
final double? fontSize;
|
|
const RoundedInputField({
|
|
Key? key,
|
|
this.hintText,
|
|
this.initialValue,
|
|
this.icon,
|
|
this.color = kTitleTextColor, // TODO
|
|
this.textColor = kBodyTextColor, // TODO
|
|
this.iconColor = kTitleTextColor, // TODO
|
|
this.onChanged,
|
|
this.maxLength, // 50
|
|
this.fontSize = 20,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return TextFieldContainer(
|
|
color: color,
|
|
child: TextFormField (
|
|
onChanged: onChanged,
|
|
initialValue: initialValue,
|
|
cursorColor: textColor,
|
|
maxLength: maxLength,
|
|
style: TextStyle(fontSize: fontSize, color: textColor),
|
|
decoration: InputDecoration(
|
|
icon: icon != null ? Icon(
|
|
icon,
|
|
color: iconColor,
|
|
): null,
|
|
hintText: hintText,
|
|
hintStyle: TextStyle(fontSize: 20.0, color: textColor),
|
|
border: InputBorder.none,
|
|
)
|
|
),
|
|
);
|
|
}
|
|
}
|