Skip to main content

Posts

Showing posts from 2017

Flutter plugin v20 now available for Android Studio and IntelliJ

The M20 release of the Flutter plugin is now available! Fixes and improvements include:
improved the "Open with Xcode..." logic to work better for plugin projectsimproved flutter run console filteringimprovements to unit test running supportbug fixes to project creation in order to properly respect custom creation options (such as target language)and, bug fixes to issues encountered when deleting projects For existing users, Android Studio / IntelliJ should prompt you to update. If not, select 'Check for updates...' from the main menu. New users can install the plugin by selecting ‘Preferences’ > ‘Plugins’ and searching for ‘Flutter’ (or, see our install instructions).

Also available is the new package site, pub.dartlang.org, which now makes it easier to find Dart packages for use with Flutter.

Dart Language and Library Newsletters

Unless you're a member of the Dart misc group, you may be missing Florian Loitsch's weekly newsletters, which started in July. They live in the SDK repo (docs/newsletter), but Florian also posts them in the misc group. These newsletters cover the Dart language and some of the core libraries. Read them to learn about existing features ("Did you know"), planned changes, and how the Dart team considers and implements changes. For example: The July 28 newsletter (the first) starts with some 1.24 language changes that you might have missed: function types and changes to void. It also talks about the unified front end, and what that means for language changes. Finally, the letter lists features in active development, such as zones that work well with strong mode, void as a type, and changes to the core libraries.The September 29 newsletter covers 1.x JSON encoding, and plans for fixed-size integers.The October 13 newsletter covers 1.x double.toString methods and planned …

Flutter IntelliJ plugin v19: Fit and Finish

IntelliJ EAP support This month’s release now supports the public preview release of Intellij 2017.3. With this release, you’ll get a new version of the Dart plugin. That release includes features to help you better navigate and understand large build() methods, including things like showing synthetic text ‘closing labels’ at the end of nested constructors.
Android Studio support improvements We’ve continued to work on our Android Studio integration (first available in the last month’s release). The fixes and improvements here include: fixes to the language selector in the project wizard fixes to the label on the project location directory picker showing when a valid path is entered in the SDK field of the project wizard displaying a warning when installing the plugin into canary builds of Android Studio 3.1 minor UI tweaks, like using consistent punctuation Fit and Finish We’ve also polished the plugin generally, and closed out many issues in: the hot reload integration and r…

You are invited to DartConf Los Angeles!

Tickets (for free) are available for DartConf Los Angeles on January 23 & 24th! In addition to hearing about Dart 2.0, you might also enjoy:Access to Dart, Flutter, and AngularDart engineers via office hours and unconference rooms.In-depth talks about Dart, Flutter, and AngularDart, including how the latter two overlap.Practical guides for Dart, Flutter, and AngularDart developers.Insight into what the teams are working on and how it will affect your projects. You might also enjoy the average high temperatures in Los Angeles for January (68°F / 20°C). Learn more and sign up at events.dartlang.org.We hope to see you there!

Flutter IntelliJ plugin v18: Android Studio support

Android Studio supportYou can now install the Flutter plugin into Android Studio, and create, edit, and run your Flutter apps there. The plugin requires at least Android Studio 3.0 (currently at Android Studio 3.0 Preview beta 7). As this is the first Flutter plugin release to support Android Studio it should be considered beta; your feedback will help us improve the integration.


Improved support for developing and consuming Flutter pluginsFor this release we worked on improving the support for developing and consuming Flutter plugins. In addition to minor fixes and workflow improvements, we show referenced Flutter plugins in the ‘External Libraries’ part of the project view. From here, it’s easy to dig into the native iOS and Android implementations of a plugin, if desired.

Reload on save is now the default behaviorThe ‘hot reload on save’ feature is now enabled by default. When running an app, hitting save or pressing the save keyboard shortcut will trigger a hot reload. Thanks for yo…

Dart 2.0 pre-releases: What they mean to you

