mirror of
https://github.com/immich-app/immich.git
synced 2025-08-11 09:16:31 -04:00
remove ref listen and global key
This commit is contained in:
parent
c7e745acef
commit
0f647e57cb
@ -6,25 +6,13 @@ import 'package:immich_mobile/presentation/widgets/timeline/timeline.widget.dart
|
|||||||
import 'package:immich_mobile/providers/infrastructure/timeline.provider.dart';
|
import 'package:immich_mobile/providers/infrastructure/timeline.provider.dart';
|
||||||
import 'package:maplibre_gl/maplibre_gl.dart';
|
import 'package:maplibre_gl/maplibre_gl.dart';
|
||||||
|
|
||||||
class MapBottomSheet extends ConsumerStatefulWidget {
|
class MapBottomSheet extends ConsumerWidget {
|
||||||
const MapBottomSheet({super.key});
|
const MapBottomSheet({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
ConsumerState<MapBottomSheet> createState() => _MapBottomSheetState();
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
}
|
|
||||||
|
|
||||||
class _MapBottomSheetState extends ConsumerState<MapBottomSheet> {
|
|
||||||
GlobalKey key = GlobalKey();
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
LatLngBounds bounds = ref.watch(mapStateProvider.select((s) => s.bounds));
|
LatLngBounds bounds = ref.watch(mapStateProvider.select((s) => s.bounds));
|
||||||
|
|
||||||
ref.listen(mapStateProvider, (previous, next) async {
|
|
||||||
bounds = next.bounds;
|
|
||||||
key = GlobalKey();
|
|
||||||
});
|
|
||||||
|
|
||||||
return BaseBottomSheet(
|
return BaseBottomSheet(
|
||||||
initialChildSize: 0.25,
|
initialChildSize: 0.25,
|
||||||
shouldCloseOnMinExtent: false,
|
shouldCloseOnMinExtent: false,
|
||||||
@ -32,7 +20,7 @@ class _MapBottomSheetState extends ConsumerState<MapBottomSheet> {
|
|||||||
slivers: [
|
slivers: [
|
||||||
SliverFillRemaining(
|
SliverFillRemaining(
|
||||||
child: ProviderScope(
|
child: ProviderScope(
|
||||||
key: key,
|
key: ObjectKey(bounds),
|
||||||
overrides: [
|
overrides: [
|
||||||
timelineServiceProvider.overrideWith((ref) {
|
timelineServiceProvider.overrideWith((ref) {
|
||||||
final timelineService =
|
final timelineService =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user