{ const PaymentAmountField({ required this.inputValue, super.key, }); final InputValue inputValue; @override Widget build(BuildContext context) { return SampleTextField( amount: inputValue.amount, isFixed: inputValue.isFixed, borderColor: inputValue.borderColor, showIcon: inputValue.showIcon, ); } } extension on InputValue { bool get isFixed => switch (this) { ManualValue() => false, OcrCompletedValue() => false, SystemFixedValue() => true, }; bool get showIcon => switch (this) { ManualValue() => false, OcrCompletedValue() => true, SystemFixedValue() => false, }; Color get borderColor => switch (this) { ManualValue() => Colors.blue, OcrCompletedValue() => Colors.grey, SystemFixedValue() => Colors.grey, }; } わかりやすやのためにor句は未使⽤です