File tree Expand file tree Collapse file tree 5 files changed +12
-13
lines changed Expand file tree Collapse file tree 5 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ linter:
59
59
- avoid_classes_with_only_static_members
60
60
# - avoid_double_and_int_checks # only useful when targeting JS runtime
61
61
- avoid_empty_else
62
- # - avoid_equals_and_hash_code_on_mutable_classes
62
+ - avoid_equals_and_hash_code_on_mutable_classes
63
63
- avoid_field_initializers_in_const_classes
64
64
- avoid_function_literals_in_foreach_calls
65
65
# - avoid_implementing_value_types # not yet tested
@@ -175,7 +175,7 @@ linter:
175
175
- sort_constructors_first
176
176
- sort_pub_dependencies
177
177
- sort_unnamed_constructors_first
178
- # - test_types_in_equals
178
+ - test_types_in_equals
179
179
- throw_in_finally
180
180
# - type_annotate_public_apis # subset of always_specify_types
181
181
- type_init_formals
@@ -192,7 +192,7 @@ linter:
192
192
- unnecessary_overrides
193
193
- unnecessary_parenthesis
194
194
- unnecessary_statements
195
- # - unnecessary_string_interpolations
195
+ - unnecessary_string_interpolations
196
196
- unnecessary_this
197
197
- unrelated_type_equality_checks
198
198
# - unsafe_html # not yet tested
Original file line number Diff line number Diff line change @@ -101,9 +101,9 @@ class DefaultTextDelegate implements TextDelegate {
101
101
@override
102
102
String durationIndicatorBuilder (Duration duration) {
103
103
const String separator = ':' ;
104
- final String minute = '${( duration .inMinutes ) .toString ().padLeft (2 , '0' )}' ;
104
+ final String minute = duration.inMinutes.toString ().padLeft (2 , '0' );
105
105
final String second =
106
- '${ ((duration - Duration (minutes : duration .inMinutes )).inSeconds ).toString ().padLeft (2 , '0' )}' ;
106
+ ((duration - Duration (minutes: duration.inMinutes)).inSeconds).toString ().padLeft (2 , '0' );
107
107
return '$minute $separator $second ' ;
108
108
}
109
109
}
Original file line number Diff line number Diff line change @@ -9,8 +9,9 @@ import 'package:flutter/material.dart';
9
9
import 'package:flutter/foundation.dart' ;
10
10
import 'package:photo_manager/photo_manager.dart' ;
11
11
12
+ @immutable
12
13
class AssetEntityImageProvider extends ImageProvider <AssetEntityImageProvider > {
13
- AssetEntityImageProvider (
14
+ const AssetEntityImageProvider (
14
15
this .entity, {
15
16
this .scale = 1.0 ,
16
17
this .thumbSize = 200 ,
@@ -33,9 +34,7 @@ class AssetEntityImageProvider extends ImageProvider<AssetEntityImageProvider> {
33
34
34
35
/// File type for the image asset, use it for some special type detection.
35
36
/// 图片资源的类型,用于某些特殊类型的判断
36
- ImageFileType _imageFileType;
37
-
38
- ImageFileType get imageFileType => _imageFileType ?? _getType ();
37
+ ImageFileType get imageFileType => _getType ();
39
38
40
39
@override
41
40
ImageStreamCompleter load (
Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ class AssetPicker extends StatelessWidget {
235
235
if (provider.currentPathEntity != null )
236
236
Flexible (
237
237
child: Text (
238
- '${ provider .currentPathEntity .name } ' ,
238
+ provider.currentPathEntity.name ?? ' ' ,
239
239
style: const TextStyle (
240
240
fontSize: 18.0 ,
241
241
fontWeight: FontWeight .normal,
@@ -329,7 +329,7 @@ class AssetPicker extends StatelessWidget {
329
329
child: Padding (
330
330
padding: const EdgeInsets .only (right: 10.0 ),
331
331
child: Text (
332
- '${ pathEntity .name } ' ,
332
+ pathEntity.name ?? ' ' ,
333
333
style: const TextStyle (fontSize: 18.0 ),
334
334
maxLines: 1 ,
335
335
overflow: TextOverflow .ellipsis,
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ class _AudioPageBuilderState extends State<AudioPageBuilder> {
89
89
/// 标题组件
90
90
Widget get titleWidget => Text (
91
91
widget.asset.title,
92
- style: TextStyle (
92
+ style: const TextStyle (
93
93
fontSize: 20.0 ,
94
94
fontWeight: FontWeight .normal,
95
95
),
@@ -137,7 +137,7 @@ class _AudioPageBuilderState extends State<AudioPageBuilder> {
137
137
'${Constants .textDelegate .durationIndicatorBuilder (data .data )}'
138
138
' / '
139
139
'${Constants .textDelegate .durationIndicatorBuilder (assetDuration )}' ,
140
- style: TextStyle (
140
+ style: const TextStyle (
141
141
fontSize: 20.0 ,
142
142
fontWeight: FontWeight .normal,
143
143
),
You can’t perform that action at this time.
0 commit comments