| Example 1 | 34 |Output | 35 |
|---|---|
| 38 | 39 | ```dart 40 | PasswordField( 41 | color: Colors.blue, 42 | passwordConstraint: r'.*[@$#.*].*', 43 | passwordDecoration: PasswordDecoration(), 44 | hintText: 'must have special characters', 45 | border: PasswordBorder( 46 | border: OutlineInputBorder( 47 | borderSide: BorderSide( 48 | color: Colors.blue.shade100, 49 | ), 50 | borderRadius: BorderRadius.circular(12), 51 | ), 52 | focusedBorder: OutlineInputBorder( 53 | borderSide: BorderSide( 54 | color: Colors.blue.shade100, 55 | ), 56 | borderRadius: BorderRadius.circular(12), 57 | ), 58 | focusedErrorBorder: OutlineInputBorder( 59 | borderRadius: BorderRadius.circular(12), 60 | borderSide: 61 | BorderSide(width: 2, color: Colors.red.shade200), 62 | ), 63 | ), 64 | errorMessage: 65 | 'must contain special character either . * @ # \$', 66 | ), 67 | ``` 68 | 69 | | 70 |71 | 72 |  73 | 74 | 75 | | 76 |
| Example 2 | 84 |Output | 85 |
|---|---|
| 88 | 89 | ```dart 90 | PasswordField( 91 | backgroundColor: Colors.blue.withOpacity(0.2), 92 | errorMessage: ''' 93 | - A uppercase letter 94 | - A lowercase letter 95 | - A digit 96 | - A special character 97 | - A minimum length of 8 characters 98 | ''', 99 | hintText: 'Default password constraint ', 100 | passwordDecoration: PasswordDecoration( 101 | inputPadding: const EdgeInsets.symmetric(horizontal: 20), 102 | ), 103 | border: PasswordBorder( 104 | border: OutlineInputBorder( 105 | borderSide: 106 | const BorderSide(width: 0, color: Colors.grey), 107 | borderRadius: BorderRadius.circular(25.7)), 108 | focusedBorder: OutlineInputBorder( 109 | borderSide: 110 | const BorderSide(width: 0, color: Colors.grey), 111 | borderRadius: BorderRadius.circular(25.7), 112 | ), 113 | enabledBorder: OutlineInputBorder( 114 | borderSide: 115 | const BorderSide(width: 0, color: Colors.grey), 116 | borderRadius: BorderRadius.circular(25.7), 117 | ), 118 | ), 119 | ), 120 | ``` 121 | | 122 |123 | 124 |  125 | 126 | | 127 |