This optimizes the AnimatedSwitcher so that it tags the right widget with its keyed subtree, and avoids rebuilding the transition unnecessarily.
This significantly improves the performance of Chips (which uses AnimatedSwitcher to swap out it's avatar and delete icon children).
This is a follow up on issue #17169 and the pull request #17298
This pull request adds the onChangeStart and onChangeEnd callbacks for CupertinoSlider. These are called when a user starts and ends a change respectively.
Pushing for @dcaraujo0872, the PR author.
This allows test environments other than `flutter test` to have a hook
into the test exception reporting. Some test environments, for example,
don't just dump error details to the console, but rather require them
to be reported to a separate server.
Our style guide says the k's are not necessary, and it seems like a good idea to make all the code be consistent on this.
Only naming changes to private vars: no logic changes.
I'm moving the assets in the assets-for-api-docs repo to a slightly different location to help with organization in that repo, so this PR points the doc URLs to the new location. The old assets won't be removed until this PR makes its way to the API docs website.
No documentation or code changes here, other than changing doc image URLs.
This adds a simple spacer widget first suggested by Scott Stoll (@ScottS2017) in the abandoned PR #15802
This PR replaces that one, cleans it up, and adds a test.
In FlutterDriver.scrollUntilVisible, pause momentarily after we kick off
the waitFor() call, in order to give that call a chance to complete
before we start scrolling if the element is on-screen.
1. Make CupertinoSwitch use BoxShadow.toPaint() so that it respects
the `debugDisableShadows` flag.
2. Increase blue radius on debug banner
3. Only stroke "synthetic shadow" borders if elevation is positive.
Further digging revealed that the reason --no-sim-use-hardfp was
required to be specified explicitly was that Android engine gen_snapshot
binaries are built on Windows with target_os=win.
This fixes#17169 by adding onChangeStart and onChangeEnd to the slider. These will be called when the user starts a change, and when they end a change, regardless of whether that change is a tap or a drag.
These differ from onChanged, in that they only report when the user starts and ends an interaction, not at every slight change.
Previously, the only hook into the rasterizer schreenshot code path
was via FlutterDriver.screenshot. This adds the ability for the
Flutter tool to hook into all three types of screenshots:
1. device (e.g. `adb shell screencap`)
2. Skia (capture spk)
3. Rasterizer (capture PNG via the engine)
Before this change, if you specified a non-null textTheme, but the theme you specified didn't have a body2 defined, then creating a ChipTheme would assert (which means creating a ThemeData would fail).
This adds handling for this corner case to default to reasonable values in that case. The slider had the same problem, but for accentTextTheme, so I fixed that too.
While I had the patient open, Hans and I noticed that TextTheme.merge wasn't doing the right thing in the case where some members were null either, so I fixed that, and added some examples, since merge/copyWith are common operations that are not always well understood.
Fixes#17251
This reverts #17147, which was safe under the assumption that
getArtifactPath() returns a platform-specific gen_snapshot instance
(which have the correct default set for this flag) -- it turns out that
though we pass the platform to getArtifactPath(), we always return the
host gen_snapshot for Android.
A followup patch will update getArtifactPath and revert this patch.
We've always cached kernel compiles during bundle builds. This adds
caching for kernel compiles during AOT builds by moving caching into the
KernelCompiler.compile() method rather than around each invocation of it.
This also filters buildbot paths included by the kernel compile that are
not present on the local machine at paths /b/build/slave/Linux_Engine/...
The kernel compiler should probably include an option to not emit these
paths in the depfile, since these are used both by Gradle and the
Fingerprinter class.
Previously, Flutter did not support iOS devices with armv7 or armv7s
CPUs. We now support these devices. This eliminates the previous
hardcoded checks that prevented running on simulators of older devices.
We maintain the existing restriction on running on watchOS or tvOS
simulators.
Previously, in non-release (i.e. profile) AOT builds, we were setting
--no-checked and --conditional_directives flags. --no-checked is the
default, and we don't make use of conditional directives in Flutter.
Allows users of Fingerprinter to filter the set of paths collected from
the explicitly-specified paths and those collected from depfiles.
In some cases, depfiles are emitted with files that are not present on
the local disk (e.g. the frontend compiler currently emits buildbot
paths for the dart core libraries and dart:ui). These files will not
materially affect whether we need to re-run a build action for which
they are inputs, since they're not present in the filesystem and
therefore cannot change.
Depending on whether can read the AVD (or it even has all fields populated) we might get extra "empty" columns, so this trims all blank cells from the end.
Emaultor keeps running on a seuccessful launch, so this automatically returns after 3 seconds if the process hasn't quit (we have to wait for some period to get stderr in the case of a failure).
I can't come up with a better name; anything with Simulator or Device in it will be confused with the existing IOSSimulator/Device classes (which represent the running devices).
* Allow customization of TextSpan in EditableText
* Addressed PR comments
* Added test with custom-styled EditableText subclass
* More code style fixes
This replaces the --prefer-shared-library flag, which falls back to
regular (non-shared-lib) compile if the NDK is not found, with the
--build-shared-library flag, which exits with an error message if the
NDK is not found.
This simplifies the set of allowed code paths through AOT compile,
resulting in better testability and easier-to-follow logic. It also
results in more predictable behaviour for continuous integration and
other scenarios.
Updates the message emitted when a kernel compile is skipped in the
build bundle action. Since we now use fingerprinting to enable
performance of script snapshots, AOT snapshots, and kernel compiles,
this helps a bit with debugging.
Also switches to trace level logging.
Some APIs (such as the ones in package:test) assume you're running
in a child zone of the test zone by attempting to extract information
from the zone values. When we run runAsync() in the root zone, those
zone values are lost, and such API methods don't work.
The solution is to run in a child zone, but with a specification that
says to use the Root zone for task scheduling (both timers and
microtakss).
1. Make goldenFileComparator getter return `null` if it's set to the
uninitialized comparator, which matches the behavior of the setter
(it sets it to the uninitialized comparator if the caller specifies
`null`).
2. Make the uninitialized comparator return trivial success (and print
a message) when asked to compare as opposed to throwing. This ensures
that the comparator will play nicely with live widget bindings
3. Augment documentation
4. Add assert that test doesn't modify the value of `autoUpdateGoldenFiles`
This change adds support for armv7, arm64, and universal iOS apps.
This change eliminates iOS target architecture hardcoding (previously
arm64 only) and uses the target architecture(s) specified in Xcode's
ARCHS setting ('Architectures' in Xcode Build Settings).
For universal binaries, set ARCHS to its default value, $(ARCHS_STANDARD).
Note that after changing the architecture in Xcode, developers should
run 'pod install' from the ios subdirectory of their project. A separate
change (that will land before this one) will add support for
automatically detecting project file and Podfile changes and re-running
pod install if necessary.
This change also adds an --ios-arch option to flutter build aot. In iOS
AOT builds (in profile and release mode), this dictates which
architectures are built into App.framework. This flag should generally
be unnecessary to set manually since flutter build aot is typically only
invoked internally by flutter itself.
In debug mode iOS builds, we build a stub App.framework with no
functionality, since the engine itself loads the code from the included
bundle and subsequently via hot reload. This is simply done for
consistency with profile/release AOT app structure.
To satisfy the linker, ensure that we're building this code for all
build architectures, not just CURRENT_ARCH.
This is pre-work for supporting arbitrary iOS architectures (armv7,
arm64, universal) in Flutter.
This re-lands feb16d8, which was reverted due to a flaky test.
In debug mode iOS builds, we build a stub App.framework with no
functionality, since the engine itself loads the code from the included
bundle and subsequently via hot reload. This is simply done for
consistency with profile/release AOT app structure.
To satisfy the linker, ensure that we're building this code for all
build architectures, not just CURRENT_ARCH.
This is pre-work for supporting arbitrary iOS architectures (armv7,
arm64, universal) in Flutter.
This will allow external tools that wrap our test harness to share the
code that generates the test bootstrap.
This change exposed an issue whereby the LocalGoldenFileComparator
was being too strict in its URI handling, so this changes relaxes
that constraint as well (and adds associated tests).
If the developer changes their Xcode build settings and their project
has plugins, pod install is required, (e.g. to pick up changes to the
target architecture).
Similarly, manual edits to the Podfile should trigger a pod install.
* Exclude flutter_goldens package from dartdoc because it's for internal
use only
* Document why flutter_tools doesn' tneed to be excluded from the list of
packages to document
* Performance optimization in the flutter comparator, and associated
test updates.
Adds a Fingerprinter utility class that can be used to compute unique
fingerprints for a set of input paths and build options, compare to the
output of a previous run, and skip the build action if no inputs or
options have changed. The existing Fingerprint class still does all the
heavy lifting. Fingerprinter adds common operations such as
reading/writing/comparing fingerprints and parsing depfiles.
This migrates existing uses of Fingerprint over to Fingerprinter.
This also adds better fingerprinting to AOT snapshotting, which
previously failed to include several options in its fingerprint
(--preview-dart-2, --prefer-shared-library).
This change adds Dart VM event support (listening for when a VM starts/stops by using a periodic heartbeat).
This also adds support to connect to a specific `IsolateRef` through the flutter driver, so that when an application spawns, it can immediately be driven (as shown in included example code).
In order to avoid checking binaries into flutter/flutter,
this comparator can be used to retrieve golden files from
a sibling flutter/goldens repository.
https://github.com/flutter/flutter/issues/16859
Currently, `flutter update-packages --force-upgrade` will
crash if it encounters a pubspec.yaml file with no dependencies
(either regular or dev). The assumption that we'd never see
such pubspec files is no longer valid, as we have such a file
in one of our tests.
Correctly split ARCHS into a Bash array in xcode_backend.sh.
Previously, when ARCHS contained multiple values (e.g., ARCHS="armv7 arm64"),
we treated that as a single architecture, and lipo invocation would
fail.