* Wrap the label widget of the Chip in a Flexible. (#11523)
* This allows the Chip to constrain the size of its content after taking into account the space occupied by the avatar and delete icon (if they are present)
* Adding unit tests to evaluate correct size constraints of the Chip widget's label. (#11523)
* Minor change in formatting.
* Adjust function formatting.
* Don't trigger assert if a render object ceases to be a semantic boundary
This bug was exposed by https://github.com/flutter/flutter/pull/11309, which caused the following assertion to trigger when scrolling in the Animation demo:
```
The following assertion was thrown during _updateSemantics():
'package:flutter/src/rendering/object.dart': Failed assertion: line 2626 pos 16: 'fragment is
_InterestingSemanticsFragment': is not true.
```
A minimal reproduction of the bug can be found in `semantics_10_test.dart`, which has been added as a regression test for the bug by this PR.
Looking at that test, here is a description of the faulty behaviour:
1. During the second `pumpWidget` call `RenderExcludeSemantics` marks itself as needing a semantics update (due to excluding going from `false` -> `true`).
2. This causes the nearest ancestor with semantics information (here: `RenderSemanticsAnnotations` representing the "container" Semantics widget) to be added to the `_nodesNeedingSemantics` list.
3. `RenderSliverList` (implementation behind ListView) marks itself as needing a semantics update (due to its changing children).
4. This causes the `RenderSemanticsGestureHandler` to be added to the `_nodesNeedingSemantics` list.
5. Next, canDrag is updated from `true` -> `false`. This means, `RenderSemanticsGestureHandler` is no longer a semantics boundary, it marks itself as needing a semantics update.
6. The nearest ancestor with semantics (`RenderSemanticsAnnotations`, the "container") is added to the `_nodesNeedingSemantics` list (this is a no-op because it is already in the list).
7. During `flushSemantics`, the `_nodesNeedingSemantics` list is walked. The first entry (`RenderSemanticsAnnotations`) updates the semantics tree to only contain the container widget and drop everything else (= no children of the ExcludeSemantics widget are walked).
8. The second entry (`RenderSemanticsGestureHandler`) is updated. It does not add any semantics of its own and is no longer a semantics boundary. Therefore, it wants to merge its descendent semantics into its parents. Here is where the assert throws because the algorithm assumes that every entry in the `_nodesNeedingSemantics` list will produce and own an `_InterestingSemanticsFragment` (passing your semantics on to your parents is not interesting).
The problem here seems to be step 4 in combination with step 5. In step 4 we rely on the fact that `RenderSemanticsGestureHandler` is an (explicit or implicit) semantics boundary and that it will be able to absorb the semantics change of `RenderSliverList`. This is true
at this time. However, in step 4 `RenderSemanticsGestureHandler` decides to no longer be an (explicit or implicit) semantics boundary and our assumption from step 5 becomes incorrect. We did nothing to correct this assumption.
This PR removes a node, that could potentially cease to be a (explicit or implicit) semantics boundary from the `_nodesNeedingSemantics` list to fix that problem. Please node that this does not mean that the node's semantics will not be updated: The node's closest ances
tor with semantics is added to that list during the `markNeedsSemanticsUpdate` call. During `flushSemantics` we will walk from this node to update the semantics of it's children (if changed), which will include the node in question.
* tiny fix
* simplify test
* analyzer fixes
* review comments
This change re-introduces skipping snapshot builds if input sources (and
outputs) have not changed since the last snapshot build, with a bugfix
to include the entry-point source in the checksum used to check whether
rebuild can be skipped. This ensures that the following sequence
invalidates the cached build, resulting in two snapshot builds:
flutter build ios lib/foo.dart
flutter build ios lib/bar.dart
This reverts commit 3d5afb5a81.
The most recent Flutter IntelliJ plugin replaces FLUTTER_MODULE with
WEB_MODULE and eliminates the exclusion of packages/ directories.
Use of the packages/ directory was turned off by default months ago, and
is replaced by the .packages file.
* Adds more customization options to the Chip widget
Includes:
- Custom Tooltip message for the delete button;
- Custom background color for the chip
- Custom delete icon color
- Custom label text style
* Adds missing type annotations to tests and improves documentation.
* Tweaks labelStyle field documentation
It was previously possible for event dispatch to occurr during the
brief window where the tree had been marked dirty but before it had
been relaid out by reassemble, which would cause assertions to fire if
someone did a hot reload while touching the device.
* Do not schedule animation if already at the target value
* Partially fixes https://github.com/flutter/flutter/issues/11495.
* Also includes a fix for Cupertino button to always run the tap animation even if the finger is immediately lifted from the screen (uncovered by a test failure).
* refactorings
* more tests
* test clearifications
* remove Listener
* fix lints
* fix async issue
* FadeInImage: shows a placeholder while loading then fades in
* fix dartdoc quotes
* license headers; imports
* use ImageProvider; docs; constructors
* _resolveImage when placeholder changes
* address comments
* docs re ImageProvider changes; unsubscribe from placeholder
* rebase
* address comments
* PopupMenuButton: create IconButton if child is Icon
Otherwise the resulting button has an abnormally small and rectangular
area. With multiple PopupMenuButton(child: Icon) they get squished
together in the AppBar.
* Add separate icon argument to PopupMenuButton
* Fix style issues and tweak dartdocs
* Add tests for icon argument to PopupMenuButton
* Group icon tests and fix broken test, analyzer warnings
* Test that the correct custom icon is present
* Apply De Morgan's to work around dart analyzer bug
see: https://github.com/dart-lang/sdk/issues/30288
* Revert "Make plugins add their repos to projects in the consuming app (#11447)"
This reverts commit abe1e2520b.
* Revert "Support for custom build types on Android (#11354)"
This reverts commit 87eec719e2.
* Revert "add a profile() method (#11443)"
This reverts commit 561d17a876.
* Revert "Fix documentation based on dartdoc's warnings (#11428)"
This reverts commit 6655074b37.
* Revert "Improve some docs around WillPopScope. (#11429)"
This reverts commit 58a28a2965.
* Revert "temporarily disable broken driver test in integration_ui (#11440)"
This reverts commit 764515ec78.
* Revert "style fix"
This reverts commit 00bfc86630.
* Revert "tests for waitFor/waitForAbsent"
This reverts commit 31d2ee9c0c.
* Revert "Always evaluate the finder in `driver.waitFor()` and `driver.waitForAbsent()`"
This reverts commit 11d7c79b99.
* fire service protocol extension events for frames
* start time in micros
* introduce a profile() function; only send frame events when in profile (or debug) modes
* moved the profile() function to foundation/profile.dart
* refactor to make the change more testable; test the change
* fire service protocol events by listening to onFrameInfo
* remove the frame event stream; add a devicelab test
* remove a todo
* final
The output location of gen_snapshot differs based on the engine's target
platform, and we don't know the target platform when building a
platform-independent FLX in JIT mode.
It was 8.0. It's now arbitrarily 18.0.
Changing this required adjusting some tests. Adjusting the tests
required debugging the tests. Debugging the tests required some tools
to help debugging gesture recognizers and gesture arenas, so I added
some. It also required updating some toString() methods which resulted
in some changes to the tree diagnostics logic.
Also I cleaned up some docs while I was at it.
Mainly, this adds documentation to members that were previously
lacking documentation.
It also adds a big block of documentation about improving performance
of widgets.
This also removes some references to package:collection and adds
global setEquals and listEquals methods in foundation that we can use.
(setEquals in particular should be much faster than the
package:collection equivalent, though both should be faster as they
avoid allocating new objects.) All remaining references now qualify
the import so we know what our remaining dependencies are.
Also lots of code reordering in Flutter driver to make the code
consistent and apply the style guide more thoroughly.
* Optimise AnimatedSize for the tight case.
* Remove `default` from a switch statement over enum (so that analyzer will complain if we add enum values).
* Adopt the Size since we use it after the child may have changed (which would throw normally).
* AnimatedCrossFade.layoutBuilder
* Prefix and Suffix support for TextFields
* Adding Tests
* Removing spurious newline.
* Fixing a small problem with the test
* Code review changes
* Code Review Changes
* Review Changes
* Export the new StrokeJoin enum
* Added example for line styles, and enabled line join styles.
* Reverting inadvertent change to main.dart.
* Updated due to code review of engine code
* Removed example.
* Added arguments to named routes, with test.
* Fixing some formatting
* Fixing Navigator.pop for named routes.
* Fixing comment.
* Simplifying test.
* Fixing new -> const for Text object.
* Tiny text change (also to kick a new Travis build)
* Added a more realistic test case.
* Reverting unintentional iml changes.
* Fixing trailing newline
* Removing some changes that snuck in.
This reverts commit e13e7806e3.
Turns out that with this patch, we aren't actually catching all
errors. For example, `flutter analyze --flutter-repo --watch` didn't
report errors in `dev/devicelab/test/adb_test.dart`.
* a11y: implement new SemanticsAction "showOnScreen" (v2)
This action is triggered when the user swipes (in accessibility mode) to the last visible item of a scrollable list to bring that item fully on screen.
This requires engine rolled to flutter/engine#3856.
I am in the process of adding tests, but I'd like to get early feedback to see if this approach is OK.
* fix null check
* review comments
* review comments
* Add test
* fix analyzer warning
* flutter analyze --watch auto detect if in flutter repo
* move isFlutterLibrary from AnalyzeOnce into AnalyzeBase for use by AnalyzeContinuously
* pass --flutter-repo to analysis server when analyzing the flutter repository
* enhance flutter analyze --watch to summarize public members lacking documentation
On Fuchsia, the system compositor is responsible for drawing shadows
for physical model layers with non-zero elevation.
Also fixed a bug where _needsCompositing was not being cleared prior
to updating it.
* Ensure that a frame is allways scheduled when a RenderObject marks itself as needing a semantics update
Fixes issue 2 described in https://github.com/flutter/flutter/issues/10971
Previously, an object could call `markNeedsSemanticsUpdate` and its wish would never be granted because no frame was scheduled that would actually update the semantics. This caused an issue during scrolling on Android where at the end of the scroll the `RenderIgnorePointer` would stop blocking the semantics of the scrolled view, call `markNeedsSemanticsUpdate`, but then no frame was scheduled to actually put the semantics of the scrolled view back into the semantics tree. That made the scrolled view unusable for a11y users.
At first I was a bit wary to call `requestVisualUpdate` within `markNeedsSemanticsUpdate` because technically the visual is fine, we only need the frame it schedules to update the semantics. However, it seems like we are using `requestVisualUpdate` for exactly that purpose in other places already where we just need an update to the semantics (e.g. 76a50fe0ca/packages/flutter/lib/src/rendering/object.dart (L2408)).
* add tests
In
df8bf384eb
a new functionality of the Dart VM Service Protocol has been introduced.
Clients connected to the Service Protocol are now able to expose
services that other clients (e.g. Observatory) can invoke through the
Service Protocol itself.
With these changes Flutter Tools register them self as a `reloadSources`
(a.k.a. HotReload) capable client.
Observatory is already listening for the clients which expose this
functionality and uses by default the service based version of
`reloadSources` when available, so requesting a HotReload from
Observatory will trigger the full Flutter HotReload.
Related https://github.com/dart-lang/sdk/issues/30023
Related https://github.com/flutter/flutter/pull/11229
Related https://github.com/flutter/flutter/pull/11256
In some cases, we've seen interactions between Instruments and the iOS
simulator that cause hung instruments and DTServiceHub processes. If
enough instances pile up, the host machine eventually becomes
unresponsive.
Until the underlying issue is resolved, manually kill any orphaned
instances (where the parent process has died and PPID is 1) before
launching another instruments run.
Apply a 30 second timeout to Android/iOS device polling.
If there's a device poll already in progress, skip polling for new
devices; wait for the first request to return/timeout.
* Include the process' `stdout` and `stderr` when it returns a
non-zero exit code in `runCheckedAsync()`
* Defensively catch errors in `AndroidDevice.isAppInstalled()`
and return false
* report run target and if it is an emulator
* don't print debug
* rename parameter, remove unused variable
* fix test
* fix comment
* tweak from review, and fix analyzer error
* send custom parameters for the event, not the session
* fix mock
* use the +1 for usage
* Make the drag resistance non-linear
* Let the easing of overscroll have a spring effect too
* Add tests and prevent possible drift by having a slightly smaller resistance when easing the overscroll
* lint
Previously, the snapshot file was recomputed on every build. We now
record checksums for all snapshot inputs (which are catalogued in the
snapshot dependencies file output alongside the snapshot) and only
rebuild if the checksum for any input file (or the previous output file) has
changed.
* AutomaticKeepAlive
A Widget that listens for notifications from widgets that don't want to die.
* Automatically wrap SliverList and SliverGrid children in AutomaticKeepAlive widgets
* Fixes for review comments
Previously, the snapshot file was recomputed on every build. We now
record checksums for all snapshot inputs (which are catalogued in the
snapshot dependencies file output alongside the snapshot) and only
rebuild if the checksum for any input file has changed.
* Only one call to createSnapshot exists, and it's in the same library.
* Eliminate conditional logic around the presence of depfilePath, the
only existing call always passes a non-null depfilePath.
Remove terminating semicolons; they are causing an "code inspection warning" in Android Studio:
```
This inspection reports redundant semicolon (';') token which is not required in Kotlin and may be removed.
```
* Use defaultTargetPlatform instead of Platform.operatingSystem for ImageProvider.
Add convenience helper to make it easier to display a short string for
an enums value.
* Add comment linking to issue.
Previously, xcodeMajorVersion and xcodeMinorVersion returned null unless
xcodeVersionSatisfactory had been called first. We now compute them on
demand, and cache the resultant values.
* Prefix and Suffix support for TextFields
* Adding Tests
* Removing spurious newline.
* Fixing a small problem with the test
* Code review changes
* Code Review Changes
* Review Changes
* Export the new StrokeJoin enum
* Added example for line styles, and enabled line join styles.
* Reverting inadvertent change to main.dart.
* Updated due to code review of engine code
* Removed example.
The main purpose of this PR is to make it so that when you set the
initial route and it's a hierarchical route (e.g. `/a/b/c`), it
implies multiple pushes, one for each step of the route (so in that
case, `/`, `/a`, `/a/b`, and `/a/b/c`, in that order). If any of those
routes don't exist, it falls back to '/'.
As part of doing that, I:
* Changed the default for MaterialApp.initialRoute to honor the
actual initial route.
* Added a MaterialApp.onUnknownRoute for handling bad routes.
* Added a feature to flutter_driver that allows the host test script
and the device test app to communicate.
* Added a test to make sure `flutter drive --route` works.
(Hopefully that will also prove `flutter run --route` works, though
this isn't testing the `flutter` tool's side of that. My main
concern is over whether the engine side works.)
* Fixed `flutter drive` to output the right target file name.
* Changed how the stocks app represents its data, so that we can
show a page for a stock before we know if it exists.
* Made it possible to show a stock page that doesn't exist. It shows
a progress indicator if we're loading the data, or else shows a
message saying it doesn't exist.
* Changed the pathing structure of routes in stocks to work more
sanely.
* Made search in the stocks app actually work (before it only worked
if we happened to accidentally trigger a rebuild). Added a test.
* Replaced some custom code in the stocks app with a BackButton.
* Added a "color" feature to BackButton to support the stocks use case.
* Spaced out the ErrorWidget text a bit more.
* Added `RouteSettings.copyWith`, which I ended up not using.
* Improved the error messages around routing.
While I was in some files I made a few formatting fixes, fixed some
code health issues, and also removed `flaky: true` from some devicelab
tests that have been stable for a while. Also added some documentation
here and there.
* Add hasAGoodToStringDeep and equalsIgnoringHashCodes methods.
Methods simplify testing of toStringDeep calls and other cases where
methods return strings containing hash codes.
This allows us to take advantage of improved command-line tooling (e.g.,
improvements in device listing in Instruments). Now that the engine is
built with Xcode 8 and the framework is tested against Xcode 8, this
reduces the set of configurations we need to support to allow us to
focus on the supported ones: Xcode 8 and Xcode 9.
* Change all instances of '$runtimeType#$hashCode' to use the describeIdentity method.
The describeIdentity method generates a shorter description with a consistent length
consisting of the runtime type and the a 5 hex character long truncated
version of the hash code.
Going forward, Android support libraries are published on maven (instead of bundling them with the SDK). Many plugins depend on these. To avoid requiring plugin users to add the maven repository to their app this change adds the repository to the template for `flutter create`.
This also bumps the support-annotations dependency to 25.4.0 (which also requires the new maven repository).
Introduce CompositedTransformTarget and CompositedTransformFollower
widgets, corresponding render objects, and corresponding layers.
Adjust the way text fields work to use this.
Various changes I needed to debug the issues that came up.
This reverts commit b2909a245a.
This resubmits the following patches:
1. Use Xcode instruments to list devices (#10801)
Eliminates the dependency on idevice_id from libimobiledevice. Instead,
uses Xcode built-in functionality.
2. Make device discovery asynchronous (#10803)
Migrates DeviceDiscovery.devices and all device-specific lookup to be
asynchronous.
* Revert "Make device discovery asynchronous (#10803)"
This reverts commit 972be9c8b4.
* Revert "Use Xcode instruments to list devices (#10801)"
This reverts commit 37bb5f1300.
This is to resolve a failure that looks related to a bad install of Xcode 8.0
on our build bots and should be reinstated when the infra issue is diagnosed
and resolved.
Instruments worked well when this was originally landed, and on the
following commit, but started failing two commits after this originally
landed. Manual invocation of instruments on the build host currently
results in:
```
dyld: Library not loaded: @rpath/InstrumentsAnalysisCore.framework/Versions/A/InstrumentsAnalysisCore
Referenced from: /Applications/Xcode8.0.app/Contents/Developer/usr/bin/instruments
Reason: image not found
Abort trap: 6
```
It appears the /Applications/Xcode8.0.app/Contents/Applications
directory (which contains Instruments) is missing on the host.
Moves all remaining calls to tools that are part of the libimobiledevice
suite of tools to the IMobileDevice class. This allows for better
tracking of this dependency, and easier mocking in tests.
Use a top-level getter in mac.dart rather than a static instance getter
and a top-level getter in ios_workflow.dart. Makes this code consistent
with how we do context lookups elsewhere.
Extract out IMobileDevice class, move class to idevice_id, ideviceinfo
(and eventually other libimobiledevice tools such as iproxy) behind this
interface.
Add tests for the case where libimobiledevice is not installed, the case
where it returns no devices, and the case where it returns device IDs.
Eliminates the need for the device/daemon code to get at the iOS/Android
tooling indirectly via Doctor. In tests, we now inject the workflow
objects (or mocks) directly.
This code is unused in any test. In upcoming changes that migrate to
Xcode instruments based device listing, we'll mock out the instruments
output separately.
* started copying stuff into cupertino page route
* extracted from material page route. Ready for testing
* works with button and gesture
* tests and docs
* review notes
* review notes
* Add SemanticsNode.isSelected flag
* Adds example usage to TabBar
See also https://github.com/flutter/engine/pull/3764
* Review comments
* whitespace fixes
* Fix doc ref and update engine roll
* works using pageview
it’s a bit heavy and scrolls
no documentation or test yet
* docs and tests
* more docs tweak
* revert drive by page view changes
* swap out the indexed stack for a custom thing
* layout everything on the cheap
tests pass
* add more tests
* move back to stack and add docs
* review notes
* build all the tabs once built
* Make dividers one device pixel thick as defined in Material design spec
* Updated divider test to check stroke width
* Clarified dividers with 0 height in the docs
* Updated Divider.height docs according to PR feedback