feat: Add the button to copy password on the new user creation screen #409
|
@ -71,12 +71,38 @@ class NewUserPage extends StatelessWidget {
|
|||
labelText: 'basis.password'.tr(),
|
||||
suffixIcon: Padding(
|
||||
padding: const EdgeInsets.only(right: 8),
|
||||
child: IconButton(
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
BrandIcons.refresh,
|
||||
Icons.copy,
|
||||
size: 24.0,
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
onPressed: context.read<UserFormCubit>().genNewPassword,
|
||||
onPressed: () {
|
||||
final String currentPassword = context
|
||||
|
||||
.read<UserFormCubit>()
|
||||
.password
|
||||
.state
|
||||
.value;
|
||||
PlatformAdapter.setClipboard(currentPassword);
|
||||
NaiJi marked this conversation as resolved
Outdated
NaiJi
commented
Outdated
Review
We have We have `PlatformAdapter::setClipboard` in lib/utils/platform_adapter.dart
def
commented
Outdated
Review
done done
|
||||
getIt<NavigationService>().showSnackBar(
|
||||
'basis.copied_to_clipboard'.tr(),
|
||||
behavior: SnackBarBehavior.floating,
|
||||
);
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
NaiJi marked this conversation as resolved
Outdated
NaiJi
commented
Outdated
Review
The buttons have different radius. You can also clearly see it when you tap them: one ink bubble is bigger than another. 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)
def
commented
Outdated
Review
done done
|
||||
icon: Icon(
|
||||
Icons.refresh,
|
||||
size: 24.0,
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
onPressed:
|
||||
context.read<UserFormCubit>().genNewPassword,
|
||||
NaiJi
commented
Outdated
Review
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.
NaiJi
commented
Outdated
Review
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)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Reference in New Issue
Also we need to visually notify about the success, please refer to
lib/ui/pages/backups/snapshot_id_list_tile.dart
done