If you publish Dart packages or like to use early releases of the Dart SDK, the next few months are going to be interesting, as apps and packages adapt to the changes required by Dart 2.0. To make the process smoother, the pub tool that’s in Dart 2.0 pre-releases allows developers to download (and attempt to use) packages that don’t explicitly support Dart 2.0. The upshot: Use a stable Dart SDK if you need reliability. Use a pre-release Dart 2.0 SDK if you’d like to test published packages with Dart 2.0. Report any issues you find to the package maintainer. If you publish packages, be careful about SDK constraints, and expect feedback from developers trying your packages with Dart 2.0. The Dart 2.0 update page has all the details, but here’s an overview of what to expect, based on your development environment and the kind of code you write. If you use Flutter: In the short term, your Flutter code isn’t affected. When Flutter updates its Dart SDK to a Dart 2.0 pre-release, the Flutter…

AngularDart 4

AngularDart v4 is now available. We've been busy since the release angular2 v3.1.0 in May. Not only did we "drop the 2", but we also improved the compiler and tightened up the framework to give you smaller code, we updated the package structure to improve usability, and we added several new features. Check out the updated documentation to get started.
Just angular Upgrading to v4 will require more than updating your version constraint. The package has changed names (back) to angular – dropping the 2. You'll need to update your pubspec.yaml and the corresponding imports in your code. In most instances, find-and-replace should do the trick. Going forward, the package will be called package:angular. We'll just update the version number.
Smaller code The updated compiler in 4.0 allows type-based optimizations that not only improve runtime performance but generate better code because we are able to strongly type templates. A big result of the update is that many ap…

Flutter IntelliJ plugin v17.0: Hot reload on save and improved project wizard

Hot reload on save
By request, we now support doing a hot reload on file save. On an explicit save (cmd-s / ctrl-s or File > Save All), if there’s an app currently running we will try to reload changes into that app. This integrates well with how IntelliJ’s save action works — the default behavior of the action maps to a save-all command.

If there are analysis errors on save, instead of reloading we will highlight errors in the analysis view.

This behavior is off by default and can be turned on in Settings > Languages & Frameworks > Flutter. Feedback on this feature is much appreciated and will help us make additional improvements to the workflow. In particular, should we enable this feature by default?
Improved project wizardWe’ve updated the new project wizard! You can now choose which type of Flutter project to create: an app, a plugin project – to expose native services, or a package – to create a reusable Dart library. In addition, you can choose between generating a project…

Getting your apps ready for Dart 2.0

One of the most important features for Dart 2.0, strong mode, has been available for several releases. Migrate to strong mode now to take advantage of the new sound type system that finds errors at compile time (rather than letting your users discover them). You may even find bugs that have been lurking in your code. If you are using Flutter, it already uses strong mode, so you have met this requirement. Strong mode is the primary breaking change for 2.0, but there are likely to be other updates. For more information, see Dart 2.0 Updates.

Flutter IntelliJ plugin v16.0: Testing and app launching!

New testing supportWe’ve added the ability to run individual Flutter tests via actions in the editor’s gutter:

And now support running Flutter’s widget tests; see https://flutter.io/testing/#widget-testing.
Project structureWe re-worked how we define Flutter project and module types in IntelliJ. This addresses a few outstanding issues and will let us more easily go into more IntelliJ based products in the future. The next time you open an existing project with the new version of the plugin, you’ll see a one-time ‘module type updated’ message:

Launching improvementsThis release sports several improvements to app launching: Launch your app in profile and release modes (available via the ‘Run’ menu) Start Android emulators from the device dropdown; this requires the Android AVDs to have been already created in something like Android Studio Tweaks to when the run and reload buttons are enabled

For more detailed info on the version 16.0 release, see our project plan, or the

Announcing DartConf

We’re aflutter to announce the official Dart conference in Los Angeles on January 23-24, 2018. The event will be even bigger and
better than last year, with exciting talks about Dart 2.0, Flutter, Dart Dev Compiler, AngularDart, and much more.

UPDATE: Please learn more and register here.


We’re moving the annual conference from October to January for two reasons:
We want our speakers to be available for the other conferences that are happening in the Fall. Each year, September to November is full of events where the team can reach developers unaware of the awesomeness of all things Dart.Likewise, we don’t want you to have to choose between DartConf and other great events. Lots of new things are coming to Dart in the new year.Place: Google Los Angeles
Time: January 23-24, 2018
Pre-registration: [CLICK HERE]

The event will be live-streamed and sessions will be recorded. Ask questions at dartconf-questions@googlegroups.com.


Flutter IntelliJ plugin version 15.0: Improved project creation and support for flutter test

