Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

refactor(auth): optimize Actions widget placement in CodeWidget

Jude Cooray1e452fb6b341
diff --git a/mobile/apps/auth/lib/ui/code_widget.dart b/mobile/apps/auth/lib/ui/code_widget.dart
index b3fb877e01..51b7ebcd9e 100644
--- a/mobile/apps/auth/lib/ui/code_widget.dart
+++ b/mobile/apps/auth/lib/ui/code_widget.dart
@@ -235,24 +235,24 @@ class _CodeWidgetState extends State<CodeWidget> {
builder: (context, selectedIds, child) {
final isSelected = selectedIds.contains(widget.code.selectionKey);
- return Actions(
- actions: {
- CopyIntent: CallbackAction<CopyIntent>(
- onInvoke: (intent) => _copyCurrentOTPToClipboard(),
- ),
- CopyNextIntent: CallbackAction<CopyNextIntent>(
- onInvoke: (intent) {
- if (!widget.code.type.isTOTPCompatible) {
- showToast(context, context.l10n.notSupportedForHOTP);
- return;
- }
- _copyNextToClipboard();
+ return Stack(
+ children: [
+ Actions(
+ actions: {
+ CopyIntent: CallbackAction<CopyIntent>(
+ onInvoke: (intent) => _copyCurrentOTPToClipboard(),
+ ),
+ CopyNextIntent: CallbackAction<CopyNextIntent>(
+ onInvoke: (intent) {
+ if (!widget.code.type.isTOTPCompatible) {
+ showToast(context, context.l10n.notSupportedForHOTP);
+ return;
+ }
+ _copyNextToClipboard();
+ },
+ ),
},
- ),
- },
- child: Stack(
- children: [
- AnimatedContainer(
+ child: AnimatedContainer(
duration: const Duration(milliseconds: 180),
curve: Curves.easeInOut,
decoration: BoxDecoration(
@@ -308,27 +308,27 @@ class _CodeWidgetState extends State<CodeWidget> {
),
),
),
- Positioned.fill(
- child: IgnorePointer(
- ignoring: true,
- child: AnimatedOpacity(
- duration: const Duration(milliseconds: 180),
- curve: Curves.easeInOut,
- opacity: isSelected ? 1 : 0,
- child: DecoratedBox(
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(8),
- border: Border.all(
- color: colorScheme.primary400,
- width: 2,
- ),
+ ),
+ Positioned.fill(
+ child: IgnorePointer(
+ ignoring: true,
+ child: AnimatedOpacity(
+ duration: const Duration(milliseconds: 180),
+ curve: Curves.easeInOut,
+ opacity: isSelected ? 1 : 0,
+ child: DecoratedBox(
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(8),
+ border: Border.all(
+ color: colorScheme.primary400,
+ width: 2,
),
),
),
),
),
- ],
- ),
+ ),
+ ],
);
},
);