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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user