feat: add copy buttons to user id and email display fields
This commit is contained in:
parent
77d1ddf458
commit
7ecc3140c6
2 changed files with 45 additions and 18 deletions
|
@ -1,10 +1,11 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:recon/apis/user_api.dart';
|
import 'package:recon/apis/user_api.dart';
|
||||||
import 'package:recon/auxiliary.dart';
|
import 'package:recon/auxiliary.dart';
|
||||||
import 'package:recon/blend_mask.dart';
|
|
||||||
import 'package:recon/client_holder.dart';
|
import 'package:recon/client_holder.dart';
|
||||||
import 'package:recon/models/personal_profile.dart';
|
import 'package:recon/models/personal_profile.dart';
|
||||||
|
import 'package:recon/widgets/blend_mask.dart';
|
||||||
import 'package:recon/widgets/default_error_widget.dart';
|
import 'package:recon/widgets/default_error_widget.dart';
|
||||||
import 'package:recon/widgets/generic_avatar.dart';
|
import 'package:recon/widgets/generic_avatar.dart';
|
||||||
|
|
||||||
|
@ -105,6 +106,9 @@ class _MyProfileDialogState extends State<MyProfileDialog> {
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Column(
|
Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
@ -118,9 +122,22 @@ class _MyProfileDialogState extends State<MyProfileDialog> {
|
||||||
style: textTheme.bodySmall?.copyWith(color: const Color(0xFFE1E1E0)))
|
style: textTheme.bodySmall?.copyWith(color: const Color(0xFFE1E1E0)))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
Clipboard.setData(ClipboardData(text: profile.id));
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||||
|
content: Text("User ID copied to clipboard"),
|
||||||
|
behavior: SnackBarBehavior.floating));
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.copy_outlined))
|
||||||
|
],
|
||||||
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 8,
|
height: 8,
|
||||||
),
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
Column(
|
Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
@ -133,6 +150,16 @@ class _MyProfileDialogState extends State<MyProfileDialog> {
|
||||||
style: textTheme.bodySmall?.copyWith(color: const Color(0xFFE1E1E0)))
|
style: textTheme.bodySmall?.copyWith(color: const Color(0xFFE1E1E0)))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
Clipboard.setData(ClipboardData(text: profile.email));
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||||
|
content: Text("Email copied to clipboard"),
|
||||||
|
behavior: SnackBarBehavior.floating));
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.copy_outlined))
|
||||||
|
],
|
||||||
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 8,
|
height: 8,
|
||||||
),
|
),
|
||||||
|
@ -257,7 +284,7 @@ class StorageIndicator extends StatelessWidget {
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: BlendMask(
|
child: BlendMask(
|
||||||
blendMode: BlendMode.colorDodge,
|
blendMode: BlendMode.srcATop,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
|
Loading…
Reference in a new issue