Merge pull request #1115 from GetStream/hotfix/attachmentPicker

fix(ui): fix attachment picker ui
This commit is contained in:
Salvatore Giordano
2022-05-04 09:44:36 +02:00
committed by GitHub
2 changed files with 25 additions and 19 deletions
@@ -1,3 +1,9 @@
## Upcoming
🐞 Fixed
- Fixed attachment picker ui.
## 4.0.1 ## 4.0.1
- Minor fixes - Minor fixes
@@ -281,27 +281,27 @@ class _StreamAttachmentPickerState extends State<StreamAttachmentPicker> {
icon: widget.customAttachmentTypes[i] icon: widget.customAttachmentTypes[i]
.iconBuilder(context, _filePickerIndex == i + 1), .iconBuilder(context, _filePickerIndex == i + 1),
), ),
], const Spacer(),
), FutureBuilder(
const Spacer(), future: PhotoManager.requestPermissionExtend(),
FutureBuilder( builder: (context, snapshot) {
future: PhotoManager.requestPermissionExtend(), if (snapshot.hasData &&
builder: (context, snapshot) { snapshot.data == PermissionState.limited) {
if (snapshot.hasData && return TextButton(
snapshot.data == PermissionState.limited) { child: Text(context.translations.viewLibrary),
return TextButton( onPressed: () async {
child: Text(context.translations.viewLibrary), await PhotoManager.presentLimited();
onPressed: () async { _mediaListViewController.updateMedia(
await PhotoManager.presentLimited(); newValue: true,
_mediaListViewController.updateMedia( );
newValue: true, },
); );
}, }
);
}
return const SizedBox.shrink(); return const SizedBox.shrink();
}, },
),
],
), ),
DecoratedBox( DecoratedBox(
decoration: BoxDecoration( decoration: BoxDecoration(