Flutter test support!
We now support running and debugging ‘flutter test’ tests! Right click on your Flutter tests in the test/ directory, and choose the ‘Run’ or ‘Debug’ option:



The results are displayed in the standard IntelliJ test runner. The support for this just recently landed in Flutter’s alpha channel, so you don’t see support for it in IntelliJ, you may want to run ‘flutter upgrade’. Happy testing!



Improved project creationWhen creating a new Flutter project, you now have the option of installing the Flutter SDK from the new project wizard. This will help new users get started – they can create their first Flutter project without having to make a detour to the command line. In addition, we’ve improved the error reporting on project creation failures.



Reload feedback improvementsBased on user feedback, we’ve made some improvements to the UI for hot reload. When clicking the hot reload button (or using the reload key binding), we disable the hot reload button during the course o…

A stronger Dart for everyone

We are constantly asking ourselves:
How do we make developers even more productive when writing Dart apps? We believe that a critical part of the answer to this question is to make strongmode – a sound static type system for Dart – the standard for all Dart developers.

Teams that use Dart to build apps like Soundtrap, AdWords, AdSense, and Greentea say they really enjoy using strong mode features, such as early error detection. In fact, teams that have switched completely to strong mode cite not only early error detection but also better code readability and maintainability as major benefits. We hear this both from small teams and Рeven more so Рfrom large teams with hundreds of developers writing and maintaining millions of lines of Dart code. As Björn Sperber from Soundtrap says,
Strong mode and the smooth integration with IntelliJ is a joy to use and a huge improvement. If you’ve tried out Flutter, you’ve already used strong mode checks from the Dart analyzer.

Given the benefits …

Unboxing Packages: A Requiem for scheduled_test

Long long ago in the dawning days of Dart, when Futures were new and Streams unknown, Bob saw the need for a package manager to bring the people together. Together he and I spun formless bits into code and wove that code into pub, which even today carries code into the eager hands of Dartisans. In those olden days, we had no modern marvels such as the twins async and await, and our tests grew heavy and graceless under the weight of their chain()s1.So it was that I came up with an idea for a new way of writing tests. Instead of gluing the steps together with the cumbersome Future API, each step would register an asynchronous callback in a queue. Once all the steps were queued up, the library would run them in order. All the API boilerplate would be hidden away from the user, and the tests would look nice and clean. After honing this technique on pub’s tests, I brought it out into its own package, which I called scheduled_test.If this whole idea of queuing up tasks and running them late…

Dart 1.24: Faster edit-refresh cycle on the web & new function type syntax

Dart 1.24 is now available. It includes the Dart Development Compiler and supports a new generic function type syntax. Get it now!


Figure 1: DDC debugging in Chrome.

Some notable changes in this release:
pub serve now has support for the Dart Development Compiler. Unlike dart2js, this new compiler is modular, which allows pub to do incremental re-builds for pub serve.In practice what that means is you can edit your Dart files, refresh in Chrome (or other supported browsers), and see your edits almost immediately. This is because pub is only recompiling your package, not all packages that you depend on.There is one caveat with the new compiler, which is that your package and your dependencies must all be strong mode clean.You can also use the new compiler to run your tests in Chrome much more quickly than you can with dart2js.Read more in the changelog.You can now publish packages that depend on the Flutter SDK to pub. Moreover, pub.dartlang.org has started tagging Flutter plugins with …

What to expect at Google I/O 2017

Google I/O is happening in Mountain View this week. Here’s what you shouldn't miss if you're coming, or if you're following I/O from home.

Figure 1: One of the Flutter apps that will be live-coded on stage. You will also be able to build it in one of the codelabs.
Session: Prototyping to Production: Bridging the Gap with a Common Tool by Fiona Yeung and David YangFriday, 8:30am PDTDesign and engineering collaboration is difficult but vital for iterative user-centered product development. Join us (a designer and UI developer) as we use the Flutter UI framework to evolve a UI concept from prototype to production code. You'll leave this talk with a deeper understanding of how to bridge the gap between designers and UI developers through a prototyping-centric workflow, and why using a single framework between designers and developers helps your team work more efficiently.
Session: Single Codebase, Two Apps with Flutter and Firebase by Emily Shack and Emily FortunaFriday, 10:…

AngularDart 3.0: Easy upgrade, better performance

AngularDart 3.0 is now available. It brings better performance and smaller generated code, while also making you more productive.


Version 3.0 is an evolution: although it has some breaking changes (detailed below), it is a smooth upgrade due to minimal public API adjustments. Most of the progress is under the hood—in code quality, stability, generated code size, performance, and developer experience.

Code quality:
2731 instances of making the framework code more type safe (using sound Dart).The AngularDart framework code size is down by 12%.Many additional style updates to the codebase:Changed to use idiomatic <T> for generic methods.Removed NgZoneImpl, all the code exists in NgZone now.Stability:
Many CSS encapsulation fixes due to update with csslib package.Fixed bugs with IE11.

Performance:
For the Mail sample app, we see 30% faster time-to-interactive (currently 3812 ms on a simulated 3G connection, measured via Lighthouse).Our large app benchmark shows 2x faster render times of…

Dart 1.23: Better strong mode support

Dart 1.23 is now available. It introduces support for overriding fields in strong mode and a lot of other improvements. Get it now!

Figure 1: Overriding fields in strong mode
We have been spending a lot of our time on our unified front-end (explained by Vyacheslav Egorov in this short talk from the Dart Developer Summit). We're also doing a lot of work to support our critical customers (for example, Flutter gets better Windows support with this release) and solidifying strong mode.

Some notable changes in this release:
Overriding fields is now supported in strong mode. You don’t need to tag them with @virtual anymore.Strong mode inference error messages are more helpful. Strong mode now prefers the expected type to infer generic types, functions, and methods.The UriData.parse method now normalizes and validates its input better.Importing dart:io is now allowed in the browser, as a stopgap measure to make it easier to write libraries that share code between platforms (like package ht…

Dart, Typescript and official languages at Google

Following Brad Green’s keynote at ng-conf 2017 that seemed to indicate that Typescript is now an official language at Google, there were many questions about the status of Dart at Google.

We would like to clarify that both Dart and Typescript are in the same category. They both are  allowed to be used for client side development. They are, however, not in the same category as more established languages like Javascript/Closure and Java — those have both more lines of code and more tooling.

Dart has been used for unrestricted client development at Google now for 4+ years. Dart and AngularDart are used by large products such as AdWords, AdSense and Shopping, and by critical internal tools such as Google CRM. In addition, the Flutter cross-platform mobile app framework uses Dart and is used by multiple teams at Google including Google CRM and Shopping Express. The Google codebase contains many millions of lines of Dart code.

Typescript has become allowed for unrestricted client developm…

Making a Dart web app offline-capable: 3 lines of code

Another article about Dart from Istvan Soos is about Progressive Web Apps, published today. — Filip Hracek


Have you ever tried to load a web application (maybe a game or a measurement converter) and couldn’t use it because the network was down? That’s an awful experience, but luckily we have the technology to make such apps available for our users.

For most apps and games, this can be done with 3 lines of Dart code and 1 command in the terminal. In this short article I’ll guide you through the steps, and make sure that you can always play Pop, Pop, Win!

Pop, Pop, Win! (code) — a Minesweeper implementation in Dart.
Service workersA service worker is a JavaScript file that runs in the background. It can control the web page or the site it is associated with, intercepting and modifying navigation and resource requests, and caching resources in a very granular fashion.

It is a non-intrusive web technology: service workers can improve the user experience if the browser supports them, but the…

From GWT to AngularDart: a case study with source code

Lots of interesting articles about Dart have been cropping up on Medium.com lately. We've decided to cross post them here so that followers of this blog won't miss out on them. We'll start by Istvan Soos's GWT-to-Dart case study, published on Friday. — Filip Hracek

Earlier this year I was asked if there’s a good way to compare developing web UIs in Google Web Toolkit (GWT) vs. Dart, specifically AngularDart. Having worked with both GWT and Dart, I had a good idea of the differences, but as I thought more, I started to wonder how hard it would be to migrate a GWT application to AngularDart. This article describes what I’ve found while doing just that.

The GWT Mail Sample was an ideal place to start: it’s much more than a trivial example, with diverse features and complex UI interactions, yet it’s still manageable in size.

If you’re in a hurry, take a look at the working demo and the source code, or scroll to the bottom for the conclusions.

Screenshot of the demo.
The metho…