Skip to content

Commit a86c937

Browse files
committed
🎨 Improve example code format
1 parent dd027ae commit a86c937

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

example/lib/constants/picker_method.dart

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,16 @@ class PickMethod {
122122
context,
123123
enableRecording: true,
124124
);
125-
if (result != null) {
126-
final AssetPicker<AssetEntity, AssetPathEntity> picker =
127-
context.findAncestorWidgetOfExactType()!;
128-
final DefaultAssetPickerProvider p =
129-
picker.builder.provider as DefaultAssetPickerProvider;
130-
await p.currentPathEntity!.refreshPathProperties();
131-
await p.switchPath(p.currentPathEntity!);
132-
p.selectAsset(result);
125+
if (result == null) {
126+
return;
133127
}
128+
final AssetPicker<AssetEntity, AssetPathEntity> picker =
129+
context.findAncestorWidgetOfExactType()!;
130+
final DefaultAssetPickerProvider p =
131+
picker.builder.provider as DefaultAssetPickerProvider;
132+
await p.currentPathEntity!.refreshPathProperties();
133+
await p.switchPath(p.currentPathEntity!);
134+
p.selectAsset(result);
134135
},
135136
child: const Center(
136137
child: Icon(Icons.camera_enhance, size: 42.0),
@@ -298,11 +299,8 @@ class PickMethod {
298299
selectedAssets: assets,
299300
selectPredicate: (BuildContext c, AssetEntity a, bool isSelected) {
300301
print('Asset title: ${a.title}');
301-
if (a.title?.endsWith('.gif') == true) {
302-
return false;
303-
}
304-
return true;
305-
}
302+
return a.title?.endsWith('.gif') != true;
303+
},
306304
);
307305
},
308306
);

0 commit comments

Comments
 (0)