mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-08 17:11:14 +00:00
feat: Add the button to copy password on the new user creation screen (#409)
https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.app/issues/299 Co-authored-by: dettlaff <dettlaff@riseup.net> Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.app/pulls/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>
This commit is contained in:
parent
d7bf6a0c06
commit
e3e5570e4e
|
@ -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,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue