Dartosphere Aggregate

01 Aug 2017 | - Source

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.

31 Jul 2017 | - Source

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

New testing support

We’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 structure

We 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:

Screen Shot 2017-07-26 at 11.09.56 AM.png

Launching improvements

This 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

Screen Shot 2017-07-27 at 12.06.12 PM.png

For more detailed info on the version 16.0 release, see our project plan, or the changelog. Thanks!
22 Jul 2017 | - Source

Diving Into Angular 4 Dart Alpha 1

Angular Dart 4 Alpha was recently released and I was keen to try it out. There's quite a few changes as it becomes increasingly more Dart-ified and broken away from its Typescript heritage.

My hobby project NP8080, as ever, is my guinea pig for such upgrades. It was almost entirely painless - we can forgive the one time rename of the package from Angular2 to plain Angular! Building is slightly slower/heavier (there's a lot going on) but this is being worked on.

The standout feature for me is the component inheritance of attributes such as @input. There's a lot of components in my app that have common functions (dialogs mainly) but being unable to have a hierarchy to share stuff meant that... well things got a bit messy and copy-pastey!

With the new release I spent a happy time creating my base classes and shifting the functionality around. The joy of deleting hundreds of lines of code!

So the class structure ended up something like this:

Base Component Class Base Component Class
|| ||
Editor Component Class Another GUI Control Class
1 Particular Dialog Class

Even better was the Dependency Injection, the base classes could have services injected into them from the derived classed and they could still be marked final too. Very nice! Slight downside is the declarations:

TextProcessingService newTextProcessingService,
TextareaDomService newTextareaDomService,
ThemeService newThemeService,
EventBusService newEventBusService)
: super(newTextProcessingService, newTextareaDomService, newThemeService,
newEventBusService) {

It's a bit cluttering annoying to declare a variable like newTextProcessingService that gets passed immediately to the super call and never referenced again. I wonder if the following would be a possible language change? Seems a lot cleaner and clearer to me and should cover most cases.

GenerateDialogComponent() : super(textProcessingService,
eventBusService) {

Anyway, going forward creating a new dialog or control should be half the work. Sounds good! Look forward to the next Alpha/Beta.

18 Jul 2017 | Filip Hráček

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.

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.

29 Jun 2017 | Filip Hráček

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 creation

When 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 improvements

Based 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 of the reload. In addition, we clear the console text at the start of a reload. These changes should help awareness of when a reload is in progress, and users will be able to better associate any error messages in the console with the most recent reload.

Miscellaneous fixes and improvements

  • Added a new action to allow you to open your iOS sources in Xcode
  • Cleaned up and re-organized the Flutter view toolbar
  • Improved inspections and validations for the Flutter SDK configuration in IntelliJ
26 Jun 2017 | - Source

Dart SDK and Dartium 1.24.2 Chocolatey Packages for Windows

Chocolatey is a package manager for Windows similar to Linux's apt-get, based on Microsoft's Nuget tool and Powershell scripting language. It works from the command-line and from a WPF GUI interface.

You can install unmoderated versions by specifiying the install version during installation.
Chocolatey has also been updated with versions 1.24.2
Command line installation:
choco uninstall dart-sdk

choco install -y dart-sdk -version 1.24.2
To verify you have the right version on your path.
dart --version
Dart VM version: 1.24.2 (Thu Jun 22 08:55:56 2017) on "windows_x64"

Command line installation:
choco uninstall dartium

choco install -y dartium -version 1.24.2
26 Jun 2017 | Anders Thorhauge Sandholm

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 strong mode – 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 of strong mode, and the large number of users already using it, we have decided to make strong mode the standard type system for Dart. This means that we will initiate a move to 2.0 in three phases: 1) strong mode is opt in, 2) strong mode is the default, and 3) strong mode is the only mode. We are making sure that Dart users have a smooth transition to the new type system, as explained in more detail below.

Moving to strong mode also enables the use of the new Dart development compiler (dartdevc, also known as DDC) instead of Dartium for web app development. With dartdevc you get faster developer cycles and can use any recent version of Chrome – unlocking among other things the use of bleeding edge browser features. Once the developer experience with dartdevc matches that of Dartium, we’ll stop maintaining Dartium.

You should continue to use dart2js to compile your final app. Where dartdevc is optimized for fast refreshes and easy debugging, dart2js is optimized for small generated code size and fast runtime of web apps.

As mentioned above, to help prepare for the transition to strong mode, we’re moving to 2.0 in three phases: In the current phase (phase 1) you can opt in to strong mode and dartdevc. Phase 2 will make strong mode the default, but you'll be able to opt out. Finally, phase 3 will make strong mode the only type system for Dart, and eventually we’ll remove Dartium.

We believe these changes will help you and your team be more productive when writing Dart apps. If you’d like to try out strong mode and dartdevc with your web apps, check out the Dart 1.24 announcement and follow the instructions in the Tool Changes section of the changelog. To use strong mode when building for mobile, check out flutter.io.

As always, we’d love to hear about your experiences with Dart and strong mode – especially if you encounter issues when transitioning to dartdevc and our new type system.

17 Jun 2017 | - Source

A Multiplicity of Singleton Services

Angular Services are singletons right? Google it and you will get plenty of pages saying they are. Well sometimes they are and sometimes they are not!

I was working on a service that didn't seem to be working. To debug, I put a print statement in the constructor and I received 2 messages. So what's happening? Turns out to be down to Providers

Suppose you have a component and you want to use a service, you may have declared it in each component like this:

providers: const [TextProcessingService]

This actually creates a new instance before injecting it into your component.

So say we only want one instance ever? How do we do it? First step, delete that Providers declaration. Next declare at the bootstrap level:

AppComponent, [TextProcessingService]

Hope this blog post clears up confusion for anyone else. It is actually quite a powerful feature, allowing you to keep services and components totally separate.

15 Jun 2017 | - Source

Dart SDK and Dartium 1.24.1 Chocolatey Packages for Windows

Chocolatey is a package manager for Windows similar to Linux's apt-get, based on Microsoft's Nuget tool and Powershell scripting language. It works from the command-line and from a WPF GUI interface.

You can install unmoderated versions by specifiying the install version during installation.
Chocolatey has also been updated with versions 1.24.1
Command line installation:
choco uninstall dart-sdk

choco install -y dart-sdk -version 1.24.1
To verify you have the right version on your path.
dart --version
Dart VM version: 1.24.1 (Wed Jun 14 07:53:19 2017) on "windows_x64"

Command line installation:
choco uninstall dartium

choco install -y dartium -version 1.24.1