Skip to content

Commit

Permalink
Fix PopScope disables back navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
anhappdev committed May 18, 2024
1 parent a99e97a commit 652acd1
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions flutter/lib/ui/settings/task_config_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,30 +131,16 @@ class _DataFolderSelectorHelper {
}
return ListTile(
title: Text(l10n.settingsTaskDataFolderCustom),
subtitle: PopScope(
canPop: false,
onPopInvoked: (bool didPop) async {
if (didPop) return;
if (store.customDataFolder.isEmpty ||
!await Directory(store.customDataFolder).exists()) {
setValue(DataFolderType.default_);
}
},
child: Column(
children: [pathField, dirWarning],
),
subtitle: Column(
children: [pathField, dirWarning],
),
leading: Radio<DataFolderType>(
value: DataFolderType.custom,
groupValue: selectedOption,
onChanged: setValue,
),
onTap: () async {
if (store.customDataFolder.isEmpty) {
await pickFolder();
} else {
setValue(DataFolderType.custom);
}
await pickFolder();
},
);
}
Expand Down

0 comments on commit 652acd1

Please sign in to comment.