feat: Add the button to copy password on the new user creation screen #409

Merged
inex merged 4 commits from add_copy_passwd_to_users into master 2023-12-28 15:19:17 +02:00
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

Also we need to visually notify about the success, please refer to
lib/ui/pages/backups/snapshot_id_list_tile.dart

      getIt<NavigationService>().showSnackBar(
        'basis.copied_to_clipboard'.tr(),
        behavior: SnackBarBehavior.floating,
      );
Also we need to visually notify about the success, please refer to lib/ui/pages/backups/snapshot_id_list_tile.dart ``` getIt<NavigationService>().showSnackBar( 'basis.copied_to_clipboard'.tr(), behavior: SnackBarBehavior.floating, ); ```

done

done
.read<UserFormCubit>()
.password
.state
.value;
PlatformAdapter.setClipboard(currentPassword);
NaiJi marked this conversation as resolved Outdated

We have PlatformAdapter::setClipboard in lib/utils/platform_adapter.dart

We have `PlatformAdapter::setClipboard` in lib/utils/platform_adapter.dart

done

done
getIt<NavigationService>().showSnackBar(
'basis.copied_to_clipboard'.tr(),
behavior: SnackBarBehavior.floating,
);
},
),
IconButton(
NaiJi marked this conversation as resolved Outdated

The buttons have different radius. You can also clearly see it when you tap them: one ink bubble is bigger than another.

image

The buttons have different radius. You can also clearly see it when you tap them: one ink bubble is bigger than another. ![image](/attachments/e26822d6-2958-4df3-9bc0-e946c542c694)

done

done
icon: Icon(
Icons.refresh,
size: 24.0,
color: Theme.of(context).colorScheme.secondary,
),
onPressed:
context.read<UserFormCubit>().genNewPassword,

Material Icons are standardized in size, you don't need to adjust it manually with InkWell and other things. It would be enough to set them back to IconButton class with Icon size 24.0.

We need to be rather conventional than subjective, because otherwise it adds up more unneeded complexity, even if we disagree with Flutter.

Material Icons are standardized in size, you don't need to adjust it manually with InkWell and other things. It would be enough to set them back to IconButton class with Icon size 24.0. We need to be rather conventional than subjective, because otherwise it adds up more unneeded complexity, even if we disagree with Flutter.

I guess Flutter does that because of some effect or idk

I guess Flutter does that because of [some effect or idk](https://medium.com/design-bridges/optical-effects-9fca82b4cd9a)
),
],
),
),
),