71 lines
2.0 KiB
Dart
71 lines
2.0 KiB
Dart
import 'package:educa_controle_acesso/utils/colors.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
|
|
class InputText extends StatelessWidget {
|
|
bool obscure;
|
|
var controller;
|
|
double fontSize;
|
|
String title;
|
|
double width;
|
|
TextInputType textInputType;
|
|
int maxLines;
|
|
Color colorBorder;
|
|
var onChanged;
|
|
|
|
InputText({
|
|
required this.controller,
|
|
required this.width,
|
|
this.obscure = false,
|
|
this.fontSize = 15.0,
|
|
this.title = '',
|
|
this.textInputType = TextInputType.text,
|
|
this.maxLines = 1,
|
|
this.colorBorder = PaletteColors.grey,
|
|
this.onChanged = null,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
color:PaletteColors.greyInput,
|
|
width: width,
|
|
margin: EdgeInsets.only(bottom: 5),
|
|
child: TextFormField(
|
|
keyboardType: textInputType,
|
|
maxLines: maxLines,
|
|
onChanged: onChanged,
|
|
obscureText: this.obscure,
|
|
controller: this.controller,
|
|
style: TextStyle(
|
|
color: Colors.black,
|
|
fontSize: this.fontSize,
|
|
),
|
|
decoration: InputDecoration(
|
|
// fillColor: PaletteColors.primaryColor,
|
|
labelText: title,
|
|
border: OutlineInputBorder(
|
|
borderSide: BorderSide(width: 1,color: colorBorder)
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(width: 1, color: colorBorder),
|
|
borderRadius: BorderRadius.circular(3),
|
|
),
|
|
enabledBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(width: 1, color: colorBorder),
|
|
borderRadius: BorderRadius.circular(3),
|
|
),
|
|
disabledBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(width: 1, color: colorBorder),
|
|
borderRadius: BorderRadius.circular(3),
|
|
),
|
|
hintStyle: TextStyle(
|
|
color: Colors.black,
|
|
fontSize: this.fontSize,
|
|
)
|
|
)
|
|
),
|
|
);
|
|
}
|
|
}
|