TF-4233 Fix the response success check to use key presence instead of value nullness.

This commit is contained in:
dab246
2026-01-23 12:06:55 +07:00
committed by Dat H. Pham
parent 6551750bd2
commit 69c3d32e3c
10 changed files with 49 additions and 29 deletions
@@ -25,18 +25,18 @@ import 'package:tmail_ui_user/features/mailbox_creator/presentation/extensions/v
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
import 'package:tmail_ui_user/main/routes/route_navigation.dart';
typedef OnCreateNewLabelCallback = Function(Label label);
typedef OnLabelActionCallback = Function(Label label);
class CreateNewLabelModal extends StatefulWidget {
final List<Label> labels;
final LabelActionType actionType;
final OnCreateNewLabelCallback onCreateNewLabelCallback;
final OnLabelActionCallback onLabelActionCallback;
final Label? selectedLabel;
const CreateNewLabelModal({
super.key,
required this.labels,
required this.onCreateNewLabelCallback,
required this.onLabelActionCallback,
this.actionType = LabelActionType.create,
this.selectedLabel,
});
@@ -182,6 +182,7 @@ class _CreateNewLabelModalState extends State<CreateNewLabelModal> {
isPositiveActionEnabled: value,
onPositiveAction: _onCreateNewLabel,
onNegativeAction: _onCloseModal,
positiveKey: widget.actionType.getModalPositiveActionKey(),
);
},
),
@@ -338,7 +339,7 @@ class _CreateNewLabelModalState extends State<CreateNewLabelModal> {
? HexColor(_selectedColor!.toHexTriplet())
: null,
);
widget.onCreateNewLabelCallback(newLabel);
widget.onLabelActionCallback(newLabel);
popBack();
}