import 'package:flutter/widgets.dart'; import 'package:cutdex/l10n/l10n.dart'; import 'package:cutdex_core/editor.dart'; extension TransformChannelLabel on TransformChannel { String label(BuildContext context) => switch (this) { TransformChannel.position => context.l10n.position, TransformChannel.rotation => context.l10n.rotation, TransformChannel.scale => context.l10n.scale, TransformChannel.cornerRadius => context.l10n.cornerRadius, TransformChannel.distortTopLeft => context.l10n.distortionTopLeft, TransformChannel.distortTopRight => context.l10n.distortionTopRight, TransformChannel.distortBottomRight => context.l10n.distortionBottomRight, TransformChannel.distortBottomLeft => context.l10n.distortionBottomLeft, }; } Map> localizedMaskChannels(BuildContext context) => { context.l10n.position: ['center.x', 'center.y'], context.l10n.size: ['width', 'height'], context.l10n.rotation: ['rotation'], context.l10n.feather: ['feather'], }; // Stable channel identifiers are independent of the interface language. const maskChannels = { 'position': ['center.x', 'center.y'], 'size': ['width', 'height'], 'rotation': ['rotation'], 'feather': ['feather'], };