mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 16:56:19 +01:00
Fix selecting something in timeline reset the scroll position
This commit is contained in:
parent
35212e0a1c
commit
0ded662de5
1 changed files with 7 additions and 4 deletions
|
@ -181,15 +181,17 @@ class _WrappedHomePhotosState extends State<_WrappedHomePhotos> {
|
||||||
child: _BlocSelector(
|
child: _BlocSelector(
|
||||||
selector: (state) => state.selectedItems.isEmpty,
|
selector: (state) => state.selectedItems.isEmpty,
|
||||||
builder: (context, isSelectedEmpty) => isSelectedEmpty
|
builder: (context, isSelectedEmpty) => isSelectedEmpty
|
||||||
? const DoubleTapExitContainer(
|
? DoubleTapExitContainer(
|
||||||
child: _BodyView(),
|
child: _BodyView(
|
||||||
|
key: _bodyKey,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
: PopScope(
|
: PopScope(
|
||||||
canPop: false,
|
canPop: false,
|
||||||
onPopInvoked: (_) {
|
onPopInvoked: (_) {
|
||||||
context.addEvent(const _SetSelectedItems(items: {}));
|
context.addEvent(const _SetSelectedItems(items: {}));
|
||||||
},
|
},
|
||||||
child: const _BodyView(),
|
child: _BodyView(key: _bodyKey),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -197,11 +199,12 @@ class _WrappedHomePhotosState extends State<_WrappedHomePhotos> {
|
||||||
}
|
}
|
||||||
|
|
||||||
final _key = GlobalKey();
|
final _key = GlobalKey();
|
||||||
|
final _bodyKey = GlobalKey();
|
||||||
bool? _isVisible;
|
bool? _isVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
class _BodyView extends StatelessWidget {
|
class _BodyView extends StatelessWidget {
|
||||||
const _BodyView();
|
const _BodyView({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
Loading…
Reference in a new issue