Commit graph

46 commits

Author SHA1 Message Date
Greg Spencer 4ce7fdd92b
Remove 'must be non-null' and 'must not be null' comments from non-framework libraries (#134994)
## Description

This removes all of the comments that are of the form "so-and-so must not be null" or "so-and-so must be non-null" from the cases where those values are defines as non-nullable values.

This PR removes them from the library in the repo that don't have anything to do with the framework.

This was done by hand, since it really didn't lend itself to scripting, so it needs to be more than just spot-checked, I think. I was careful to leave any comment that referred to parameters that were nullable, but I may have missed some.

In addition to being no longer relevant after null safety has been made the default, these comments were largely fragile, in that it was easy for them to get out of date, and not be accurate anymore anyhow.

This did create a number of constructor comments which basically say "Creates a [Foo].", but I don't really know how to avoid that in a large scale change, since there's not much you can really say in a lot of cases.  I think we might consider some leniency for constructors to the "Comment must be meaningful" style guidance (which we de facto have already, since there are a bunch of these).

## Related PRs
- https://github.com/flutter/flutter/pull/134984
- https://github.com/flutter/flutter/pull/134991
- https://github.com/flutter/flutter/pull/134992
- https://github.com/flutter/flutter/pull/134993

## Tests
 - Documentation only change.
2023-09-19 17:26:07 +00:00
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
Michael Goderbauer 14f9ed28d0
Analyze doc code snippets for all packages for which we publish docs (#132607)
Fixes TODO in the analyzer script :)
2023-08-16 22:24:48 +00:00
Mouad Debbar 87d5214da6
[web] Migrate web-only initialization APIs (#129856)
- `ui_web.warmupEngine`
- `ui_web.setPluginHandler`
- `ui_web.debugEmulateFlutterTesterEnvironment`
2023-07-13 20:12:10 +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
Lioness100 26b6c1bedd
Fix typos (#121171)
* Fix typos

* lowercase animated & opacity

* Undo typo fix

---------

Co-authored-by: Michael Goderbauer <goderbauer@google.com>
2023-02-23 19:43:21 +00:00
Michael Goderbauer 6cd4945540
Remove unnecessary null checks in flutter_web_plugins (#118862) 2023-01-23 19:26:05 +00:00
Pierre-Louis 74cfc3db67
Use curly_braces_in_flow_control_structures for non-flutter packages (#104629)
* Use `curly_braces_in_flow_control_structures` for `packages/flutter_driver`

* Use `curly_braces_in_flow_control_structures` for `packages/flutter_goldens`

* Use `curly_braces_in_flow_control_structures` for `packages/flutter_goldens_client`

* Use `curly_braces_in_flow_control_structures` for `packages/flutter_localizations`

* Use `curly_braces_in_flow_control_structures` for `packages/flutter_test`

* Use `curly_braces_in_flow_control_structures` for `packages/flutter_web_plugins`

* fix comments

* Use `curly_braces_in_flow_control_structures` for `packages/integration_test`

* fix indentation
2022-05-25 20:01:11 +02:00
Michael Goderbauer 3e406c6781
Prepare packages (minus tools,framework) for use_super_parameters (#100510) 2022-03-30 15:31:59 -07:00
Michael Goderbauer 5684b9f69e
Enable no_leading_underscores_for_local_identifiers (#96422) 2022-01-21 14:43:59 -08:00
Mouad Debbar 1980492997
[web] Allow the usage of url strategies without conditional imports (#77103) 2021-11-02 12:13:02 -07:00
Ian Hickson 299d484903
Enable more lints (#91642) 2021-10-14 22:03:03 -07:00
The one with the braid (she/her) | Dфҿ mit dem Zopf (sie/ihr) 01afd64bcc
Implemented getter to expose current url strategy for web plugins (#90708) 2021-10-13 10:48:05 -07:00
Ian Hickson 989f864497
Enable avoid_setters_without_getters (#91067) 2021-10-01 00:58:05 -07:00
Greg Spencer 88f3811055
Turn on avoid_dynamic_calls lint, except packages/flutter tests, make appropriate changes. (#84476)
This adds avoid_dynamic_calls to the list of lints, and fixes all instances where it was violated.

Importantly, this lint is NOT turned on for flutter/packages/test, because those changes are happening in another PR: #84478
2021-06-14 14:16:57 -07:00
Anis Alibegić c99ed373b3
Fixed large amount of spelling errors (#83744) 2021-06-02 10:14:06 -07:00
Ian Hickson 5e0cc4cba4
Migrate to ChannelBuffers.push (#82564) 2021-05-21 15:09:03 -07:00
Ian Hickson 2ae1e39810
Revert "Migrate to ChannelBuffers.push (#82057)" (#82525) 2021-05-14 12:09:03 -07:00
Ian Hickson b86d5c0094
Migrate to ChannelBuffers.push (#82057) 2021-05-13 14:34:04 -07:00
Michael Goderbauer b8a2456737
Enable library_private_types_in_public_api lint (#81578) 2021-05-10 16:26:16 -07:00
Ren You 7f1d1414cc
Revert "Migrate to ChannelBuffers.push (#81235)" (#81829)
This reverts commit 35ad43f20c.
2021-05-04 06:17:19 -07:00
Ian Hickson 35ad43f20c
Migrate to ChannelBuffers.push (#81235) 2021-05-03 17:14:03 -07:00
Angjie Li b74df388e1
Revert "Migrate to ChannelBuffers.push (#76288)" (#81226)
This reverts commit c26ed03c8a.
2021-04-26 12:57:17 -07:00
Ian Hickson c26ed03c8a
Migrate to ChannelBuffers.push (#76288)
* Migrate to ChannelBuffers.push

* Move TestDefaultBinaryMessenger to its own file

* Apply deprecations and fix usages
2021-04-23 15:39:34 -07:00
Mouad Debbar 458f6f4513
[web] Fix url strategy null safety (#79888) 2021-04-06 17:59:03 -07:00
Michael Goderbauer a7e3b1a35d
Clean up ignores that are not ignoring anything (#78493) 2021-03-19 15:32:46 -07:00
Alexandre Ardhuin b54d72cf66
deprecated consistency (#75903) 2021-02-17 10:21:02 -08:00
Ian Hickson bb29c88ae7
Simplify the flutter_web_plugins plugin registration API. (#70337) (#70722)
In principle this is backwards compatible; I just merged all the classes into one and deprecated everything that became redundant as a result.
2020-12-03 15:35:41 -08:00
Jonah Williams a76289bb1b
[flutter_tools] run web unit tests in sound null safety (#70799) 2020-11-19 16:49:05 -08:00
Jonah Williams 6e84a14294
Revert "Simplify the flutter_web_plugins plugin registration API. (#70337)" (#70505)
This reverts commit 8749d95521.
2020-11-13 16:04:53 -08:00
Ian Hickson 8749d95521
Simplify the flutter_web_plugins plugin registration API. (#70337)
In principle this is backwards compatible; I just merged all the classes into one and deprecated everything that became redundant as a result.
2020-11-13 14:05:34 -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
Jonah Williams 6620f831e9
fix dart docs for build (#67479) 2020-10-06 18:15:15 -07:00
Ian Hickson 8d923bf9a7
flutter_web_plugins cleanup and documentation (#67164) 2020-10-06 16:52:02 -07:00
Jonah Williams f6cbf488e1
[null-safety] pass experiments to builders (#67152)
Force opt-in flutter test platform to null safety for repo testing
2020-10-02 16:38:50 -07:00
Dan Field 02b1080101
Functionality to check handlers set on platform channels (#57696) 2020-05-21 14:52:05 -07:00
Ian Hickson 449f4a6673
License update (#45373)
* Update project.pbxproj files to say Flutter rather than Chromium

Also, the templates now have an empty organization so that we don't cause people to give their apps a Flutter copyright.

* Update the copyright notice checker to require a standard notice on all files

* Update copyrights on Dart files. (This was a mechanical commit.)

* Fix weird license headers on Dart files that deviate from our conventions; relicense Shrine.

Some were already marked "The Flutter Authors", not clear why. Their
dates have been normalized. Some were missing the blank line after the
license. Some were randomly different in trivial ways for no apparent
reason (e.g. missing the trailing period).

* Clean up the copyrights in non-Dart files. (Manual edits.)

Also, make sure templates don't have copyrights.

* Fix some more ORGANIZATIONNAMEs
2019-11-27 15:04:02 -08:00
gaaclarke 53dcf92f7d
Fixed bug where we could accidently call a callback twice. (#43467) 2019-10-29 16:04:38 -07:00
gaaclarke 71d75e3e0a
Channel buffers (#40165)
Started reading stored channel messages from ui.channelBuffers when handlers get set.
2019-09-19 16:58:54 -07:00
Harry Terkelsen 6911a1513c
Allow sending platform messages from plugins to the framework and implement EventChannel (#40638)
* Allow sending messages from the platform to the framework

* Add ability to send messages from the plugin to the platform.

Also adds [PluginEventChannel] which is the plugin counterpart to
EventChannel.

Fixes https://github.com/flutter/flutter/issues/39981

* fix analyzer errors

* Enhance doc comments

* Remove dead code in test
2019-09-19 10:48:57 -07:00
Harry Terkelsen d33cf11556
Automatically generated registrants for web plugins (#39628)
* WIP on web plugin registry

* WIP on registering plugins

* WIP on web plugin registration

* Only generate `package:flutter_web_plugins` imports if plugins are
defined

* Add parsing test

* Add documentation

* Fix analyzer warnings

* add license headers

* Add tests for package:flutter_web_plugins

* Run `flutter update-packages --force-upgrade`

* Fix analyzer errors

* Fix analyzer error in test

* Update copyright and remove flutter SDK constraints

* Enable tests since engine has rolled

* add flutter_web_plugins tests to bots

* Create an empty .packages file for WebFs test
2019-09-03 10:37:34 -07:00