How can I update the URL without navigating using go_router on flutter web?

I am using flutter_map in conjunction with go_router. I have a container widget, which is stateful and, among other things, can save the map bounds for state restoration. It loads the initial bound from the widget and, if the widget is updated, it will move the map to match as well.

The deeplink is accessed in form of ?lat=51.5&lon=0.0&zoom=16, which will cause the map to jump to the specified position.

Part of the code is below:

class AroundYouMapRoute extends GoRouteData {
  final double? lat;
  final double? lng;
  final double? zoom;
  // I would like to pass a LatLng object but it is not supported
  // https://github.com/flutter/flutter/issues/110781
  const AroundYouMapRoute({this.lat, this.lng, this.zoom});

  @override
  Widget build(BuildContext context, GoRouterState state) {
    final initialPosition = lat?.chain((lat) => lng?.chain((lng) => LatLng(lat, lng)));
    return AroundYouMapContainer(
      initialPosition: initialPosition,
      initialZoom: zoom,
      route: this,
    );
  }
}

class AroundYouMapContainer extends StatefulHookConsumerWidget {
  const AroundYouMapContainer({super.key, this.initialPosition, this.initialZoom, this.route});
  final LatLng? initialPosition;
  final double? initialZoom;
  final AroundYouMapRoute? route;

  @override
  ConsumerState<AroundYouMapContainer> createState() => _AroundYouMapState();
}

class _AroundYouMapState extends ConsumerState<AroundYouMapContainer> with RestorationMixin<AroundYouMapContainer> {
  late final boundsRestorable = RestorableLatLngBoundsN(null);
  bool _mapReady = false;
  late final mapController = MapController();
  LatLngBounds? get bounds => boundsRestorable.value;
  set bounds(LatLngBounds? value) {
    boundsRestorable.value = value;
  }

  @override
  Widget build(BuildContext context) {
    void onMove(MapCamera camera) {
      final bounds = camera.visibleBounds;
      this.bounds = bounds;
      // TODO: I need something to update the route / URL in the browser without navigating away
    }

    void onMapReady() {
      _mapReady = true;
      this.bounds = mapController.camera.visibleBounds;
    }

    // ...contains a map which uses mapController, onMove and onMapReady
  }

  @override
  String? get restorationId => 'AroundYou';

  @override
  void restoreState(RestorationBucket? oldBucket, bool initialRestore) {
    registerForRestoration(boundsRestorable, 'bounds');
  }

  @override
  void didUpdateWidget(AroundYouMapContainer oldWidget) {
    super.didUpdateWidget(oldWidget);
    if (_mapReady) {
        mapController.move(
            widget.initialPosition ?? mapController.camera.center,
            widget.initialZoom ?? mapController.camera.zoom
        );
    }
  }

  @override
  void dispose() {
    mapController.dispose();
    super.dispose();
  }
}

I have read https://github.com/csells/go_router/discussions/342 but it is not useful, because it involves using `context.go()`. I have tried it, but there is an ill effect that, when I jump to another page, the map will be moved because of the animation, which triggers the `move()` callback, and it will do another `context.go()` and jump back to the map.

How can I make the URL change in the browser when I move the map, without adverse effects?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật