You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.5 KiB
48 lines
1.5 KiB
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_svg/svg.dart';
|
|
|
|
import '../common/colo_extension.dart';
|
|
|
|
class RoundTextField extends StatelessWidget {
|
|
final TextEditingController? controller;
|
|
final TextInputType? keyboardType;
|
|
final String hitText;
|
|
final String icon;
|
|
final Widget? rigtIcon;
|
|
final bool obscureText;
|
|
final EdgeInsets? margin;
|
|
const RoundTextField({super.key, required this.hitText, required this.icon, this.controller, this.margin, this.keyboardType, this.obscureText = false , this.rigtIcon });
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
margin: margin,
|
|
decoration: BoxDecoration(
|
|
color: TColor.lightGray, borderRadius: BorderRadius.circular(15)),
|
|
child: TextField(
|
|
controller: controller,
|
|
keyboardType: keyboardType,
|
|
obscureText: obscureText,
|
|
decoration: InputDecoration(
|
|
contentPadding:
|
|
const EdgeInsets.symmetric(vertical: 15, horizontal: 15),
|
|
enabledBorder: InputBorder.none,
|
|
focusedBorder: InputBorder.none,
|
|
hintText: hitText,
|
|
suffixIcon: rigtIcon,
|
|
prefixIcon: Container(
|
|
alignment: Alignment.center,
|
|
width: 20,
|
|
height: 20,
|
|
child: SvgPicture.asset(
|
|
icon,
|
|
width: 20,
|
|
height: 20,
|
|
fit: BoxFit.contain,
|
|
)),
|
|
hintStyle: TextStyle(color: TColor.gray, fontSize: 12)),
|
|
),
|
|
);
|
|
}
|
|
} |