@@ -96,18 +96,16 @@ class bool {
96
96
97
97
/// Parse [source] as an, optionally case-insensitive, boolean literal.
98
98
///
99
- /// If [caseSensitive] is `true` , which is the default,
99
+ /// If [caseSensitive] is `true` , which is the default,
100
100
/// the only accepted inputs are the strings `"true"` and `"false"` .
101
- /// If [caseSensitive] is `false` , any combination of upper and lower case ASCII letters
101
+ /// If [caseSensitive] is `false` , any combination of upper and lower case ASCII letters
102
102
/// in the words `"true"` and `"false"` are accepted, as if the input was first lower-cased.
103
103
///
104
- /// If the [source] string does not contain a valid boolean literal
104
+ /// If the [source] string does not contain a valid boolean literal
105
105
/// a [FormatException] is thrown.
106
106
///
107
107
/// Rather than throwing and immediately catching the [FormatException] ,
108
108
/// instead use [tryParse] to handle a potential parsing error.
109
- ///
110
- /// ```
111
109
external static bool parse (String source, {bool ? caseSensitive});
112
110
113
111
/// Parse [source] as an, optionally case-insensitive, boolean literal.
@@ -121,14 +119,13 @@ class bool {
121
119
/// print(int.tryParse('TRUE')); // true
122
120
/// print(int.tryParse('false', caseSensitive: true)); // false
123
121
/// print(int.tryParse('FALSE', caseSensitive: true)); // false
124
- /// print(int.tryParse('NO')); // FormatException
125
- /// print(int.tryParse('YES')); // FormatException
126
- /// print(int.tryParse('0')); // FormatException
127
- /// print(int.tryParse('1')); // FormatException
122
+ /// print(int.tryParse('NO')); // null
123
+ /// print(int.tryParse('YES')); // null
124
+ /// print(int.tryParse('0')); // null
125
+ /// print(int.tryParse('1')); // null
128
126
/// ```
129
127
external static bool ? tryParse (String source, {bool ? caseSensitive});
130
128
131
-
132
129
external int get hashCode;
133
130
134
131
/// The logical conjunction ("and") of this and [other] .
0 commit comments