Commit Graph

12 Commits

Author SHA1 Message Date
Vasiliy Ditsyak
43407cf155
Access to fragment in router state on page refresh (#131123)
This PR fixes the issue #108614 
Particularly this behaviour https://github.com/flutter/flutter/issues/108614#issuecomment-1645231915
2023-09-18 21:12:08 +00:00
Mouad Debbar
d87656559c
[web] Use 'Uri' instead of 'dart:html' to extract pathname (#127983)
- Use `Uri.parse()` to extract pathname.
- Remove unused code from `utils.dart`.
- Add test for URL encoding.

(need to wait for https://github.com/flutter/flutter/pull/126851 to make it into Google3)
2023-06-06 03:46:02 +00:00
Mouad Debbar
764f4cc8c2
[web] Assert route names start with / if using PathUrlStrategy (#127986)
To avoid confusion and unpredictable errors (e.g. https://github.com/flutter/flutter/issues/127462), I'm adding this assert to disallow this pattern.

Fixes https://github.com/flutter/flutter/issues/127462
2023-06-01 15:31:24 +00:00
Mouad Debbar
7eecf8874f
[web] Use PlatformLocation from ui_web (#126851)
Remove the following APIs and export them directly from `dart:ui_web`:
- `urlStrategy` getter and setter
- `HashUrlStrategy`
- `PlatformLocation` and `BrowserPlatformLocation` (keep the façades for non-web platforms)

Depends on https://github.com/flutter/engine/pull/42043
Depends on https://github.com/flutter/engine/pull/42252

Part of https://github.com/flutter/flutter/issues/126831
2023-05-31 17:35:50 +00:00
Severin
cab29b2034
Fix platformLocation path and search dropping (#126232)
This PR fixes the dropping of both the `path` and `search` fields from the platform location in the URL when using Flutter Web and brings it in par with similar technologies (e.g. React Router).
It allows developers to keep the original path and/or search parameters in the URL, which are perfectly valid even while fragment routing is present.

**Example use case:**
Call a Flutter Web app with initial config parameters in the URL: 
`http://my-flutter.app/?skipIntro=true`

**Example:**
Before initial routing:
`http://localhost:45389/?foo=bar`
After routing:
`http://localhost:45389/#/menu`
After routing (with fix):
`http://localhost:45389/?foo=bar#menu`

Fixes #116415
2023-05-09 16:38:49 +00:00
Jackson Gardner
201f7311f7
Use direct dart API from dart:ui_web rather than JS shim. (#123443)
This is based off (and dependent on) these changes in the web engine that expose web-specific APIs: https://github.com/flutter/engine/pull/40608
2023-05-05 18:17:21 +00:00
Michael Goderbauer
b308555ed1
Enable dangling_library_doc_comments and library_annotations lints (#117365) 2022-12-20 16:03:21 -08:00
Mouad Debbar
1980492997
[web] Allow the usage of url strategies without conditional imports (#77103) 2021-11-02 12:13:02 -07:00
Mouad Debbar
458f6f4513
[web] Fix url strategy null safety (#79888) 2021-04-06 17:59:03 -07:00
Michael Goderbauer
807bb29888
enable prefer_function_declarations_over_variables lint (#77398) 2021-03-05 18:29:04 -08:00
David Iglesias
e148bf8785
[flutter_web_plugins] Migrate to null safety. (#69844) 2020-11-06 15:34:10 -08:00
Mouad Debbar
ffcf419136
[web] Support custom url strategies (#59797) 2020-10-08 17:57:02 -07:00