Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TextFormField(
- style: GoogleFonts.poppins(
- color: ProjectColors.black4,
- fontSize: 14,
- fontWeight: FontWeight.w500,
- ),
- maxLines: 1,
- controller: passwordController,
- inputFormatters: [
- FilteringTextInputFormatter.digitsOnly,
- ],
- validator: (value) {
- if (value!.trim().isEmpty) {
- return CustomStrings.required;
- }
- if (value.trim().length < 6) {
- return CustomStrings.min6;
- }
- return null;
- },
- obscureText: passwordVisible,
- keyboardType: TextInputType.number,
- decoration: InputDecoration(
- fillColor: ProjectColors.gray,
- filled: true,
- hintStyle: GoogleFonts.poppins(
- color: ProjectColors.black4.withValues(alpha: 90),
- fontSize: 14,
- fontWeight: FontWeight.w500,
- ),
- errorBorder: OutlineInputBorder(
- borderRadius: BorderRadius.circular(10.0),
- borderSide: BorderSide(
- color: Colors.red.shade800,
- width: 0.5,
- ),
- ),
- focusedBorder: OutlineInputBorder(
- borderRadius: BorderRadius.circular(10.0),
- borderSide: BorderSide(
- color: ProjectColors.primaryColor,
- ),
- ),
- focusedErrorBorder: OutlineInputBorder(
- borderRadius: BorderRadius.circular(10.0),
- borderSide: BorderSide(
- color: Colors.red.shade800,
- width: 0.5,
- ),
- ),
- contentPadding: EdgeInsets.fromLTRB(
- 20.0,
- 15.0,
- 20.0,
- 15.0,
- ),
- hintText: CustomStrings.pinHint,
- border: OutlineInputBorder(
- borderSide: BorderSide.none,
- borderRadius: BorderRadius.circular(10.0),
- ),
- suffixIcon: IconButton(
- icon: Icon(
- passwordVisible
- ? Icons.visibility
- : Icons.visibility_off,
- color: ProjectColors.black4,
- ),
- onPressed: () {
- setState(() {
- passwordVisible = !passwordVisible;
- });
- },
- ),
- ),
- ),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement