From 22272c3c320ef10b2981b31fe80776f27aad32f0 Mon Sep 17 00:00:00 2001 From: Domenic-MZS Date: Sat, 23 Mar 2024 17:08:11 -0300 Subject: [PATCH] fix(ui): adjust `showSourcesDialog` scroll clipping in `AlertDialog` This commit resolves the issue of children clipping in `AlertDialog` for the `showSourcesDialog` by adjusting the structure to manage scrolling behavior more efficiently. By doing this, the user experience and readability is greatly improved on small devices and/or devices with large fonts. - Remove child SingleChildScrollView - Add parent (dialog) scrollable property to true --- .../settings_manage_sources.dart | 121 +++++++++--------- 1 file changed, 60 insertions(+), 61 deletions(-) diff --git a/lib/ui/views/settings/settingsFragment/settings_manage_sources.dart b/lib/ui/views/settings/settingsFragment/settings_manage_sources.dart index 14f3fec40b..866d6bb786 100644 --- a/lib/ui/views/settings/settingsFragment/settings_manage_sources.dart +++ b/lib/ui/views/settings/settingsFragment/settings_manage_sources.dart @@ -27,6 +27,7 @@ class SManageSources extends BaseViewModel { return showDialog( context: context, builder: (context) => AlertDialog( + scrollable: true, title: Row( children: [ Text(t.settingsView.sourcesLabel), @@ -38,75 +39,73 @@ class SManageSources extends BaseViewModel { ), ], ), - content: SingleChildScrollView( - child: Column( - children: [ - TextField( - controller: _orgPatSourceController, - autocorrect: false, - onChanged: (value) => notifyListeners(), - decoration: InputDecoration( - icon: Icon( - Icons.extension_outlined, - color: Theme.of(context).colorScheme.onSurfaceVariant, - ), - border: const OutlineInputBorder(), - labelText: t.settingsView.orgPatchesLabel, - hintText: patchesRepo.split('/')[0], + content: Column( + children: [ + TextField( + controller: _orgPatSourceController, + autocorrect: false, + onChanged: (value) => notifyListeners(), + decoration: InputDecoration( + icon: Icon( + Icons.extension_outlined, + color: Theme.of(context).colorScheme.onSurfaceVariant, ), + border: const OutlineInputBorder(), + labelText: t.settingsView.orgPatchesLabel, + hintText: patchesRepo.split('/')[0], ), - const SizedBox(height: 8), - // Patches repository's name - TextField( - controller: _patSourceController, - autocorrect: false, - onChanged: (value) => notifyListeners(), - decoration: InputDecoration( - icon: const Icon( - Icons.extension_outlined, - color: Colors.transparent, - ), - border: const OutlineInputBorder(), - labelText: t.settingsView.sourcesPatchesLabel, - hintText: patchesRepo.split('/')[1], + ), + const SizedBox(height: 8), + // Patches repository's name + TextField( + controller: _patSourceController, + autocorrect: false, + onChanged: (value) => notifyListeners(), + decoration: InputDecoration( + icon: const Icon( + Icons.extension_outlined, + color: Colors.transparent, ), + border: const OutlineInputBorder(), + labelText: t.settingsView.sourcesPatchesLabel, + hintText: patchesRepo.split('/')[1], ), - const SizedBox(height: 8), - // Integrations owner's name - TextField( - controller: _orgIntSourceController, - autocorrect: false, - onChanged: (value) => notifyListeners(), - decoration: InputDecoration( - icon: Icon( - Icons.merge_outlined, - color: Theme.of(context).colorScheme.onSurfaceVariant, - ), - border: const OutlineInputBorder(), - labelText: t.settingsView.orgIntegrationsLabel, - hintText: integrationsRepo.split('/')[0], + ), + const SizedBox(height: 8), + // Integrations owner's name + TextField( + controller: _orgIntSourceController, + autocorrect: false, + onChanged: (value) => notifyListeners(), + decoration: InputDecoration( + icon: Icon( + Icons.merge_outlined, + color: Theme.of(context).colorScheme.onSurfaceVariant, ), + border: const OutlineInputBorder(), + labelText: t.settingsView.orgIntegrationsLabel, + hintText: integrationsRepo.split('/')[0], ), - const SizedBox(height: 8), - // Integrations repository's name - TextField( - controller: _intSourceController, - autocorrect: false, - onChanged: (value) => notifyListeners(), - decoration: InputDecoration( - icon: const Icon( - Icons.merge_outlined, - color: Colors.transparent, - ), - border: const OutlineInputBorder(), - labelText: t.settingsView.sourcesIntegrationsLabel, - hintText: integrationsRepo.split('/')[1], + ), + const SizedBox(height: 8), + // Integrations repository's name + TextField( + controller: _intSourceController, + autocorrect: false, + onChanged: (value) => notifyListeners(), + decoration: InputDecoration( + icon: const Icon( + Icons.merge_outlined, + color: Colors.transparent, ), + border: const OutlineInputBorder(), + labelText: t.settingsView.sourcesIntegrationsLabel, + hintText: integrationsRepo.split('/')[1], ), - const SizedBox(height: 20), - Text(t.settingsView.sourcesUpdateNote), - ], - ), + ), + const SizedBox(height: 20), + Text(t.settingsView.sourcesUpdateNote), + ], ), actions: [ TextButton(