Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Dart 2.17 - What's New

Dart 2.17 - What's New

New features of Dart Language version 2.17 including new language features: enums with member support, improved parameter forwarding to super classes, and more flexibility for named parameters.

Danvick Miller

June 25, 2022
Tweet

More Decks by Danvick Miller

Other Decks in Programming

Transcript

  1. Intro š Theme: productivity and platform portability š New language

    features for improved productivity š Productivity tools š Broadening platform integration and support
  2. New language features for productivity š Enhanced enums with members

    š Super initializers š Named arguments anywhere
  3. Enhanced enums with members š Enums represent a discrete set

    of states. - enum Grade { a, b, c, d, e} š Pre 2.17, extensions could be used to add methods š When using extensions you MUST keep them in sync with the enum š Enum members can be: š Fields holding state š Constructors that set that state š Methods with functionality š Override existing members.
  4. Enum with extensions – Old way “Talk is cheap. Show

    me the code.” ― Linus Torvalds
  5. Super initializers š Inheritance hierarchy – pass some constructor parameters

    to the constructor of the superclass š Old way – leads to a lot of boilerplate code 1. List each parameter in child constructor 2. Invoke the super constructor – passing parameters to it
  6. Productivity tools š Upgrades to package:lints – 10 new Dart

    rules, 2 new Flutter rules š Easier to debug Secure Sockets - TCP sockets secured with TLS and SSL. š Added rich samples code to core library API documentation š Removed deprecated code in dart:io – run dart fix š Deprecated CLI tool like pub – use dart pub or flutter pub š Removed deprecated CLI tool dartdoc – use dart doc
  7. Broadening platform integration & support š Added Dart FFI plugin

    template - flutter create --template=plugin_ffi hello š FFI now supports ABI-specific data types – e.g. Long for both 32-bit and 64-bit architectures š Improved cleanup code in both native and Dart code in Dart FFI š Support for signing executables - enable deployment on Windows and macOS š Added support for RISC-V instruction set
  8. Danvick Miller @danvickmiller github.com/danvick About Me • CTO - Infinitysoft

    • Organizer - Flutter (Devs) Kenya • Organizer - Droidcon Kenya (DroidconKe) • Contributions - Packages • flutter_form_builder • form_builder_validators • flutter_chips_input