Skip to content

Instantly share code, notes, and snippets.

@flutter-devs
Last active December 4, 2023 14:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flutter-devs/b164e1e459c39e1e88bb69a1e40de346 to your computer and use it in GitHub Desktop.
Save flutter-devs/b164e1e459c39e1e88bb69a1e40de346 to your computer and use it in GitHub Desktop.
import 'package:event_hire/utils/styles.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class CustomTextField extends StatelessWidget {
final String hint;
final TextEditingController textEditingController;
final TextInputType keyboardType;
final errorText;
final bool obscureText;
final TextCapitalization textCapitalization;
final FormFieldValidator<String> validator;
final List<TextInputFormatter> inputFormatters;
final int maxLength;
final int maxLines;
final TextStyle hintStyle;
CustomTextField(
{this.textEditingController,
this.hint,
this.keyboardType = TextInputType.text,
this.errorText = 'Please enter some text',
this.textCapitalization = TextCapitalization.none,
this.validator,
this.obscureText = false,
this.inputFormatters,
this.maxLength,
this.maxLines, this.hintStyle});
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
TextFormField(
controller: textEditingController,
autovalidate: false,
maxLength: maxLength,
maxLines: maxLines,
textCapitalization: TextCapitalization.words,
maxLengthEnforced: false,
keyboardType: keyboardType,
inputFormatters: inputFormatters,
obscureText: obscureText,
validator: validator ??
(value) {
if (value.isEmpty) {
return errorText;
}
},
decoration: InputDecoration(
fillColor: Styles.whiteColor,
filled: true,
hintText: hint,hintStyle: hintStyle,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: BorderSide(color: Colors.grey, width: 0.0)),
),
),
SizedBox(
height: 25,
)
],
);
}
}
@cuajopelu
Copy link

Issue: analyze: unsupported import package:event_hire/utils/styles.dart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment