You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
2.0 KiB
Dart
59 lines
2.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:tangheem/extensions/int_extensions.dart';
|
|
import 'package:tangheem/extensions/widget_extensions.dart';
|
|
|
|
class LoginTextFieldWidget extends StatelessWidget {
|
|
final String hint;
|
|
final TextEditingController controller;
|
|
final bool isPassword;
|
|
final IconData iconData;
|
|
|
|
LoginTextFieldWidget({@required this.hint, @required this.controller, this.isPassword = false, @required this.iconData, Key key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return TextField(
|
|
textAlignVertical: TextAlignVertical.center,
|
|
controller: controller,
|
|
obscureText: isPassword,
|
|
textInputAction: TextInputAction.next,
|
|
style: TextStyle(color: Colors.white, fontSize: 14, fontFamily: "Montserrat"),
|
|
cursorColor: Colors.white,
|
|
maxLines: 1,
|
|
scrollPhysics: BouncingScrollPhysics(),
|
|
decoration: InputDecoration(
|
|
contentPadding: EdgeInsets.only(top: 19, bottom: 19, right: 32, left: 4),
|
|
alignLabelWithHint: true,
|
|
fillColor: Color(0xff598A8D),
|
|
filled: true,
|
|
hintStyle: TextStyle(color: Colors.white, fontSize: 14, fontFamily: "Montserrat"),
|
|
hintText: hint,
|
|
suffixIcon: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Container(
|
|
width: 1,
|
|
height: 14,
|
|
color: Colors.white.withOpacity(.6),
|
|
),
|
|
14.width,
|
|
Icon(
|
|
iconData,
|
|
color: Colors.white.withOpacity(0.6),
|
|
size: 20,
|
|
),
|
|
],
|
|
).paddingOnly(left: 24),
|
|
suffixIconConstraints: BoxConstraints(),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(10),
|
|
borderSide: BorderSide(color: Colors.transparent, width: 1),
|
|
),
|
|
enabledBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(10),
|
|
borderSide: BorderSide(color: Colors.transparent, width: 1),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |