Skip to content

Commit

Permalink
fix analyzer warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
suragch committed Oct 11, 2023
1 parent f5b823b commit e35ad31
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
include: package:lints/recommended.yaml

analyzer:
strong-mode:
implicit-dynamic: false
language:
strict-casts: true
strict-inference: true
strict-raw-types: true
2 changes: 1 addition & 1 deletion lib/src/sanitizer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ String normalizeEmail(String email, [Map<String, Object>? options]) {
return '';
}

List parts = email.split('@');
final parts = email.split('@');
parts[1] = parts[1].toLowerCase();

if (options['lowercase'] == true) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/validator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ bool isDivisibleBy(String str, Object n) {
///
/// Note: this function takes into account surrogate pairs.
bool isLength(String str, int min, [int? max]) {
List surrogatePairs = _surrogatePairsRegExp.allMatches(str).toList();
final surrogatePairs = _surrogatePairsRegExp.allMatches(str).toList();
int len = str.length - surrogatePairs.length;
return len >= min && (max == null || len <= max);
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: string_validator
version: 1.0.0
version: 1.0.1
description: Dart library for validating and sanitizing strings, especially
those from user input.
homepage: https://github.com/suragch/string_validator
Expand Down

0 comments on commit e35ad31

Please sign in to comment.