diff --git a/lib/ui/pages/users/new_user.dart b/lib/ui/pages/users/new_user.dart index 9212307a..2315bdb1 100644 --- a/lib/ui/pages/users/new_user.dart +++ b/lib/ui/pages/users/new_user.dart @@ -71,12 +71,38 @@ class NewUserPage extends StatelessWidget { labelText: 'basis.password'.tr(), suffixIcon: Padding( padding: const EdgeInsets.only(right: 8), - child: IconButton( - icon: Icon( - BrandIcons.refresh, - color: Theme.of(context).colorScheme.secondary, - ), - onPressed: context.read().genNewPassword, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + IconButton( + icon: Icon( + Icons.copy, + size: 24.0, + color: Theme.of(context).colorScheme.secondary, + ), + onPressed: () { + final String currentPassword = context + .read() + .password + .state + .value; + PlatformAdapter.setClipboard(currentPassword); + getIt().showSnackBar( + 'basis.copied_to_clipboard'.tr(), + behavior: SnackBarBehavior.floating, + ); + }, + ), + IconButton( + icon: Icon( + Icons.refresh, + size: 24.0, + color: Theme.of(context).colorScheme.secondary, + ), + onPressed: + context.read().genNewPassword, + ), + ], ), ), ),