mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-02-03 03:36:42 +00:00
desktop address book contact buttons
This commit is contained in:
parent
a5d925fb98
commit
2ec1bda6f2
1 changed files with 88 additions and 92 deletions
|
@ -9,7 +9,6 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/widgets/conditional_parent.dart';
|
|
||||||
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||||
|
|
||||||
class AddressBookCard extends ConsumerStatefulWidget {
|
class AddressBookCard extends ConsumerStatefulWidget {
|
||||||
|
@ -59,111 +58,108 @@ class _AddressBookCardState extends ConsumerState<AddressBookCard> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ConditionalParent(
|
return RoundedWhiteContainer(
|
||||||
condition: !isDesktop,
|
padding: const EdgeInsets.all(4),
|
||||||
child: Row(
|
child: RawMaterialButton(
|
||||||
children: [
|
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
|
||||||
Container(
|
padding: const EdgeInsets.all(0),
|
||||||
width: 32,
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||||
height: 32,
|
shape: RoundedRectangleBorder(
|
||||||
decoration: BoxDecoration(
|
borderRadius: BorderRadius.circular(
|
||||||
color: contact.id == "default"
|
Constants.size.circularBorderRadius,
|
||||||
? Theme.of(context)
|
),
|
||||||
.extension<StackColors>()!
|
),
|
||||||
.myStackContactIconBG
|
onPressed: () {
|
||||||
: Theme.of(context)
|
showDialog<void>(
|
||||||
.extension<StackColors>()!
|
context: context,
|
||||||
.textFieldDefaultBG,
|
useSafeArea: true,
|
||||||
borderRadius: BorderRadius.circular(32),
|
barrierDismissible: true,
|
||||||
|
builder: (_) => ContactPopUp(
|
||||||
|
contactId: contact.id,
|
||||||
),
|
),
|
||||||
child: contact.id == "default"
|
);
|
||||||
? Center(
|
},
|
||||||
child: SvgPicture.asset(
|
child: Padding(
|
||||||
Assets.svg.stackIcon(context),
|
padding: const EdgeInsets.all(8.0),
|
||||||
width: 20,
|
child: Row(
|
||||||
),
|
children: [
|
||||||
)
|
Container(
|
||||||
: contact.emojiChar != null
|
width: 32,
|
||||||
|
height: 32,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: contact.id == "default"
|
||||||
|
? Theme.of(context)
|
||||||
|
.extension<StackColors>()!
|
||||||
|
.myStackContactIconBG
|
||||||
|
: Theme.of(context)
|
||||||
|
.extension<StackColors>()!
|
||||||
|
.textFieldDefaultBG,
|
||||||
|
borderRadius: BorderRadius.circular(32),
|
||||||
|
),
|
||||||
|
child: contact.id == "default"
|
||||||
? Center(
|
? Center(
|
||||||
child: Text(contact.emojiChar!),
|
|
||||||
)
|
|
||||||
: Center(
|
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
Assets.svg.user,
|
Assets.svg.stackIcon(context),
|
||||||
width: 18,
|
width: 20,
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
),
|
: contact.emojiChar != null
|
||||||
const SizedBox(
|
? Center(
|
||||||
width: 12,
|
child: Text(contact.emojiChar!),
|
||||||
),
|
)
|
||||||
if (isDesktop)
|
: Center(
|
||||||
Text(
|
child: SvgPicture.asset(
|
||||||
contact.name,
|
Assets.svg.user,
|
||||||
style: STextStyles.itemSubtitle12(context),
|
width: 18,
|
||||||
),
|
),
|
||||||
if (isDesktop)
|
),
|
||||||
const SizedBox(
|
),
|
||||||
width: 16,
|
const SizedBox(
|
||||||
),
|
width: 12,
|
||||||
if (isDesktop)
|
),
|
||||||
Text(
|
if (isDesktop)
|
||||||
coinsString,
|
|
||||||
style: STextStyles.label(context),
|
|
||||||
),
|
|
||||||
if (!isDesktop)
|
|
||||||
Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
Text(
|
||||||
contact.name,
|
contact.name,
|
||||||
style: STextStyles.itemSubtitle12(context),
|
style: STextStyles.itemSubtitle12(context),
|
||||||
),
|
),
|
||||||
|
if (isDesktop)
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 4,
|
width: 16,
|
||||||
),
|
),
|
||||||
|
if (isDesktop)
|
||||||
Text(
|
Text(
|
||||||
coinsString,
|
coinsString,
|
||||||
style: STextStyles.label(context),
|
style: STextStyles.label(context),
|
||||||
),
|
),
|
||||||
],
|
if (!isDesktop)
|
||||||
),
|
Column(
|
||||||
if (isDesktop) const Spacer(),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
if (isDesktop)
|
children: [
|
||||||
SvgPicture.asset(
|
Text(
|
||||||
widget.indicatorDown == true
|
contact.name,
|
||||||
? Assets.svg.chevronDown
|
style: STextStyles.itemSubtitle12(context),
|
||||||
: Assets.svg.chevronUp,
|
),
|
||||||
width: 10,
|
const SizedBox(
|
||||||
height: 5,
|
height: 4,
|
||||||
color: Theme.of(context).extension<StackColors>()!.textSubtitle2,
|
),
|
||||||
),
|
Text(
|
||||||
],
|
coinsString,
|
||||||
),
|
style: STextStyles.label(context),
|
||||||
builder: (child) => RoundedWhiteContainer(
|
),
|
||||||
padding: const EdgeInsets.all(4),
|
],
|
||||||
child: RawMaterialButton(
|
),
|
||||||
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
|
if (isDesktop) const Spacer(),
|
||||||
padding: const EdgeInsets.all(0),
|
// if (isDesktop)
|
||||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
// SvgPicture.asset(
|
||||||
shape: RoundedRectangleBorder(
|
// widget.indicatorDown == true
|
||||||
borderRadius: BorderRadius.circular(
|
// ? Assets.svg.chevronDown
|
||||||
Constants.size.circularBorderRadius,
|
// : Assets.svg.chevronUp,
|
||||||
),
|
// width: 10,
|
||||||
),
|
// height: 5,
|
||||||
onPressed: () {
|
// color:
|
||||||
showDialog<void>(
|
// Theme.of(context).extension<StackColors>()!.textSubtitle2,
|
||||||
context: context,
|
// ),
|
||||||
useSafeArea: true,
|
],
|
||||||
barrierDismissible: true,
|
|
||||||
builder: (_) => ContactPopUp(
|
|
||||||
contactId: contact.id,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: child,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue