File tree Expand file tree Collapse file tree 5 files changed +16
-18
lines changed Expand file tree Collapse file tree 5 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -11,14 +11,12 @@ linter:
11
11
cancel_subscriptions : true
12
12
directives_ordering : true
13
13
eol_at_end_of_file : true
14
- omit_local_variable_types : true
15
14
prefer_asserts_in_initializer_lists : true
16
15
prefer_const_constructors : true
17
16
prefer_final_in_for_each : true
18
17
prefer_final_locals : true
19
18
prefer_null_aware_method_calls : true
20
19
prefer_null_aware_operators : true
21
- sort_constructors_first : true
22
20
sort_unnamed_constructors_first : true
23
21
sort_pub_dependencies : true
24
22
type_annotate_public_apis : true
Original file line number Diff line number Diff line change @@ -17,7 +17,9 @@ limitations under the License.
17
17
import 'dart:io' ;
18
18
19
19
import 'package:files/backend/database/model.dart' ;
20
+ import 'package:flutter/foundation.dart' ;
20
21
22
+ @immutable
21
23
class EntityInfo {
22
24
const EntityInfo ._(this ._entity, this .stat, this .entityType);
23
25
final FileSystemEntity _entity;
@@ -40,8 +42,6 @@ class EntityInfo {
40
42
}
41
43
42
44
@override
43
- // TODO(@HrX03): is this correct?
44
- // ignore: avoid_equals_and_hash_code_on_mutable_classes
45
45
bool operator == (Object other) {
46
46
if (other is EntityInfo ) {
47
47
return _equals (other);
@@ -50,8 +50,6 @@ class EntityInfo {
50
50
}
51
51
52
52
@override
53
- // TODO(@HrX03): is this correct?
54
- // ignore: avoid_equals_and_hash_code_on_mutable_classes
55
53
int get hashCode => Object .hash (
56
54
entity.path,
57
55
stat.accessed,
Original file line number Diff line number Diff line change @@ -14,6 +14,15 @@ enum SortType {
14
14
}
15
15
16
16
class CancelableFsFetch {
17
+ final Directory directory;
18
+ final ValueChanged <List <EntityInfo >?> onFetched;
19
+ final VoidCallback ? onCancel;
20
+ final ValueChanged <double ?>? onProgressChange;
21
+ final ValueChanged <OSError ?>? onFileSystemException;
22
+ final bool ascending;
23
+ final SortType sortType;
24
+ final bool showHidden;
25
+
17
26
CancelableFsFetch ({
18
27
required this .directory,
19
28
required this .onFetched,
@@ -24,14 +33,6 @@ class CancelableFsFetch {
24
33
this .sortType = SortType .name,
25
34
this .showHidden = false ,
26
35
});
27
- final Directory directory;
28
- final ValueChanged <List <EntityInfo >?> onFetched;
29
- final VoidCallback ? onCancel;
30
- final ValueChanged <double ?>? onProgressChange;
31
- final ValueChanged <OSError ?>? onFileSystemException;
32
- final bool ascending;
33
- final SortType sortType;
34
- final bool showHidden;
35
36
36
37
bool _running = false ;
37
38
Completer <void > cancelableCompleter = Completer <void >();
Original file line number Diff line number Diff line change 1
1
class PathParts {
2
2
const PathParts (this .root, this .parts, this .separator);
3
3
4
+ final String root;
5
+ final List <String > parts;
6
+ final String separator;
7
+
4
8
factory PathParts .parse (String path) {
5
9
late final String root;
6
10
late final String separator;
@@ -25,9 +29,6 @@ class PathParts {
25
29
26
30
return PathParts (root, parts, separator);
27
31
}
28
- final String root;
29
- final List <String > parts;
30
- final String separator;
31
32
32
33
String toPath ([int ? numOfParts]) {
33
34
final resolvedNumOfParts = numOfParts ?? parts.length;
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ class FilesTable extends StatelessWidget {
171
171
return InkWell (
172
172
onTap: column.allowSorting
173
173
? () {
174
- var newAscending = ascending;
174
+ bool newAscending = ascending;
175
175
if (columnIndex == index) {
176
176
newAscending = ! newAscending;
177
177
}
You can’t perform that action at this time.
0 commit comments