[mob][photos] Fix share action (#6464)

## Description
Clear selected file after share action is completed.
## Tests

### After

https://github.com/user-attachments/assets/a316409d-4d3e-45c8-ba79-38bd21e5c352

### Before

https://github.com/user-attachments/assets/4941d4ab-55a7-4d17-9504-29d15a3d1cea
This commit is contained in:
Aman Raj Singh Mourya
2025-07-07 10:05:28 +05:30
committed by GitHub

View File

@@ -423,44 +423,7 @@ class _FileSelectionActionsWidgetState
),
labelText: S.of(context).editLocation,
icon: Icons.edit_location_alt_outlined,
onTap: () async {
await showBarModalBottomSheet(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(5),
),
),
backgroundColor: getEnteColorScheme(context).backgroundElevated,
barrierColor: backdropFaintDark,
topControl: Stack(
alignment: Alignment.bottomCenter,
children: [
// This container is for increasing the tap area
Container(
width: double.infinity,
height: 36,
color: Colors.transparent,
),
Container(
height: 5,
width: 40,
decoration: const BoxDecoration(
color: backgroundElevated2Light,
borderRadius: BorderRadius.all(
Radius.circular(5),
),
),
),
],
),
context: context,
builder: (context) {
return UpdateLocationDataWidget(
widget.selectedFiles.files.toList(),
);
},
);
},
onTap: _editLocation,
),
);
}
@@ -480,11 +443,7 @@ class _FileSelectionActionsWidgetState
labelText: S.of(context).share,
icon: Icons.adaptive.share_outlined,
key: shareButtonKey,
onTap: () => shareSelected(
context,
shareButtonKey,
widget.selectedFiles.files.toList(),
),
onTap: _shareSelectedFiles,
),
);
}
@@ -524,6 +483,54 @@ class _FileSelectionActionsWidgetState
return const SizedBox();
}
Future<void> _editLocation() async {
await showBarModalBottomSheet(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(5),
),
),
backgroundColor: getEnteColorScheme(context).backgroundElevated,
barrierColor: backdropFaintDark,
topControl: Stack(
alignment: Alignment.bottomCenter,
children: [
// This container is for increasing the tap area
Container(
width: double.infinity,
height: 36,
color: Colors.transparent,
),
Container(
height: 5,
width: 40,
decoration: const BoxDecoration(
color: backgroundElevated2Light,
borderRadius: BorderRadius.all(
Radius.circular(5),
),
),
),
],
),
context: context,
builder: (context) {
return UpdateLocationDataWidget(
widget.selectedFiles.files.toList(),
);
},
);
}
Future<void> _shareSelectedFiles() async {
shareSelected(
context,
shareButtonKey,
widget.selectedFiles.files.toList(),
);
widget.selectedFiles.clearAll();
}
Future<void> _moveFiles() async {
if (split.pendingUploads.isNotEmpty || split.ownedByOtherUsers.isNotEmpty) {
widget.selectedFiles