Commit a190365
committed
[webview_flutter_lwe] Fix navigation delegate callbacks after delegate replacement
When the navigation delegate is replaced after the WebView is created, the new
delegate's platform channel handler was never registered because it is only set
up when the view is first created. As a result the new delegate's callbacks
(onUrlChange, onPageFinished, onProgress, etc.) were still delivered to the
previous delegate and silently dropped.
Bind the new delegate's channel handler when the delegate is set after the view
has been created, and guard the handler setup so a delegate is bound at most
once. This makes onUrlChange work when a delegate is swapped, which the
'can receive url changes' integration test exercises.1 parent 47a34f0 commit a190365
2 files changed
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
142 | 144 | | |
143 | 145 | | |
144 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
145 | 156 | | |
146 | 157 | | |
147 | 158 | | |
| |||
383 | 394 | | |
384 | 395 | | |
385 | 396 | | |
| 397 | + | |
386 | 398 | | |
387 | 399 | | |
388 | 400 | | |
| |||
392 | 404 | | |
393 | 405 | | |
394 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
395 | 414 | | |
396 | 415 | | |
397 | 416 | | |
| |||
0 commit comments