TF-4301 Block barrier dismissal while label creation is in progress

Wrap CreateNewLabelModal with PopScope(canPop: false) while the
creation request is in flight so that tapping the barrier
(barrierDismissible: true) cannot dispose the modal and cancel
the stream subscription before the result is delivered.
This commit is contained in:
dab246
2026-04-16 18:34:30 +07:00
committed by Dat H. Pham
parent 660c4f40e2
commit 2fd890f488
@@ -114,7 +114,11 @@ class _CreateNewLabelModalState extends State<CreateNewLabelModal> {
final appLocalizations = AppLocalizations.of(context);
final theme = Theme.of(context);
return LayoutBuilder(builder: (_, constraints) {
return ValueListenableBuilder<LabelPositiveButtonState>(
valueListenable: _createLabelStateNotifier,
builder: (_, labelState, __) => PopScope(
canPop: labelState != LabelPositiveButtonState.progressing,
child: LayoutBuilder(builder: (_, constraints) {
final currentScreenWidth = constraints.maxWidth;
final currentScreenHeight = constraints.maxHeight;
final isMobile = currentScreenWidth < ResponsiveUtils.minTabletWidth;
@@ -256,7 +260,9 @@ class _CreateNewLabelModalState extends State<CreateNewLabelModal> {
}
return bodyWidget;
});
}),
),
);
}
Widget _buildTitle(