feat: Add the button to copy password on the new user creation screen (#409)
continuous-integration/drone/push Build is passing Details

#299

Co-authored-by: dettlaff <dettlaff@riseup.net>
Reviewed-on: #409
Reviewed-by: NaiJi  <naiji@noreply.git.selfprivacy.org>
Reviewed-by: Inex Code <inex.code@selfprivacy.org>
Co-authored-by: def <dettlaff@riseup.net>
Co-committed-by: def <dettlaff@riseup.net>
pull/420/head
def 2023-12-28 15:19:16 +02:00 committed by Inex Code
parent d7bf6a0c06
commit e3e5570e4e
1 changed files with 32 additions and 6 deletions

View File

@ -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<UserFormCubit>().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<UserFormCubit>()
.password
.state
.value;
PlatformAdapter.setClipboard(currentPassword);
getIt<NavigationService>().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<UserFormCubit>().genNewPassword,
),
],
),
),
),