61 lines
1.8 KiB
Dart
61 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:citycards_customer/common_packages/custom_text.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
class CustomTextField extends StatelessWidget {
|
|
final String label;
|
|
final String hint;
|
|
final TextEditingController controller;
|
|
final int? maxLines;
|
|
|
|
const CustomTextField({
|
|
super.key,
|
|
required this.label,
|
|
required this.hint,
|
|
required this.controller,
|
|
this.maxLines = 1,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Padding(
|
|
padding: EdgeInsets.only(bottom: 12.h),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
CustomText(text: label, size: 14.sp),
|
|
SizedBox(height: 6.h),
|
|
SizedBox(
|
|
height: maxLines == 1 ? 42.h : null,
|
|
child: TextField(
|
|
controller: controller,
|
|
maxLines: maxLines,
|
|
decoration: InputDecoration(
|
|
hintText: hint,
|
|
hintStyle: TextStyle(fontSize: 12.sp, color: Color(0xFF8E8E8E)),
|
|
filled: true,
|
|
fillColor: const Color(0xFFFFF5F5),
|
|
contentPadding: EdgeInsets.symmetric(horizontal: 24.w),
|
|
enabledBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(8.r),
|
|
borderSide: BorderSide(
|
|
color: Color(0xBBC83B61).withOpacity(0.4),
|
|
width: .4.w,
|
|
),
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(8.r),
|
|
borderSide: BorderSide(
|
|
color: Color(0xFFF95F62),
|
|
width: 1.w,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|