Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Migrate to nnbd #120

Merged
merged 13 commits into from
Mar 1, 2021
2 changes: 2 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ analyzer:
errors:
invalid_use_of_protected_member: error
always_declare_return_types: error
enable-experiment:
- non-nullable
linter:
rules:
- always_declare_return_types
Expand Down
1 change: 0 additions & 1 deletion lib/dartx.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import 'dart:typed_data';
import 'package:characters/characters.dart';
import 'package:collection/collection.dart' hide DelegatingList;
import 'package:crypto/crypto.dart' as crypto;
import 'package:meta/meta.dart';

export 'package:time/time.dart';
export 'package:characters/characters.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/comparable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extension ComparableX<T extends Comparable<T>> on T {
/// @return this value if it's in the range, or [minimumValue]
/// if this value is less than [minimumValue],
/// or [maximumValue] if this value is greater than [maximumValue].
T coerceIn(T minimumValue, [T maximumValue]) {
T coerceIn(T minimumValue, [T? maximumValue]) {
if (maximumValue != null && minimumValue > maximumValue) {
throw ArgumentError('Cannot coerce value to an empty range: '
'maximum $maximumValue is less than minimum $minimumValue.');
Expand Down
14 changes: 7 additions & 7 deletions lib/src/io/directory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ part of dartx_io;

extension DirectoryX on Directory {
Directory subdir(String part1,
[String part2,
String part3,
String part4,
String part5,
String part6,
String part7]) {
[String? part2,
String? part3,
String? part4,
String? part5,
String? part6,
String? part7]) {
return Directory(
path_helper.join(path, part1, part2, part3, part4, part5, part6, part7),
);
Expand All @@ -22,7 +22,7 @@ extension DirectoryX on Directory {
/// * If `this` and [target] are canonically the same, no operation occurs.
///
/// Returns a future that completes when complete.
Future<Null> copyRecursively(Directory target) async {
Future<void> copyRecursively(Directory target) async {
if (path_helper.canonicalize(path) ==
path_helper.canonicalize(target.path)) {
return;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/io/file.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extension FileX on File {
/// This functions passes the byte buffer to the [action] function.
///
/// You can use this function for huge files.
Future<Null> forEachBlock(
Future<void> forEachBlock(
int blockSize, void Function(Uint8List buffer) action) async {
var raf = await open(mode: FileMode.read);
while (true) {
Expand Down