mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
I really like how patterns can be used for variable assignment and avoiding duplicated logic. (related: #150942) ```dart // before final GestureRecognizer? recognizer = info.recognizer; if (recognizer is TapGestureRecognizer) { if (recognizer.onTap != null) { configuration.onTap = recognizer.onTap; configuration.isLink = true; } } else if (recognizer is DoubleTapGestureRecognizer) { if (recognizer.onDoubleTap != null) { configuration.onTap = recognizer.onDoubleTap; configuration.isLink = true; } } // after switch (info.recognizer) { case TapGestureRecognizer(:final VoidCallback? onTap): case DoubleTapGestureRecognizer(onDoubleTap: final VoidCallback? onTap): if (onTap != null) { configuration.onTap = onTap; configuration.isLink = true; } } ```
Flutter
Flutter is a new way to build high-performance, cross-platform mobile, web, and desktop apps. Flutter is optimized for today's — and tomorrow's — mobile and desktop devices. We are focused on low-latency input and high frame rates on all platforms.
See the getting started guide for information about using Flutter.