π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][photos] Fix clipping of TextInputWidget toward the right end when there is no suffix icon
ashilkn98c604a73e68
diff --git a/mobile/lib/ui/components/text_input_widget.dart b/mobile/lib/ui/components/text_input_widget.dartindex b135b32b15..dd8bd66103 100644--- a/mobile/lib/ui/components/text_input_widget.dart+++ b/mobile/lib/ui/components/text_input_widget.dart@@ -189,25 +189,17 @@ class _TextInputWidgetState extends State<TextInputWidget> {),borderRadius: BorderRadius.circular(8),),- suffixIcon: Padding(- padding: const EdgeInsets.symmetric(horizontal: 12),- child: AnimatedSwitcher(- duration: const Duration(milliseconds: 175),- switchInCurve: Curves.easeInExpo,- switchOutCurve: Curves.easeOutExpo,- child: SuffixIconWidget(- key: ValueKey(executionState),- executionState: executionState,- shouldSurfaceExecutionStates:- widget.shouldSurfaceExecutionStates,- obscureTextNotifier: _obscureTextNotifier,- isPasswordInput: widget.isPasswordInput,- textController: _textController,- isClearable: widget.isClearable,- shouldUnfocusOnClearOrSubmit:- widget.shouldUnfocusOnClearOrSubmit,- ),- ),+ suffixIcon: SuffixIconWidget(+ key: ValueKey(executionState),+ executionState: executionState,+ shouldSurfaceExecutionStates:+ widget.shouldSurfaceExecutionStates,+ obscureTextNotifier: _obscureTextNotifier,+ isPasswordInput: widget.isPasswordInput,+ textController: _textController,+ isClearable: widget.isClearable,+ shouldUnfocusOnClearOrSubmit:+ widget.shouldUnfocusOnClearOrSubmit,),prefixIconConstraints: const BoxConstraints(maxHeight: 44,@@ -218,8 +210,8 @@ class _TextInputWidgetState extends State<TextInputWidget> {suffixIconConstraints: const BoxConstraints(maxHeight: 24,maxWidth: 48,- minHeight: 24,- minWidth: 48,+ minHeight: 0,+ minWidth: 0,),prefixIcon: widget.prefixIcon != null? Icon(@@ -442,7 +434,7 @@ class SuffixIconWidget extends StatelessWidget {@overrideWidget build(BuildContext context) {- final Widget trailingWidget;+ final Widget? trailingWidget;final colorScheme = getEnteColorScheme(context);if (executionState == ExecutionState.idle ||!shouldSurfaceExecutionStates) {@@ -473,7 +465,7 @@ class SuffixIconWidget extends StatelessWidget {),);} else {- trailingWidget = const SizedBox.shrink();+ trailingWidget = null;}} else if (executionState == ExecutionState.inProgress) {trailingWidget = EnteLoadingWidget(@@ -486,8 +478,21 @@ class SuffixIconWidget extends StatelessWidget {color: colorScheme.primary500,);} else {- trailingWidget = const SizedBox.shrink();+ trailingWidget = null;+ }+ if (trailingWidget != null) {+ return AnimatedSwitcher(+ duration: const Duration(milliseconds: 175),+ switchInCurve: Curves.easeInExpo,+ switchOutCurve: Curves.easeOutExpo,+ child: Padding(+ padding: const EdgeInsets.symmetric(horizontal: 12),+ child: trailingWidget,+ ),+ );+ } else {+ // return trailingWidget;+ return const SizedBox.shrink();}- return trailingWidget;}}