From 671d27cd23f2541d0eec1e58f364ebe00c91e8d2 Mon Sep 17 00:00:00 2001 From: Kelrap Date: Fri, 14 Jun 2024 13:24:52 -0400 Subject: [PATCH] Un-unenables replace button on incorrect select --- lib/pangea/widgets/igc/span_card.dart | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/lib/pangea/widgets/igc/span_card.dart b/lib/pangea/widgets/igc/span_card.dart index 0e85e4d01..ff174b7bf 100644 --- a/lib/pangea/widgets/igc/span_card.dart +++ b/lib/pangea/widgets/igc/span_card.dart @@ -272,30 +272,20 @@ class WordMatchContent extends StatelessWidget { if (!controller.widget.scm.pangeaMatch!.isITStart) Expanded( child: Opacity( - opacity: controller.selectedChoice != null && - controller.selectedChoice!.type.name == - 'bestCorrection' - ? 1.0 - : 0.5, + opacity: controller.selectedChoice != null ? 1.0 : 0.5, child: TextButton( - onPressed: controller.selectedChoice != null && - controller.selectedChoice!.type.name == - 'bestCorrection' + onPressed: controller.selectedChoice != null ? onReplaceSelected : null, style: ButtonStyle( backgroundColor: MaterialStateProperty.all( - (controller.selectedChoice != null && - controller.selectedChoice!.type.name == - 'bestCorrection' + (controller.selectedChoice != null ? controller.selectedChoice!.color : AppConfig.primaryColor) .withOpacity(0.2), ), // Outline if Replace button enabled - side: controller.selectedChoice != null && - controller.selectedChoice!.type.name == - 'bestCorrection' + side: controller.selectedChoice != null ? MaterialStateProperty.all( BorderSide( color: controller.selectedChoice!.color,