id
stringlengths 14
17
| text
stringlengths 23
1.11k
| source
stringlengths 35
114
|
---|---|---|
76ae2896a3bc-5 | ‘An InputDecorator…cannot have an unbounded width’
The error message suggests that it’s also related to box constraints,
which are important to understand to avoid many of the most common
Flutter framework errors.
What does the error look like?
The message shown by the error looks like this:
How might you run into the error?
This error occurs, for example, when a Row contains a TextFormField or a
TextField but the latter has no width constraint.
How to fix it?
As suggested by the error message, fix this error by constraining the text field
using either an Expanded or SizedBox widget. The following example
demonstrates using an Expanded widget:
‘Incorrect use of ParentData widget’
This error is about missing an expected parent widget.
What does the error look like?
The message shown by the error looks like this: | https://docs.flutter.dev/testing/common-errors/index.html |
76ae2896a3bc-6 | The message shown by the error looks like this:
How might you run into the error?
While Flutter’s widgets are generally flexible in how they can be composed
together in a UI, a small subset of those widgets expect specific parent
widgets. When this expectation can’t be satisfied in your widget tree, you’re
likely to see this error.
Here is an incomplete list of widgets that expect specific parent widgets
within the Flutter framework. Feel free to submit a PR (using the doc icon in
the top right corner of the page) to expand this list.
Flexible
Row, Column, or Flex
Expanded (a specialized Flexible)
Row, Column, or Flex
Positioned
Stack
TableCell
Table
How to fix it?
The fix should be obvious once you know which parent widget is missing. | https://docs.flutter.dev/testing/common-errors/index.html |
76ae2896a3bc-7 | The fix should be obvious once you know which parent widget is missing.
‘setState called during build’
The build method in your Flutter code is not a good place to call setState
either directly or indirectly.
What does the error look like?
When the error occurs, the following message gets displayed in the console:
How might you run into the error?
In general, this error occurs when the setState method is called within the
build method.
A common scenario where this error occurs is when attempting to trigger a Dialog
from within the build method. This is often motivated by the need to
immediately show information to the user, but setState should never be called
from a build method.
Below is a snippet that seems to be a common culprit of this error: | https://docs.flutter.dev/testing/common-errors/index.html |
76ae2896a3bc-8 | Below is a snippet that seems to be a common culprit of this error:
You don’t see the explicit call to setState, but it’s called by showDialog.
The build method is not the right place to call showDialog because build
can be called by the framework for every frame, for example, during an
animation.
How to fix it?
One way to avoid this error is to use the Navigator API to trigger the dialog
as a route. In the example below, there are two pages. The second page has a
dialog to be displayed upon entry. When the user requests the second page from
clicking on a button on the first page, the Navigator pushes two routes in a
row – one for the second page and another for the dialog.
References
To learn more about how to debug errors, especially layout errors in Flutter,
check out the following resources:
How to debug layout issues with the Flutter Inspector
Understanding constraints
Dealing with box constraints | https://docs.flutter.dev/testing/common-errors/index.html |
76ae2896a3bc-9 | Understanding constraints
Dealing with box constraints
Flutter architectural overview | https://docs.flutter.dev/testing/common-errors/index.html |
5d2bb36abcc4-0 | Debugging Flutter apps
DevTools
Setting breakpoints
The Dart analyzer
Logging
Debugging application layers
Debug mode assertions
Debugging animations
Measuring app startup time
Tracing Dart code
Performance overlay
Debug flags
Common problems
“Too many open files” exception (MacOS)
Widgets marked const that should be equal to each other, aren’t
Other resources
There’s a wide variety of tools and features to help debug
Flutter applications. Here are some of the available tools:
DevTools, a suite of performance and profiling
tools that run in a browser. | https://docs.flutter.dev/testing/debugging/index.html |
5d2bb36abcc4-1 | DevTools, a suite of performance and profiling
tools that run in a browser.
Android Studio/IntelliJ, and VS Code
(enabled with the Flutter and Dart plugins)
support a built-in source-level debugger with
the ability to set breakpoints, step through code,
and examine values.
Flutter inspector, a widget inspector available
in DevTools, and also directly from Android Studio
and IntelliJ (enabled with the Flutter plugin).
The inspector allows you to examine a visual
representation of the widget tree, inspect
individual widgets and their property values,
enable the performance overlay, and more.
If you are looking for a way to use GDB to remotely debug the
Flutter engine running within an Android app process,
check out flutter_gdb.
DevTools
For debugging and profiling apps, DevTools might be
the first tool you reach for. DevTools runs in a
browser and supports a variety of features:
source-level debugger | https://docs.flutter.dev/testing/debugging/index.html |
5d2bb36abcc4-2 | source-level debugger
widget inspector that displays a visual widget tree,
and “widget select” mode where you select a widget
in the app and it drills down to that widget in
the tree
memory profiler
timeline view that supports tracing, and importing
and exporting trace information
logging view
If you run your application in debug mode or
profile mode, while it’s running you can open
DevTools in the browser to connect to your app.
DevTools doesn’t work well with an app compiled to
release mode, as the debugging and profiling
information has been stripped away.
If you use DevTools for profiling, make sure to
run your application in profile mode. Otherwise,
the main output that appears on your profile are the
debug asserts verifying the framework’s various invariants
(see Debug mode assertions).
For more information, see the
DevTools documentation.
Setting breakpoints | https://docs.flutter.dev/testing/debugging/index.html |
5d2bb36abcc4-3 | For more information, see the
DevTools documentation.
Setting breakpoints
You can set breakpoints directly in your IDE/editor
(such as Android Studio/IntelliJ and VS Code),
in the DevTools debugger,
or programmatically.
The Dart analyzer
If you’re using a Flutter enabled IDE/editor,
the Dart analyzer is already checking your code
and looking for possible mistakes.
If you run from the command line,
test your code with flutter analyze.
The Dart analyzer makes heavy use of type annotations that
you put in your code to help track problems down.
You are encouraged to use them everywhere (avoiding var,
untyped arguments, untyped list literals, and so on)
as this is the quickest and least painful way of tracking
down problems.
For more information, see Using the Dart analyzer.
Logging | https://docs.flutter.dev/testing/debugging/index.html |
5d2bb36abcc4-4 | For more information, see Using the Dart analyzer.
Logging
Another useful debugging tool is logging.
You set logging up programmatically
then view the output in the DevTools
logging view, or in the console.
Debugging application layers
Flutter was designed with a layered architecture that includes
widget, rendering, and painting layers. For links to more
information and videos, see The Framework architecture on the
GitHub wiki, and the community article, The Layer Cake.
The Flutter widget inspector provides a visual representation
of the widget tree, but if you want a greater level of detail,
or you want a verbose text-based dump of the widget,
layer, or render trees, see
Debug flags: application layers
in the Debugging Flutter apps programmatically page.
Debug mode assertions | https://docs.flutter.dev/testing/debugging/index.html |
5d2bb36abcc4-5 | Debug mode assertions
During development, you are highly encouraged to use Flutter’s
debug mode. This is the default if you use bug icon in
Android Studio, or flutter run at the command line.
Some tools support assert statements through the
command-line flag --enable-asserts.
In this mode, Dart assert statements are enabled,
and the Flutter framework evaluates the argument
to each assert statement encountered during execution,
throwing an exception if the result is false.
This allows developers to enable or disable invariant
checking, such that the associated performance cost
is only paid during debugging sessions.
When an invariant is violated, it’s reported to the
console, with some context information to help track
down the source of the problem.
For more information, check out Assert in the
Dart language documentation.
Debugging animations
The easiest way to debug animations is to slow them down.
The Flutter inspector provides a Slow Animations button,
or you can slow the animations programmatically. | https://docs.flutter.dev/testing/debugging/index.html |
5d2bb36abcc4-6 | For more information on debugging janky (non-smooth)
applications, see Flutter performance profiling.
Measuring app startup time
To gather detailed information about the time it takes for your
Flutter app to start, you can run the flutter run command
with the trace-startup and profile options.
The trace output is saved as a JSON file called start_up_info.json
under the build directory of your Flutter project.
The output lists the elapsed time from app startup to these trace
events (captured in microseconds):
Time to enter the Flutter engine code.
Time to render the first frame of the app.
Time to initialize the Flutter framework.
Time to complete the Flutter framework initialization.
For example:
Tracing Dart code | https://docs.flutter.dev/testing/debugging/index.html |
5d2bb36abcc4-7 | For example:
Tracing Dart code
To perform a performance trace,
you can use the DevTools Timeline view.
The Timeline view also supports importing
and exporting trace files. For more
information, see the Timeline view docs.
You can also
perform traces programmatically,
though these traces can’t be imported
into DevTool’s Timeline view.
Be sure to use run your app in profile mode
before tracing to ensure that the runtime performance
characteristics closely matches that of your final product.
Performance overlay
To get a graphical view of the performance of your application,
turn on the performance overlay. You can do this in the
by clicking the Performance Overlay button in the
Flutter inspector.
You can also turn on the overlay programmatically.
For information on how to interpret the graphs in the overlay,
see The performance overlay in
the Flutter performance profiling guide.
Debug flags | https://docs.flutter.dev/testing/debugging/index.html |
5d2bb36abcc4-8 | Debug flags
In most cases, you won’t need to use the debug flags
directly, as you’ll find the most useful debugging
functionality in the DevTools suite. But if you
prefer to use the debug flags directly, see
Debug flags: performance in the
Debugging Flutter apps programmatically page.
Common problems
The following is a problem that some have encountered on MacOS.
“Too many open files” exception (MacOS)
The default limit for Mac OS on how many files it can have open at a
time is rather low. If you run into this limit,
increase the number of available
file handlers using the ulimit command:
If you use Travis or Cirrus for testing, increase the number of
available file handlers that they can open by adding the same line to
flutter/.travis.yml, or flutter/.cirrus.yml, respectively.
Widgets marked const that should be equal to each other, aren’t | https://docs.flutter.dev/testing/debugging/index.html |
5d2bb36abcc4-9 | Widgets marked const that should be equal to each other, aren’t
In debug mode, you might find that two const widgets that should to all
appearances be equal (because of Dart’s constant deduplication) are not.
For example, this code should print 1:
It should print 1 (rather than 2) because the two constants are the same and sets
coalesce duplicate values (and indeed the analyzer complains that
“Two elements in a set literal shouldn’t be equal”). As expected, in release
builds, it does print 1. However, in debug builds it prints 2. This is because the
flutter tool injects the source location of Widget constructors into the code at compile
time, so the code is effectively: | https://docs.flutter.dev/testing/debugging/index.html |
5d2bb36abcc4-10 | This results in the instances being different, and so they are not deduplicated by the set.
We use this injected information to make the error messages clearer when
a widget is involved in an exception, by reporting where the relevant widget was created.
Unfortunately, it has the visible side-effect of making otherwise-identical constants be
different at compile time.
To disable this behavior, pass --no-track-widget-creation to the flutter run command.
With that flag set, the code above prints “1” in debug and release builds, and error messages
include a message saying that they cannot provide all the information that they would otherwise
be able to provide if widget creation tracking was enabled.
See also:
Our documentation on how the Widget Inspector uses widget creation tracking.
WidgetInspectorService.isWidgetCreationTracked.
The _Location class in widget_inspector.dart.
The kernel transform that implements this feature.
Other resources | https://docs.flutter.dev/testing/debugging/index.html |
5d2bb36abcc4-11 | The kernel transform that implements this feature.
Other resources
You might find the following docs useful:
Performance best practices
Flutter performance profiling
Using an OEM debugger
Flutter’s modes
Debugging Flutter apps programmatically
DevTools
Android Studio/IntelliJ
VS Code | https://docs.flutter.dev/testing/debugging/index.html |
a6ac94e5a763-0 | Handling errors in Flutter
Errors caught by Flutter
Define a custom error widget for build phase errors
Errors not caught by Flutter
Handling all types of errors
The Flutter framework catches errors that occur during callbacks
triggered by the framework itself, including errors encountered
during the build, layout, and paint phases. Errors that don’t occur
within Flutter’s callbacks can’t be caught by the framework,
but you can handle them by setting up an error handler on the
PlatformDispatcher.
All errors caught by Flutter are routed to the
FlutterError.onError handler. By default,
this calls FlutterError.presentError,
which dumps the error to the device logs.
When running from an IDE, the inspector overrides this
behavior so that errors can also be routed to the IDE’s
console, allowing you to inspect the
objects mentioned in the message. | https://docs.flutter.dev/testing/errors/index.html |
a6ac94e5a763-1 | Note:
Consider calling FlutterError.presentError
from your custom error handler in order to see
the logs in the console as well.
When an error occurs during the build phase,
the ErrorWidget.builder callback is
invoked to build the widget that is used
instead of the one that failed. By default,
in debug mode this shows an error message in red,
and in release mode this shows a gray background.
When errors occur without a Flutter callback on the call stack,
they are handled by the PlatformDispatcher’s error callback. By default,
this only prints errors and does nothing else.
You can customize these behaviors,
typically by setting them to values in
your void main() function.
Below each error type handling is explained. At the bottom
there’s a code snippet which handles all types of errors. Even
though you can just copy-paste the snippet, we recommend you
to first get acquainted with each of the error types.
Errors caught by Flutter | https://docs.flutter.dev/testing/errors/index.html |
a6ac94e5a763-2 | Errors caught by Flutter
For example, to make your application quit immediately any time an
error is caught by Flutter in release mode, you could use the
following handler:
Note:
The top-level kReleaseMode constant indicates
whether the app was compiled in release mode.
This handler can also be used to report errors to a logging service.
For more details, see our cookbook chapter for
reporting errors to a service.
Define a custom error widget for build phase errors
To define a customized error widget that displays whenever
the builder fails to build a widget, use MaterialApp.builder.
Errors not caught by Flutter
Consider an onPressed callback that invokes an asynchronous function,
such as MethodChannel.invokeMethod (or pretty much any plugin).
For example:
If invokeMethod throws an error, it won’t be forwarded to FlutterError.onError.
Instead, it’s forwarded to the PlatformDispatcher. | https://docs.flutter.dev/testing/errors/index.html |
a6ac94e5a763-3 | To catch such an error, use PlatformDispatcher.instance.onError.
Handling all types of errors
Say you want to exit application on any exception and to display
a custom error widget whenever a widget building fails - you can base
your errors handling on next code snippet: | https://docs.flutter.dev/testing/errors/index.html |
8b8dc9f72c5d-0 | Testing Flutter apps
Unit tests
Widget tests
Integration tests
Continuous integration services
The more features your app has, the harder it is to test manually.
Automated tests help ensure that your app performs correctly before
you publish it, while retaining your feature and bug fix velocity.
Note:
For hands-on practice of testing Flutter apps, see the
How to test a Flutter app codelab.
Automated testing falls into a few categories:
A unit test tests a single function, method, or class.
A widget test (in other UI frameworks referred to
as component test) tests a single widget.
An integration test
tests a complete app or a large part of an app. | https://docs.flutter.dev/testing/index.html |
8b8dc9f72c5d-1 | An integration test
tests a complete app or a large part of an app.
Generally speaking, a well-tested app has many unit and widget tests,
tracked by code coverage, plus enough integration tests
to cover all the important use cases. This advice is based on
the fact that there are trade-offs between different kinds of testing,
seen below.
Confidence
Low
Higher
Highest
Maintenance cost
Low
Higher
Highest
Dependencies
Few
More
Most
Execution speed
Quick
Quick
Slow
Unit tests | https://docs.flutter.dev/testing/index.html |
8b8dc9f72c5d-2 | Quick
Slow
Unit tests
A unit test tests a single function, method, or class.
The goal of a unit test is to verify the correctness of a
unit of logic under a variety of conditions.
External dependencies of the unit under test are generally
mocked out.
Unit tests generally don’t read from or write
to disk, render to screen, or receive user actions from
outside the process running the test.
For more information regarding unit tests,
you can view the following recipes
or run flutter test --help in your terminal.
Note:
If you’re writing unit tests for code that
uses plugins and you want to avoid crashes,
check out Plugins in Flutter tests.
If you want to test your Flutter plugin,
check out Testing plugins.
Recipes
An introduction to unit testing
Mock dependencies using Mockito
Widget tests | https://docs.flutter.dev/testing/index.html |
8b8dc9f72c5d-3 | Mock dependencies using Mockito
Widget tests
A widget test (in other UI frameworks referred to as component test)
tests a single widget. The goal of a widget test is to verify that the
widget’s UI looks and interacts as expected. Testing a widget involves
multiple classes and requires a test environment that provides the
appropriate widget lifecycle context.
For example, the Widget being tested should be able to receive and
respond to user actions and events, perform layout, and instantiate child
widgets. A widget test is therefore more comprehensive than a unit test.
However, like a unit test, a widget test’s environment is replaced with
an implementation much simpler than a full-blown UI system.
Recipes
An introduction to widget testing
Find widgets
Handle scrolling
Tap, drag, and enter text
Integration tests | https://docs.flutter.dev/testing/index.html |
8b8dc9f72c5d-4 | Tap, drag, and enter text
Integration tests
An integration test tests a complete app or a large part of an app.
The goal of an integration test is to verify that all the widgets
and services being tested work together as expected.
Furthermore, you can use integration
tests to verify your app’s performance.
Generally, an integration test runs on a real device or an OS emulator,
such as iOS Simulator or Android Emulator.
The app under test is typically isolated
from the test driver code to avoid skewing the results.
For more information on how to write integration tests, see the integration
testing page.
Recipes
An introduction to integration testing
Performance profiling
Continuous integration services
Continuous integration (CI) services allow you to run your
tests automatically when pushing new code changes.
This provides timely feedback on whether the code
changes work as expected and do not introduce bugs. | https://docs.flutter.dev/testing/index.html |
8b8dc9f72c5d-5 | For information on running tests on various continuous
integration services, see the following:
Continuous delivery using fastlane with Flutter
Test Flutter apps on Appcircle
Test Flutter apps on Travis
Test Flutter apps on Cirrus
Codemagic CI/CD for Flutter
Flutter CI/CD with Bitrise | https://docs.flutter.dev/testing/index.html |
ea3e6891a6dd-0 | Integration testing
Overview
Project setup
Directory structure
Running using the flutter command
Running in a browser
Testing on Firebase Test Lab
Android setup
iOS setup
Test Lab project setup
Uploading an Android APK
Uploading an Android APK from the command line
Uploading Xcode tests
Uploading Xcode tests from the command line
This page describes how to use the integration_test package to run
integration tests. Tests written using this package have the following
properties:
Compatibility with the flutter drive command,
for running tests on a physical device or emulator.
The ability to be run on Firebase Test Lab,
enabling automated testing on a variety of devices.
Compatibility with flutter_test APIs,
enabling tests to be written in a similar style as widget tests | https://docs.flutter.dev/testing/integration-tests/index.html |
ea3e6891a6dd-1 | Note:
The integration_test package is part of the Flutter SDK itself.
To use it, make sure that you update your app’s pubspec file
to include this package as one of your dev_dependencies.
For an example, see the Project setup section below.
Overview
Unit tests, widget tests, and integration tests
There are three types of tests that Flutter supports.
A unit test verifies the behavior of a method or class.
A widget test verifies the behavior of Flutter widgets
without running the app itself. An integration test (also
called end-to-end testing or GUI testing) runs the full app.
Hosts and targets
During development, you are probably writing the code
on a desktop computer, called the host machine,
and running the app on a mobile device, browser,
or desktop application, called the target device.
(If you are using a web
browser or desktop application,
the host machine is also the target device.)
integration_test | https://docs.flutter.dev/testing/integration-tests/index.html |
ea3e6891a6dd-2 | integration_test
Tests written with the integration_test package can:
Run directly on the target device, allowing you to test on
multiple Android or iOS devices using Firebase Test Lab.
Run using flutter test integration_test.
Use flutter_test APIs, making integration tests more
like writing widget tests.
Migrating from flutter_driver
Existing projects using flutter_driver can be migrated to
integration_test by following the Migrating from flutter_drive
guide.
Project setup
Add integration_test and flutter_test to your pubspec.yaml file:
dev_dependencies
integration_test
sdk
flutter
flutter_test
sdk
flutter
In your project, create a new directory
integration_test/ with a new file, <name>_test.dart: | https://docs.flutter.dev/testing/integration-tests/index.html |
ea3e6891a6dd-3 | Note:
Note: You should only use testWidgets
to declare your tests, or errors won’t
be reported correctly.
Directory structure
lib/
...
integration_test/
foo_test.dart
bar_test.dart
test/
# Other unit tests go here.
See also:
integration_test usage
Running using the flutter command
These tests can be launched with the
flutter test command, where <DEVICE_ID>:
is the optional device ID or pattern displayed
in the output of the flutter devices command:
test integration_test/foo_test.dart
d <DEVICE_ID>
This runs the tests in foo_test.dart. To run all tests in this directory on
the default device, run:
Running in a browser | https://docs.flutter.dev/testing/integration-tests/index.html |
ea3e6891a6dd-4 | Running in a browser
First, Download and install ChromeDriver
and run it on port 4444:
To run tests with flutter drive, create a new directory containing a new file,
test_driver/integration_test.dart:
Then add IntegrationTestWidgetsFlutterBinding.ensureInitialized() in your
integration_test/<name>_test.dart file:
In a separate process, run flutter_drive:
To learn more, see the
Running Flutter driver tests with web wiki page.
Testing on Firebase Test Lab
You can use the Firebase Test Lab with both Android
and iOS targets.
Android setup
Follow the instructions in the Android Device Testing
section of the README.
iOS setup
Follow the instructions in the iOS Device Testing
section of the README.
Test Lab project setup | https://docs.flutter.dev/testing/integration-tests/index.html |
ea3e6891a6dd-5 | Test Lab project setup
Go to the Firebase Console,
and create a new project if you don’t have one
already. Then navigate to Quality > Test Lab:
Uploading an Android APK
Create an APK using Gradle:
pushd android
# flutter build generates files in android/ for building the app
flutter build apk
./gradlew app:assembleAndroidTest
./gradlew app:assembleDebug
Ptarget
=integration_test/<name>_test.dart
popd
Where <name>_test.dart is the file created in the
Project Setup section.
Drag the “debug” APK from
<flutter_project_directory>/build/app/outputs/apk/debug
into the Android Robo Test target on the web page.
This starts a Robo test and allows you to run
other tests: | https://docs.flutter.dev/testing/integration-tests/index.html |
ea3e6891a6dd-6 | Click Run a test,
select the Instrumentation test type and drag
the following two files:
<flutter_project_directory>/build/app/outputs/apk/debug/<file>.apk
<flutter_project_directory>/build/app/outputs/apk/androidTest/debug/<file>.apk
If a failure occurs,
you can view the output by selecting the red icon:
Uploading an Android APK from the command line
See the Firebase Test Lab section of the README
for instructions on uploading the APKs from the command line.
Uploading Xcode tests
See the Firebase TestLab iOS instructions
for details on how to upload the .zip file
to the Firebase TestLab section of the Firebase Console.
Uploading Xcode tests from the command line
See the iOS Device Testing section in the README
for instructions on how to upload the .zip file
from the command line. | https://docs.flutter.dev/testing/integration-tests/index.html |
282bd49921e2-0 | Migrating from flutter_driver
Starter example project
Existing tests
Setup
Test migration
Example: Verifying a widget is displayed
Example: Tap actions
Example: Scrolling
This page describes how to migrate an existing project using
flutter_driver to the integration_test package,
in order to run integration tests.
Tests with integration_test use the same methods that are
used in widget testing.
For an introduction to the integration_test package,
check out the Integration testing guide.
Starter example project
The project in this guide is a small example desktop application with this
functionality:
On the left, there’s a list of plants that the user can scroll,
tap and select.
On the right, there’s a details screen that displays the plant name
and species. | https://docs.flutter.dev/testing/integration-tests/migration/index.html |
282bd49921e2-1 | On the right, there’s a details screen that displays the plant name
and species.
On app start, when no plant is selected, a text asking the user to select
a plant is displayed
The list of plants is loaded from a local JSON file located in the
assets folder.
You can find the full code example in the Example Project folder.
Existing tests
The project contains the three flutter_driver tests
performing the following checks:
Verifying the initial status of the app.
Selecting the first item on the list of plants.
Scrolling and selecting the last item on the list of plants.
The tests are contained in the test_driver folder,
inside the main_test.dart file.
In this folder there’s also a file named main.dart,
which contains a call to the method enableFlutterDriverExtension().
This file won’t be necessary anymore when using integration_test.
Setup | https://docs.flutter.dev/testing/integration-tests/migration/index.html |
282bd49921e2-2 | Setup
To start using the integration_test package,
add the integration_test to
your pubspec.yaml file if you haven’t yet:
dev_dependencies
integration_test
sdk
flutter
Next, in your project, create a new directory
integration_test/, create your tests files there
with the format: <name>_test.dart.
Test migration
This section contains different examples on how to migrate existing
flutter_driver tests to integration_test tests.
Example: Verifying a widget is displayed
When the app starts the screen on the left displays
a text asking the user to select one of the plants on the list.
This test verifies that the text is displayed.
flutter_driver
In flutter_driver, the test uses waitFor,
which waits until the finder can locate the widget.
The test fail if the widget can’t be found. | https://docs.flutter.dev/testing/integration-tests/migration/index.html |
282bd49921e2-3 | integration_test
In integration_test you have to perform two steps:
First load the main app widget using
the tester.pumpWidget method.
Then, use expect with the matcher findsOneWidget to verify
that the widget is displayed.
Example: Tap actions
This test performs a tap action on the first item on the list,
which is a ListTile with the text “Alder”.
After the tap, the test waits for the details to appear.
In this case, it waits for the widget with the text “Alnus” to
be displayed.
Also , the test verifies that the text
“Please select a plant from the list.”
is no longer displayed.
flutter_driver
In flutter_driver, use the driver.tap method to perform
a tap over a widget using a finder.
To verify that a widget is not displayed,
use the waitForAbsent method. | https://docs.flutter.dev/testing/integration-tests/migration/index.html |
282bd49921e2-4 | To verify that a widget is not displayed,
use the waitForAbsent method.
integration_test
In integration_test, use tester.tap to perform the tap actions.
After the tap action, you must call to tester.pumpAndSettle to wait
until the action has finished, and all the UI changes have happened.
To verify that a widget is not displayed, use the same expect
function with the findsNothing matcher.
Example: Scrolling
This test is similar to the previous test,
but it scrolls down and taps the last item instead.
flutter_driver
To scroll down with flutter_driver,
use the driver.scroll method.
You must provide the widget to perform the scrolling action,
as well as a duration for the scroll.
You also have to provide the total offset for the scrolling action.
integration_test | https://docs.flutter.dev/testing/integration-tests/migration/index.html |
282bd49921e2-5 | integration_test
With integration_test, can use the method tester.scrollUntilVisible.
Instead of providing the widget to scroll,
provide the item that you’re searching for.
In this case, you’re searching for the
item with the text “Zedoary”,
which is the last item on the list.
The method searches for any Scrollable widget
and performs the scrolling action using the given offset.
The action repeats until the item is visible. | https://docs.flutter.dev/testing/integration-tests/migration/index.html |
86421835afff-0 | Using an OEM debugger
Debugging Dart code
Dart debugger
Flutter inspector
Flutter outline
Debugging with Android Gradle (Android)
Debugging with Xcode (iOS)
Resources
Flutter
Android
iOS
If you are exclusively writing Flutter apps with
Dart code and not using platform-specific libraries,
or otherwise accessing platform-specific features,
you can debug your code using your IDE’s debugger.
Only the first section of this guide, Debugging Dart code,
is relevant for you.
If you’re writing a platform-specific plugin or
using platform-specific libraries written in Swift,
ObjectiveC, Java, or Kotlin, you can debug
that portion of your code using Xcode (for iOS)
or Android Gradle (for Android).
This guide shows you how you can connect two
debuggers to your Dart app, one for Dart,
and one for the OEM code. | https://docs.flutter.dev/testing/oem-debuggers/index.html |
86421835afff-1 | Note:
If you are looking for a way to use GDB to remotely debug the
Flutter engine running within an Android app process,
check out flutter_gdb.
Debugging Dart code
Use your IDE for standard Dart debugging.
These instructions describe Android Studio,
but you can use your preferred IDE with the
Flutter and Dart plugins installed and configured.
Tip:
Connect to a physical device when debugging,
rather than an emulator or simulator,
which don’t support profile mode.
For more information, see Flutter’s modes.
Dart debugger
Open your project in Android Studio.
If you don’t have a project yet,
create one using the instructions in Test drive.
Simultaneously bring up the Debug pane and
run the app in the Console
view by clicking the bug icon
(). | https://docs.flutter.dev/testing/oem-debuggers/index.html |
86421835afff-2 | The first time you launch the app is the slowest.
You should see the Debug pane appear at the bottom
of the window that looks something like the following:
You can configure where the debug pane appears,
or even tear it off to its own
window using the gear to the right in the Debug pane bar.
This is true for any inspector in Android Studio.
Add a breakpoint on the counter++ line.
In the app, click the + button
(FloatingActionButton, or FAB, for short)
to increment the counter. The app pauses.
The following screenshot shows:
Breakpoint in the edit pane.
State of the app in the debug pane, when paused at the breakpoint.
this variable expanded to display its values. | https://docs.flutter.dev/testing/oem-debuggers/index.html |
86421835afff-3 | You can step in, out, and over Dart statements, hot reload or resume the app,
and use the debugger in the same way you’d use any debugger.
The 5: Debug button toggles display of the debug pane.
Flutter inspector
There are two other features provided by the
Flutter plugin that you might find useful.
The Flutter inspector is a tool for
visualizing and exploring
the Flutter widget tree and helps you:
Understand existing layouts
Diagnose layout issues
Toggle display of the inspector using the
vertical button to the
right of the Android Studio window.
Flutter outline
The Flutter Outline displays the build method in visual form.
Note that this might be different than the widget tree for the
build method. Toggle display of the outline using the vertical
button to the right of the AS window. | https://docs.flutter.dev/testing/oem-debuggers/index.html |
86421835afff-4 | The rest of this guide shows how to set up your environment to debug OEM
code. As you’d expect, the process works differently for iOS and Android.
Once installed and AS is relaunched, this plugin helps you to become a
pro user by:
Showing the name and Windows/Linux/Mac shortcuts of any action you
invoke.
Allowing you to search and find available actions, settings, docs,
and so on.
Allowing you to toggle preferences, open up views, or run actions.
Allowing you to assign keyboard shortcuts (?? Can’t make this work on
Mac.)
For example, try this:
While focus is in the Edit pane, enter command-Shift-A (Mac) or
shift-control-A (Windows and Linux).
The plugin simultaneously brings up the Find panel and shows a hint for
performing this same operation on all three platforms.
Presentation assistant's Find panel | https://docs.flutter.dev/testing/oem-debuggers/index.html |
86421835afff-5 | Presentation assistant's Find panel
Presentation assistant's action hint for opening its Find panel on Mac, Windows and Linux
Enter attach to see the following:
After an update, you might enter Flutter or Dart to see if
new actions are available.
Hide the Presentation Assistant’s Find panel by using Escape.
Debugging with Android Gradle (Android)
In order to debug OEM Android code, you need an app that contains
OEM Android code. In this section, you’ll learn how to connect
two debuggers to your app: 1) the Dart debugger and,
2) the Android Gradle debugger.
Create a basic Flutter app.
Replace lib/main.dart with the following example code from the
url_launcher package:
Add the url_launcher dependency to the pubspec file,
and run flutter pub get:
name
flutter_app | https://docs.flutter.dev/testing/oem-debuggers/index.html |
86421835afff-6 | name
flutter_app
description
A new Flutter application.
version
1.0.0+1
dependencies
flutter
sdk
flutter
url_launcher
^3.0.3
cupertino_icons
^0.1.2
dev_dependencies
flutter_test
sdk
flutter | https://docs.flutter.dev/testing/oem-debuggers/index.html |
86421835afff-7 | flutter_test
sdk
flutter
Click the debug icon
()
to simultaneously bring up the Debug pane and launch the app.
Wait for the app to launch on the device, and for the debug pane to
indicate Connected.
(This can take a minute the first time but is faster for subsequent
launches.) The app contains two buttons: 1) Launch in browser
opens flutter.dev in your phone’s default browser and 2) Launch
in app opens flutter.dev within your app.
Click the Attach debugger to Android process button (
)
Tip:
If this button doesn’t appear in the Projects menu bar, make sure that
you are inside a Flutter project but not a Flutter plugin.
From the process dialog, you should see an entry for each connected device.
Select show all processes to display available processes for each
device. | https://docs.flutter.dev/testing/oem-debuggers/index.html |
86421835afff-8 | Choose the process you want to attach to. In this case, it’s the
com.google.clickcount
(or com.company.app_name)
process for the Motorola Moto G.
In the debug pane, you should now see a tab for Android Debugger.
In the project pane, expand
app_name > android > app > src > main >
java > io.flutter plugins
.
Double click GeneratedProjectRegistrant to open the
Java code in the edit pane.
Both the Dart and OEM debuggers are interacting with the same process.
User either, or both, to set breakpoints, examine stack, resume execution…
In other words, debug!
Debugging with Xcode (iOS)
In order to debug OEM iOS code, you need an app that contains OEM iOS code.
In this section, you’ll learn how to connect two debuggers to your app:
1) the Dart debugger and, 2) the Xcode debugger. | https://docs.flutter.dev/testing/oem-debuggers/index.html |
86421835afff-9 | [PENDING]
Resources
The following resources have more information on debugging Flutter,
iOS, and Android:
Flutter
Debugging Flutter apps
Flutter inspector, as well as the general
DevTools docs.
Performance profiling
Android
You can find the following debugging resources on
developer.android.com.
Debug your app
Android Debug Bridge (adb)
iOS
You can find the following debugging resources on
developer.apple.com.
Debugging
Instruments Help | https://docs.flutter.dev/testing/oem-debuggers/index.html |
21699c04a917-0 | Testing plugins
Types of plugin tests
Running tests
Dart unit tests
Integration tests
Native unit tests
What types of tests to add
All of the usual types of Flutter tests apply to
plugin packages as well, but because plugins contain
native code they often also require other kinds of tests
to test all of their functionality.
Note:
To learn how to test your plugin code, read on.
To learn how to avoid crashes from a plugin when
testing your Flutter app, check out
Plugins in Flutter tests.
Types of plugin tests
To see examples of each of these types of tests, you can
create a new plugin from the plugin template
and look in the indicated directories. | https://docs.flutter.dev/testing/testing-plugins/index.html |
21699c04a917-1 | Dart unit tests and widget tests.
These tests allow you to test the Dart portion of your plugin
just as you would test the Dart code of a non-plugin package.
However, the plugin’s native code won’t be loaded,
so any calls to platform channels need to be mocked in tests.
See the test directory for an example.
Dart integration tests.
Since integration tests run in the context of a
Flutter application (the example app),
they can test both the Dart and native code,
as well as the interaction between them.
They are also useful for unit testing web implementation
code that needs to run in a browser.
These are often the most important tests for a plugin.
However, Dart integration tests can’t interact with native UI,
such as native dialogs or the contents of platform views.
See the example/integration_test directory for an example. | https://docs.flutter.dev/testing/testing-plugins/index.html |
21699c04a917-2 | See the example/integration_test directory for an example.
Native unit tests.
Just as Dart unit tests can test the Dart portions
of a plugin in isolation, native unit tests can
test the native parts in isolation.
Each platform has its own native unit test system,
and the tests are written in the same native languages
as the code it is testing.
Native unit tests can be especially valuable
if you need to mock out APIs wrapped by your plugin code,
which isn’t possible in a Dart integration test.
You can set up and use any native test frameworks
you are familiar with for each platform,
but the following are already configured in the plugin template: | https://docs.flutter.dev/testing/testing-plugins/index.html |
21699c04a917-3 | Android:
JUnit tests can be found in android/src/test/.
iOS and macOS:
XCTest tests can be found in example/ios/RunnerTests/
and example/ios/RunnerTests/` respectively.
These are in the example directory,
not the top-level package directory,
because they are run via the example app’s project.
Linux and Windows:
GoogleTest tests can be found in linux/test/
and windows/test/, respectively.
Other types of tests, which aren’t currently pre-configured
in the template, are native UI tests.
Running your application under a native UI testing framework,
such as Espresso or XCUITest,
enables tests that interact with both native and Flutter UI elements,
so can be useful if your plugin can’t be tested without
native UI interactions.
Running tests
Dart unit tests | https://docs.flutter.dev/testing/testing-plugins/index.html |
21699c04a917-4 | Running tests
Dart unit tests
These can be run like any other Flutter unit tests,
either from your preferred Flutter IDE,
or using flutter test.
Integration tests
For information on running this type of test, check out the
integration test documentation.
The commands must be run in the example directory.
Native unit tests
For all platforms, you need to build the example
application at least once before running the unit tests,
to ensure that all of the platform-specific build
files have been created.
Android JUnit
If you have the example opened as an Android project
in Android Studio, you can run the unit tests using
the Android Studio test UI.
To run the tests from the command line,
use the following command in the example/android directory:
iOS and macOS XCTest
If you have the example app opened in Xcode,
you can run the unit tests using the Xcode Test UI. | https://docs.flutter.dev/testing/testing-plugins/index.html |
21699c04a917-5 | To run the tests from the command line,
use the following command in the example/ios (for iOS)
or example/macos (for macOS) directory:
test
workspace Runner.xcworkspace
scheme Runner
configuration Debug
For iOS tests, you might need to first open
Runner.xcworkspace in Xcode to configure code signing.
Linux GoogleTest
To run the tests from the command line,
use the following command in the example directory,
replacing “my_plugin” with your plugin project name:
If you built the example app in release mode rather than
debug, replace “debug” with “release”.
Windows GoogleTest
If you have the example app opened in Visual Studio,
you can run the unit tests using the Visual Studio test UI.
To run the tests from the command line,
use the following command in the example directory,
replacing “my_plugin” with your plugin project name: | https://docs.flutter.dev/testing/testing-plugins/index.html |
21699c04a917-6 | If you built the example app in release mode rather
than debug, replace “Debug” with “Release”.
What types of tests to add
The general advice for testing Flutter projects
applies to plugins as well.
Some extra considerations for plugin testing:
Since only integration tests can test the communication
between Dart and the native languages,
try to have at least one integration test of each
platform channel call.
If some flows can’t be tested using integration
tests—for example if they require interacting with
native UI or mocking device state—consider writing
“end to end” tests of the two halves using unit tests:
Native unit tests that set up the necessary mocks,
then call into the method channel entry point
with a synthesized call and validate the method response.
Dart unit tests that mock the platform channel,
then call the plugin’s public API and validate the results. | https://docs.flutter.dev/testing/testing-plugins/index.html |
c42feea03d72-0 | Terms of Service
The Flutter website (the “Website”) is hosted by Google. By using and / or
visiting the Website, you consent to be bound by Google’s general
Terms of Service and Privacy Policy.
The “Flutter” name and the Flutter logo
(the “Flutter Marks”) are trademarks owned by Google and are not included
within the assets licensed under the Creative Commons Attribution 4.0
International License. Google grants you a non-transferable,
non-exclusive, royalty-free limited license to use the Flutter Marks
subject to your compliance with the Flutter Brand Guidelines.
Except as set forth above, nothing herein grants or should be deemed
to grant to you any right, title or interest in or to the Flutter Marks. | https://docs.flutter.dev/tos/index.html |
c42feea03d72-1 | As noted above, Google owns the Flutter trademarks, but we license them
so they can be used by the developer community to support the Flutter
SDK, including through training materials and other community content.
At the same time, it’s important to make sure that people don’t
use the marks in ways that could cause confusion or otherwise misuse
the marks, so we have prepared brand guidelines that describe the
allowed uses of the marks. Our goal in protecting the Flutter trademarks
is to benefit the entire community by ensuring that the marks are only used
in ways that are consistent with Google’s mission to provide a free and open
source SDK. | https://docs.flutter.dev/tos/index.html |
991536205a30-0 | What’s new
Jan 25, 2023, Flutter Forward edition: 3.7 release
Aug 31, 2022, Flutter Vikings Edition: 3.3 release
May 11, 2022, Google I/O Edition: Flutter 3 release
Feb 3, 2022, Windows Support: 2.10 release
December 8, 2021: 2.8 release
September 8, 2021: 2.5 release
May 18, 2021, Google I/O Edition: 2.2 release
March 3, 2021, Flutter Engage Edition: 2.0 release
Oct 1, 2020: 1.22 release
Aug 5, 2020: 1.20 release | https://docs.flutter.dev/whats-new/index.html |
991536205a30-1 | Aug 5, 2020: 1.20 release
May 6, 2020, Work-From-Home Edition: 1.17 release
Dec 11, 2019, Flutter Interact Edition: 1.12 release
Sept 10, 2019: 1.9 release
July 9, 2019: 1.7 release
May 7, 2019, Google I/O Edition: 1.5 release
February 26, 2019: 1.2 release
November 5, 2018: new website
This page contains current and previous announcements of
what’s new on the Flutter website and blog.
For details about what’s new in the Flutter releases
see the release notes page. | https://docs.flutter.dev/whats-new/index.html |
991536205a30-2 | To stay on top of Flutter announcements,
including breaking changes,
join the flutter-announce Google group.
For Dart, you can join the Dart Announce Google group,
and review the Dart changelog.
Jan 25, 2023, Flutter Forward edition: 3.7 release
Flutter 3.7 is live! This release contains many updates
and improvements. This page lists the documentation changes,
but you can also check out the 3.7 blog post and the
3.7 release notes.
You might also check out What’s next for Flutter
and Introducing Dart 3 alpha.
Docs updated or added since the 3.3 release
You can now pass configuration
information to the engine in the initializeEngine
method. For more information, check out
Customizing web app initialization. | https://docs.flutter.dev/whats-new/index.html |
991536205a30-3 | Creating Flavors for Flutter
Learn how to create a flavor in Flutter
(also known as a build configuration in iOS).
Internationalization support has been
revamped and the
Internationalizing Flutter apps page
is updated.
The DevTools memory debugging tool has been
completely overhauled and the corresponding
page, Using the memory view, is rewritten.
This release includes numerous improvements to
Flutter’s support for custom fragment shaders.
For more information, see the new
Writing and using fragment shaders page.
Some security tools falsely report security
vulnerabilities in Flutter apps. The new
Security false positives page lists
the known false positives and why you can
ignore them.
You can now invoke a platform channel from any
isolate, including background isolates.
For more information, check out
Writing custom platform-specific code
and the Introducing isolate background channels
article on Medium. | https://docs.flutter.dev/whats-new/index.html |
991536205a30-4 | We’ve updated our Swift documentation.
New and updated pages include:
Flutter for SwiftUI developers - updated
Add a Flutter screen to an iOS app - updated for SwiftUI
Flutter concurrency for Swift developers - new
Learning Dart as a Swift developer on dart.dev - new
As of Xcode 14, Apple no longer supports bitcode.
Two of our pages, Adding an iOS clip target
and the Flutter FAQ,
are updated to reflect this fact.
For developers who enjoy living on the bleeding edge,
you might want to try Flutter’s future rendering
engine, Impeller. Because Impeller isn’t yet
ready for a stable release, you can find more
information on our Flutter GitHub wiki.
Codelabs and workshops
We have new codelabs since the last stable release: | https://docs.flutter.dev/whats-new/index.html |
991536205a30-5 | We have new codelabs since the last stable release:
Your first Flutter app
Learn about Flutter as you build an application that
generates cool-sounding names, such as “newstay”,
“lightstream”, “mainbrake”, or “graypine”.
The user can ask for the next name, favorite the current one,
and review the list of favorited names on a separate page.
The final app is responsive to different screen sizes.
(Note that this codelab replaces the previous “Write
your first Flutter codelab for mobile, part 1 and part 2.”)
Using FFI in a Flutter plugin
Dart’s FFI (foreign function interface) allows Flutter apps
to use of existing native libraries that expose a C API.
Dart supports FFI on Android, iOS, Windows, macOS, and Linux. | https://docs.flutter.dev/whats-new/index.html |
991536205a30-6 | Building a game with Flutter and Flame
Learn how to build a platformer game with Flutter and Flame!
In the Doodle Dash game, inspired by Doodle Jump,
you play as either Dash (the Flutter mascot),
or her best friend Sparky (the Firebase mascot),
and try to reach as high as possible by jumping on platforms.
Add a user authentication flow to a Flutter app using FirebaseUI
Learn how to add Firebase Authentication to your Flutter app
using the FlutterFire UI package. You’ll add both email/password
and Google Sign In authorization to a Flutter app. You’ll also learn
how to set up a Firebase project,
and use the FlutterFire CLI to initialize Firebase in your Flutter app. | https://docs.flutter.dev/whats-new/index.html |
991536205a30-7 | Local development for your Flutter apps using the Firebase Emulator Suite
Learn how to use the Firebase Emulator Suite with Flutter during local development,
including how to use email-password authentication with the Emulator Suite,
and how to read and write data to the Firestore emulator. Also, you’ll import
and export data from the emulators, to work with the same faked data each
time you return to development.
In addition, we’ve updated all of our existing
codelabs to support multiplatform.
The codelabs & workshops page is updated
to reflect the latest available codelabs.
Articles
We’ve published the following articles on the Flutter Medium
publication since the last stable release:
What’s next for Flutter
Adapting Wonderous to larger device formats
What’s new in Flutter 3.7
Announcing the Flutter News Toolkit
How it’s made: Holobooth | https://docs.flutter.dev/whats-new/index.html |
991536205a30-8 | How it’s made: Holobooth
Playful typography with Flutter
Material 3 for Flutter
Introducing background isolate channels
How can we improve the Flutter experience for desktop?
What we learned from the Flutter Q3 2022 survey
Supporting six platforms with two keyboards
Studying developer’s usage of IDEs for Flutter development
Aug 31, 2022, Flutter Vikings Edition: 3.3 release
Flutter 3.3 is live! For more information, see
What’s new in Flutter 3.3,
and Dart 2.18: Objective-C & Swift interop (free articles on Medium),
and the Flutter 3.3 release notes.
Docs updated or added since the 3.0 release | https://docs.flutter.dev/whats-new/index.html |
991536205a30-9 | Docs updated or added since the 3.0 release
The navigation and routing overview page has been
rewritten with more guidance on using Navigator
and Router together, named routes, and
using a routing package.
The URL strategies page has also been updated
to reflect a more streamlined API.
For apps not published to the Microsoft Store, you
can now set the app’s executable’s file and
product versions in the pubspec file.
For more information, see
Build and release a Windows desktop app.
If you are developing software for iOS 16 and higher,
you must enable Developer mode.
The macOS install page is updated
with this information.
As described in the 3.3 release notes,
you should catch all errors and exceptions
in your app by setting
the PlatformDispatcher.onError callback,
instead of using a custom Zone.
The Handling errors in Flutter
page has been updated with this advice. | https://docs.flutter.dev/whats-new/index.html |
991536205a30-10 | May 11, 2022, Google I/O Edition: Flutter 3 release
Flutter 3 is live!!! For more information, see
Introducing Flutter 3, What’s new in Flutter 3,
and Dart 2.17: Productivity and integration
(free articles on Medium),
and the Flutter 3 release notes.
Docs updated or added since the 2.10 release
We have launched the Casual Games Toolkit
to help you build games with Flutter.
Learn more on the Games page and the
Games doc page.
Are you struggling to level up as a Flutter
developer? We have created the Happy paths
project to help. Learn more on the
Happy paths page. | https://docs.flutter.dev/whats-new/index.html |
991536205a30-11 | Are you a web developer who would like more
control over your app’s launch process?
Check out the new page,
Customizing web app initialization,
which has been added to the newly updated
and collected web docs under
/development/platform-integration/web.
Flutter 3 supports Apple Silicon processors.
We’ve updated the macOS install page
to offer an Apple Silicon download button.
In Flutter 3, the macOS and Linux platforms
have reached stable, in addition to Windows.
You can now develop your app to run on any
or all of these platforms. As a result,
the Desktop (and related) pages are updated.
The Performance best practices page has
largely been rewritten and moved to be more visible.
The changes include additional advice on avoiding jank,
including how to minimize layout passes caused
by intrinsics, and techniques to minimize
calls to saveLayer(). | https://docs.flutter.dev/whats-new/index.html |
991536205a30-12 | Firebase’s Flutter docs have been overhauled.
Check out the newly updated
Flutter Firebase get started guide.
The dart.dev site has its own what’s new
page, but one new page of note is the guide,
Learning Dart as a JavaScript developer.
Stay tuned for similar articles on Swift and C#.
Codelabs and workshops
We have a new codelab since the last stable release:
Take your Flutter app from boring to beautiful
Learn how to use features in Material 3 to make your
more beautiful and more responsive.
Also, check out the workshops written by our GDEs
and available on the Flutter community blog.
Videos
Google I/O 2022 is over, but you can still check out
the Flutter-specific updates and talks from Google I/O
on the videos page. | https://docs.flutter.dev/whats-new/index.html |
991536205a30-13 | Feb 3, 2022, Windows Support: 2.10 release
Desktop support for Microsoft Windows
(a central feature of the 2.10 release) is live!
For more information, see
Announcing Flutter for Windows
and What’s new in Flutter 2.10,
free articles on Medium.
December 8, 2021: 2.8 release
Flutter 2.8 is live! For details, see
Announcing Flutter 2.8 and
What’s new in Flutter 2.8.
September 8, 2021: 2.5 release
Flutter 2.5 is live! For details, see
What’s new in Flutter 2.5.
We’ve made significant changes to flutter/website
repo to make it easier to use and maintain.
If you contribute to this repo, see the README file
for more information. | https://docs.flutter.dev/whats-new/index.html |
991536205a30-14 | Docs updated or added since the 2.2 release
A new page on Using Actions and Shortcuts.
Articles
We’ve published the following articles on the Flutter Medium
publication since the last stable release:
Raster thread performance optimization tips
Writing a good code sample
GSoC’21: Creating a desktop sample for Flutter
Flutter Hot Reload
What can we do to better improve Flutter?
Adding Flutter to your existing iOS and Android codebases
Google I/O Spotlight: Flutter in action at ByteDance
Improving Platform Channel Performance in Flutter
May 18, 2021, Google I/O Edition: 2.2 release | https://docs.flutter.dev/whats-new/index.html |
991536205a30-15 | Flutter 2.2 is live! For details, see
Announcing Flutter 2.2 and
What’s New in Flutter 2.2.
We continue migrating code on the website to use
null safety, but that work is not yet completed.
Docs updated or added since the 2.0 release
A new page on Building adaptive apps.
A new page describing how to use Google APIs
with Flutter.
A new landing page for Embedded Support for Flutter.
A new page on setting up and using Deferred components
on Android.
Significant updates to the DevTools Memory view page.
The desktop page is updated to reflect the progress
on desktop support, particularly the new support for
Windows UWP.
Codelabs
New codelabs since the last stable release:
Adding in-app purchases to your Flutter app | https://docs.flutter.dev/whats-new/index.html |
991536205a30-16 | Adding in-app purchases to your Flutter app
Build Voice Bots for Android with Dialogflow Essentials & Flutter
Get to know Firebase for Flutter
Workshops
For Google I/O 2021, we have added a new
Flutter/Dart learning tool that
is based on DartPad: Workshops!
These workshops are designed to be instructor led.
The instructor-led videos are available on the
Flutter and Firebase YouTube channels:
Building your first Flutter app
Firebase for Flutter
Flutter and Dialogflow voice bots
Inherited widgets
Null safety
Slivers
To see the event list of “all things Flutter” at I/O,
see the Google 2021 I/O Flutter page. | https://docs.flutter.dev/whats-new/index.html |
991536205a30-17 | You can author your own DartPad workshops!
If you are interested, check out the following resources:
DartPad Workshop Authoring Guide
DartPad Sharing Guide (using a Gist file)
Embedding DartPad in your web page
Articles
We’ve published the following articles on the Flutter Medium
publication since the last stable release:
How It’s Made: I/O Photo Booth
Which factors affected users’ decisions to adopt Flutter? - Q1 2021 user survey results
March 3, 2021, Flutter Engage Edition: 2.0 release
Flutter 2 is live!!! For more information, see
Announcing Flutter 2, What’s new in Flutter 2,
Flutter web support hits the stable milestone,
Announcing Dart 2.12,
and the Flutter 2 release notes. | https://docs.flutter.dev/whats-new/index.html |
991536205a30-18 | Docs updated or added since the 1.22 release
A new Who is Dash? page!
Information about monetizing your apps has been
collected in the new Flutter Ads landing page.
Added a new page explaining the Flutter Fix
feature and how to use it.
New and updated web pages, including:
Web support for Flutter
Configuring the URL strategy on the web
Web FAQ
The Desktop support for Flutter page is updated,
as well as other pages on the site that discuss
desktop support.
The DevTools docs have been updated. The
most significant updates are to the following page:
Flutter inspector
Added a page on how to implement deep linking
for mobile and web.
Updated the Creating responsive and adaptive apps
page.
Many pages (including all codelabs on flutter.dev)
and examples are updated to be null safe. | https://docs.flutter.dev/whats-new/index.html |
991536205a30-19 | Added two new add to app pages:
Using multiple Flutter instances
Adding a Flutter view to an Android app
Added a page on how to write integration tests using
the integration_test package.
Significant updates to the internationalization page.
New and updated performance pages, including:
Performance metrics
Performance faq
More thoughts about performance
Codelabs
Many of our codelabs have been updated to null safety.
We’ve also added a new codelab since the last stable release:
Adding AdMob banner and native inline ads to a Flutter app
For a complete list, see Flutter codelabs.
Articles
We’ve published the following articles on the Flutter Medium
publication since the last stable release:
Flutter performance updates in the first half of 2020 | https://docs.flutter.dev/whats-new/index.html |
991536205a30-20 | Flutter performance updates in the first half of 2020
Are you happy with Flutter? - Q4 2020 user survey results
Join us for #30DaysOfFlutter
Providing operating system compatibility on a large scale
Updates on Flutter Testing
Announcing Dart null safety beta
Deprecation Lifetime in Flutter
New ad formats for Flutter
Accessible expression with Material Icons and Flutter
Dart sound null safety: technical preview 2
Flutter on the web, slivers, and platform-specific issues: user survey results from Q3 2020
Testable Flutter and Cloud Firestore
Performance testing on the web
Oct 1, 2020: 1.22 release | https://docs.flutter.dev/whats-new/index.html |
991536205a30-21 | Oct 1, 2020: 1.22 release
Flutter 1.22 is live! For details, see
Announcing Flutter 1.22.
Docs updated or added to flutter.dev since the 1.20 release
Updated the Developing for iOS 14 page with
details about targeting iOS 14 with Flutter, including some
Add-to-App, deep linking, and notification considerations.
Added a page on how to add an iOS App Clip,
a new iOS 14 feature that supports running lightweight,
no-install apps under 10 MB.
Added a page that describes how to migrate your app to use the
new icon glyphs available in
CupertinoIcons. | https://docs.flutter.dev/whats-new/index.html |
991536205a30-22 | Added a page that describes the new implementation for
Platform Views and how to use them to host native Android views
and iOS views in your Flutter app platform-views.
This feature has enabled the google_maps_flutter
and webview_flutter plugins to be
updated to production-ready release 1.0.
Added a page that describes how to use the new
App Size tool in Dart DevTools.
Codelabs
We’ve added a new codelab since the last stable release:
Building Beautiful Transitions with Material Motion
for Flutter
Learn how to use the Material animations package to
add prebuilt transitions to a Material app called Reply.
For a complete list, see Flutter codelabs.
Articles
We’ve published the following articles on the Flutter Medium
publication since the last stable release:
Learning Flutter’s new navigation and routing
Integration testing with flutter_driver | https://docs.flutter.dev/whats-new/index.html |
991536205a30-23 | Integration testing with flutter_driver
Announcing Flutter Windows Alpha
Handling web gestures in Flutter
Supporting iOS 14 and Xcode 12 with Flutter
Learn testing with the new Flutter sample
Platform channel examples
Updates on Flutter and Firebase
Aug 5, 2020: 1.20 release
Flutter 1.20 is live! For details,
see Announcing Flutter 1.20.
Docs updated or added to flutter.dev
Flutter architectural overview, a deep dive into Flutter’s
architecture, was added to the site just a few days after the
1.20 release.
Reducing shader compilation jank on mobile is added to the
performance docs. | https://docs.flutter.dev/whats-new/index.html |
991536205a30-24 | Reducing shader compilation jank on mobile is added to the
performance docs.
Developing for iOS 14 beta outlines some issues you might
run into if developing for devices running iOS 14 beta.
New instructions for installing Flutter on Linux using
snapd.
Updated the Desktop support page to reflect that Linux
desktop apps (as well as macOS) are available as alpha.
Several new Flutter books have been published. The
Flutter books page is updated.
The codelabs landing page has been updated.
A deep dive into null safety has been added to dart.dev:
Understanding null safety
Codelabs
Flutter Day was held on 6/25/2020.
In preparation for the event,
we wrote new codelabs and updated existing codelabs.
New codelabs include:
Adding Admob Ads to a Flutter app | https://docs.flutter.dev/whats-new/index.html |
991536205a30-25 | Adding Admob Ads to a Flutter app
How to write a Flutter plugin
Multi-platform Firestore Flutter
Using a plugin with a Flutter web app
Write a Flutter desktop application
For a complete list, see Flutter codelabs.
Articles
We’ve published the following articles on the Flutter Medium
publication since the last stable release:
Announcing Adobe XD support for Flutter
What are the important & difficult tasks for Flutter
devs? - Q1 2020 survey results
Optimizing performance in Flutter web apps with tree
shaking and deferred loading
Flutter Package Ecosystem Update
Improving perceived performance with image placeholders,
precaching, and disabled navigation transitions
Two Months of #FlutterGoodNewsWednesday | https://docs.flutter.dev/whats-new/index.html |
991536205a30-26 | Two Months of #FlutterGoodNewsWednesday
Handling 404: Page not found error in Flutter
Flutter and Desktop apps
What’s new with the Slider widget?
New tools for Flutter developers, built in Flutter
Canonical enables Linux desktop app support with
Flutter
Enums with Extensions in Dart
Managing issues in a large-scale open source project
What we learned from the Flutter Q2 2020 survey
Building performant Flutter widgets
How to debug layout issues with the Flutter Inspector
Going deeper with Flutter’s web support
Flutter Performance Updates in 2019
May 6, 2020, Work-From-Home Edition: 1.17 release
Flutter 1.17 is live! | https://docs.flutter.dev/whats-new/index.html |
991536205a30-27 | Flutter 1.17 is live!
For more information, see Announcing Flutter 1.17.
Docs added and updated since the last announcement include:
Added a new page on Understanding constraints,
contributed by Marcelo Glasberg, a Flutter community member.
The animations landing page has been re-written.
This page now includes the animation decision tree
that helps you figure out which animation approach
is right for your needs. It also includes information
on the new package for pre-canned Material widget animations.
The hot reload page has been re-written. We
hope you find it to be clearer!
The Desktop page has been updated and now includes information
on setting up entitlements and using the App Sandbox on macOS. | https://docs.flutter.dev/whats-new/index.html |
991536205a30-28 | The plugin docs are updated to cover the new Android Plugin APIs
and also to describe Federated Plugins. Affected pages include:
Developing packages and plugins
Developing plugin packages
Supporting the new Android plugin APIs
Writing custom platform-specific code
Added an Obfuscating Dart code page.
(Moved from the wiki and updated as of 1.16.2.)
Added a page on using Xcode 11.4 and how to manually update
your project. The tooling, which automatically updates your
configuration when possible, may direct you to this page
if it detects that it’s needed.
Added a page on
Managing plugins and dependencies in add-to-app
when developing for Android.
Other newness: | https://docs.flutter.dev/whats-new/index.html |
991536205a30-29 | We’ve published a number of articles on the Flutter Medium
publication since the last stable release:
Custom implicit animations in Flutter…with TweenAnimationBuilder
Directional animations with build-in explicit animations
When should I use AnimatedBuilder or AnimatedWidget?
Improving Flutter with your opinion - Q4 2019 survey results
How to write a Flutter web plugin, Part 2
It’s Time: The Flutter Clock contest results
How to float an overlay widget over a (possibly transformed) UI widget
How to embed a Flutter application in a website using DartPad
Flutter web: Navigating URLs using named routes
How to choose which Flutter animation widget is right for you?
Announcing a free Flutter introductory course
Announcing CodePen support for Flutter | https://docs.flutter.dev/whats-new/index.html |
991536205a30-30 | Announcing CodePen support for Flutter
Animation deep dive
Flutter Spring 2020 update
Introducing Google Fonts for Flutter v 1.0.0!
Flutter web support updates
Modern Flutter plugin development | https://docs.flutter.dev/whats-new/index.html |
991536205a30-31 | Dec 11, 2019, Flutter Interact Edition: 1.12 release
Flutter 1.12 is live!
For more information, see
Flutter: the first UI platform designed for ambient computing,
Announcing Flutter 1.12: What a year! and
the Flutter 1.12.13 release notes.
Docs added and updated since the last announcement include:
To accompany an updated implementation of add-to-app,
we have added documentation on how to
add Flutter to an existing app for both iOS and Android.
If you own plugin code, we encourage you to update to the
new plugin APIs for Android. For more information, see
Migrating your plugin to the new Android APIs.
Web support has moved to the beta channel. For more information,
see Web support for Flutter and
Web support for Flutter goes beta on the Medium publication.
Also, the building a web app with Flutter page is updated. | https://docs.flutter.dev/whats-new/index.html |
991536205a30-32 | A new write your first Flutter app on the web codelab
is added to the Get started docs, and includes
instructions on setting breakpoints in DevTools!
We’ve introduced a program for recommending particular Dart and
Flutter plugins and packages. Learn more about the
Flutter Favorite program.
A new implicit animations codelab is available
featuring DartPad.
(To run it, you don’t need to download any software!)
Alpha support for MacOS (desktop) is now available in
release 1.13 on the master and dev channels.
For more information, see Desktop support for Flutter.
The iOS section of the app size page is updated to reflect
the inclusion of bitcode.
An alpha release of Flutter Layout Explorer, a new feature
(and part of the Flutter inspector) that allows you to
explore a visual representation of your layout is available.
For more information, see the Flutter Layout Explorer docs.
Other newness: | https://docs.flutter.dev/whats-new/index.html |
991536205a30-33 | Other newness:
A brand new version of Flutter Gallery. There’s a
link to the runnable sample in the side nav under
Samples & Tutorials.
Happy Fluttering!
Sept 10, 2019: 1.9 release
Flutter 1.9 is live!
For more information, see Flutter news from GDD China:
uniting Flutter on web and mobile, and introducing Flutter 1.9
and the 1.9.1 release notes.
For the 1.9 release, Flutter’s web support has been
merged (“unforked”) into the main repo.
Web support hasn’t reached beta, and is not ready
to be used in production.
Web and desktop support (which is also coming), will
impact the website, which was originally written
exclusively for developing Flutter mobile apps.
Some website updates are available now (and listed below),
but more will be coming. | https://docs.flutter.dev/whats-new/index.html |
991536205a30-34 | New and updated docs on the site include:
We’ve revamped the Showcase page.
The Flutter layout codelab has been rewritten and
uses the updated DartPad, the browser-based tool for
running Dart code. DartPad now supports Flutter!
Try it out and let us know what you think.
A new page on using the dart:ffi library
to bind your app to native code (a feature currently under
development).
The Performance view tool, which allows you to record
and profile a session from your Dart/Flutter application,
has been enabled in DevTools. For more information,
see the Performance view page.
A new page on
building a web application.
A new page on creating responsive apps in Flutter.
A new page on preparing a web app for release.
A new web FAQ.
The Flutter for web page is updated.
Other relevant docs: | https://docs.flutter.dev/whats-new/index.html |
991536205a30-35 | The Flutter for web page is updated.
Other relevant docs:
Error messages have been improved in SDK 1.9.
For more information, read
Improving Flutter’s Error Messages
on the Flutter Medium publication.
If you already have a web app that depends on the
flutter_web package, the following instructions tell
you how to migrate to the flutter package:
Upgrading from package:flutter_web to the Flutter SDK.
A new ToggleButtons widget, described in the API docs.
ToggleButtons demo
A new ColorFiltered widget, also described in the API docs.
ColorFiltered demo
New behavior for the SelectableText widget.
Happy Fluttering!
July 9, 2019: 1.7 release
Flutter 1.7 is live! | https://docs.flutter.dev/whats-new/index.html |
991536205a30-36 | Flutter 1.7 is live!
For more information, see Announcing Flutter 1.7
on the Flutter Medium Publication, and the
1.7.8 release notes.
New and updated docs on the site include:
The Preparing an Android app for release
page is updated to discuss how to build an Android release
using an app bundle, as well as how to create separate APK
files for both 32-bit and 64-bit devices.
The DevTools docs are migrated to flutter.dev.
If you haven’t tried this browser-based suite
of debugging, performance, memory, and inspection tools that
work with both Flutter and Dart apps and can be launched from
Android Studio/IntelliJ and VS Code, please check it out!
The Simple app state management page is updated.
The example code in the page now uses the 3.0
release of the Provider package. | https://docs.flutter.dev/whats-new/index.html |
991536205a30-37 | A new animation recipe, Animate a page route transition
has been added to the Cookbook.
The Debugging, Flutter’s build modes,
Performance best practices, and Performance profiling
pages are updated to reflect DevTools. A
Debugging apps programmatically page has also been added.
The Flutter 1.7 release includes the new RangeSlider
component, which allows the user to select both the upper and lower
endpoints in a range of values. For information about this
component and how to customize it, see
Material RangeSlider in Flutter.
May 7, 2019, Google I/O Edition: 1.5 release
Flutter 1.5 is live!
For more information on updates, see the 1.5.4 release notes
or download the release.
We are updating DartPad to work with Flutter. Try our new
Basic Flutter layout codelab and tell us what you think! | https://docs.flutter.dev/whats-new/index.html |
991536205a30-38 | February 26, 2019: 1.2 release
Flutter released version 1.2 at Mobile World Congress
(MWC) in Barcelona. For more information, see the
1.2.1 release notes or download the release.
In addition, here are some recent new and updated docs:
We’ve updated our state management advice.
New pages include an introduction,
thinking declaratively, ephemeral vs app state,
simple app state management, and
different state management options.
Documenting state management is a tricky thing, as there is no
one-size-fits-all approach. We’d love your feedback on these new docs!
A new page on Performance best practices. | https://docs.flutter.dev/whats-new/index.html |
991536205a30-39 | A new page on Performance best practices.
Also at MWC, we announced a preview version of the new Dart DevTools
for profiling and debugging Dart and Flutter apps.
You can find the docs on the DevTools wiki
(Note: since moved to this site.)
In particular, check out the DevTool’s widget inspector for
debugging your UI, or the timeline view for profiling your Flutter
application. Try them out and let us know what you think!
An update to the Performance profiling
page that incorporates the new Dart DevTools UI.
Updates to the Android Studio/IntelliJ
and VS Code pages incorporating info from
the new Dart DevTools UI.
If you have questions or comments about any of these docs,
file an issue.
November 5, 2018: new website
Welcome to the revamped Flutter website! | https://docs.flutter.dev/whats-new/index.html |
991536205a30-40 | Welcome to the revamped Flutter website!
We’ve spent the last few months redesigning the website and how its
information is organized. We hope you can more easily find the docs
you are looking for. Some of the changes to the website include:
Revised front page
Revised showcase page
Revised community page
Revised navigation in the left side bar
Table of contents on the right side of most pages
Some of the new content includes:
Deep dive on Flutter internals, Inside Flutter
Technical videos
State management
Background Dart processes
Flutter’s build modes
If you have questions or comments about the revamped site,
file an issue. | https://docs.flutter.dev/whats-new/index.html |