Repository: flutter/flutter
File: packages/flutter/lib/src/material/drawer.dart (Dart)

Code before:
              (DrawerAlignment.end, TextDirection.rtl) => MediaQuery.paddingOf(context).left,
              (DrawerAlignment.end, TextDirection.ltr) => MediaQuery.paddingOf(context).right,
            };

    if (_controller.isDismissed) {
      if (widget.enableOpenDragGesture && !isDesktop) {
        return Align(
          alignment: _drawerOuterAlignment,
          child: GestureDetector(
            key: _gestureDetectorKey,
            onHorizontalDragUpdate: _move,
            onHorizontalDragEnd: _settle,
            behavior: HitTestBehavior.translucent,
            excludeFromSemantics: true,
            dragStartBehavior: widget.dragStartBehavior,
            child: LimitedBox(
              maxHeight: 0.0,
              child: SizedBox(width: dragAreaWidth, height: double.infinity),
            ),
          ),
        );
      } else {
        return const SizedBox.shrink();
      }
    } else {
      final platformHasBackButton = defaultTargetPlatform == TargetPlatform.android;

      final Color scrimColor =
          widget.scrimColor ?? DrawerTheme.of(context).scrimColor ?? Colors.black54;
      final Color effectiveScrimColor = scrimColor.withValues(
        alpha: scrimColor.a * _controller.value,
      );
      final Widget drawerScrim = ColoredBox(
        color: effectiveScrimColor,
        child: const LimitedBox(maxWidth: 0.0, maxHeight: 0.0, child: SizedBox.expand()),
      );

      final Widget child = _DrawerControllerScope(
        controller: widget,
        child: RepaintBoundary(
          child: Stack(
            children: <Widget>[
              BlockSemantics(
                child: ExcludeSemantics(
                  // On Android, the back button is used to dismiss a modal.
                  excluding: platformHasBackButton,
                  child: GestureDetector(
                    onTap: widget.drawerBarrierDismissible ? close : null,
                    child: Semantics(
                      label: MaterialLocalizations.of(context).modalBarrierDismissLabel,
                      child: drawerScrim,

Review comment (suggestion):
Same as above: `switch` is better for enum for exhaustiveness check and we should not throw it away. Although you can change it to a switch expression, which can be more "modern".

Code after:
              (DrawerAlignment.end, TextDirection.rtl) => MediaQuery.paddingOf(context).left,
              (DrawerAlignment.end, TextDirection.ltr) => MediaQuery.paddingOf(context).right,
            };

    if (_controller.isDismissed) {
      if (widget.enableOpenDragGesture && !isDesktop) {
        return Align(
          alignment: _drawerOuterAlignment,
          child: GestureDetector(
            key: _gestureDetectorKey,
            onHorizontalDragUpdate: _move,
            onHorizontalDragEnd: _settle,
            behavior: HitTestBehavior.translucent,
            excludeFromSemantics: true,
            dragStartBehavior: widget.dragStartBehavior,
            child: LimitedBox(
              maxHeight: 0.0,
              child: SizedBox(width: dragAreaWidth, height: double.infinity),
            ),
          ),
        );
      } else {
        return const SizedBox.shrink();
      }
    } else {
      final bool platformHasBackButton = switch (defaultTargetPlatform) {
        TargetPlatform.android => true,
        TargetPlatform.iOS ||
        TargetPlatform.macOS ||
        TargetPlatform.fuchsia ||
        TargetPlatform.linux ||
        TargetPlatform.windows => false,
      };

      final Color scrimColor =
          widget.scrimColor ?? DrawerTheme.of(context).scrimColor ?? Colors.black54;
      final Color effectiveScrimColor = scrimColor.withValues(
        alpha: scrimColor.a * _controller.value,
      );
      final Widget drawerScrim = ColoredBox(
        color: effectiveScrimColor,
        child: const LimitedBox(maxWidth: 0.0, maxHeight: 0.0, child: SizedBox.expand()),
      );

      final Widget child = _DrawerControllerScope(
        controller: widget,
        child: RepaintBoundary(
          child: Stack(
            children: <Widget>[
              BlockSemantics(
                child: ExcludeSemantics(