mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-22 15:19:11 +00:00
"send from" contact card fix
This commit is contained in:
parent
df810c2a14
commit
b988342bb1
1 changed files with 95 additions and 90 deletions
|
@ -9,6 +9,8 @@ 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/expandable.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 {
|
||||||
|
@ -19,7 +21,7 @@ class AddressBookCard extends ConsumerStatefulWidget {
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
final String contactId;
|
final String contactId;
|
||||||
final bool? indicatorDown;
|
final ExpandableState? indicatorDown;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
ConsumerState<AddressBookCard> createState() => _AddressBookCardState();
|
ConsumerState<AddressBookCard> createState() => _AddressBookCardState();
|
||||||
|
@ -58,108 +60,111 @@ class _AddressBookCardState extends ConsumerState<AddressBookCard> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return RoundedWhiteContainer(
|
return ConditionalParent(
|
||||||
padding: const EdgeInsets.all(4),
|
condition: !isDesktop,
|
||||||
child: RawMaterialButton(
|
child: Row(
|
||||||
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
|
children: [
|
||||||
padding: const EdgeInsets.all(0),
|
Container(
|
||||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
width: 32,
|
||||||
shape: RoundedRectangleBorder(
|
height: 32,
|
||||||
borderRadius: BorderRadius.circular(
|
decoration: BoxDecoration(
|
||||||
Constants.size.circularBorderRadius,
|
color: contact.id == "default"
|
||||||
),
|
? Theme.of(context)
|
||||||
),
|
.extension<StackColors>()!
|
||||||
onPressed: () {
|
.myStackContactIconBG
|
||||||
showDialog<void>(
|
: Theme.of(context)
|
||||||
context: context,
|
.extension<StackColors>()!
|
||||||
useSafeArea: true,
|
.textFieldDefaultBG,
|
||||||
barrierDismissible: true,
|
borderRadius: BorderRadius.circular(32),
|
||||||
builder: (_) => ContactPopUp(
|
|
||||||
contactId: contact.id,
|
|
||||||
),
|
),
|
||||||
);
|
child: contact.id == "default"
|
||||||
},
|
? Center(
|
||||||
child: Padding(
|
child: SvgPicture.asset(
|
||||||
padding: const EdgeInsets.all(8.0),
|
Assets.svg.stackIcon(context),
|
||||||
child: Row(
|
width: 20,
|
||||||
children: [
|
),
|
||||||
Container(
|
)
|
||||||
width: 32,
|
: contact.emojiChar != null
|
||||||
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: SvgPicture.asset(
|
child: Text(contact.emojiChar!),
|
||||||
Assets.svg.stackIcon(context),
|
|
||||||
width: 20,
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
: contact.emojiChar != null
|
: Center(
|
||||||
? Center(
|
child: SvgPicture.asset(
|
||||||
child: Text(contact.emojiChar!),
|
Assets.svg.user,
|
||||||
)
|
width: 18,
|
||||||
: Center(
|
),
|
||||||
child: SvgPicture.asset(
|
),
|
||||||
Assets.svg.user,
|
),
|
||||||
width: 18,
|
const SizedBox(
|
||||||
),
|
width: 12,
|
||||||
),
|
),
|
||||||
),
|
if (isDesktop)
|
||||||
const SizedBox(
|
Text(
|
||||||
width: 12,
|
contact.name,
|
||||||
),
|
style: STextStyles.itemSubtitle12(context),
|
||||||
if (isDesktop)
|
),
|
||||||
|
if (isDesktop)
|
||||||
|
const SizedBox(
|
||||||
|
width: 16,
|
||||||
|
),
|
||||||
|
if (isDesktop)
|
||||||
|
Text(
|
||||||
|
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(
|
||||||
width: 16,
|
height: 4,
|
||||||
),
|
),
|
||||||
if (isDesktop)
|
|
||||||
Text(
|
Text(
|
||||||
coinsString,
|
coinsString,
|
||||||
style: STextStyles.label(context),
|
style: STextStyles.label(context),
|
||||||
),
|
),
|
||||||
if (!isDesktop)
|
],
|
||||||
Column(
|
),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
if (isDesktop) const Spacer(),
|
||||||
children: [
|
if (isDesktop)
|
||||||
Text(
|
SvgPicture.asset(
|
||||||
contact.name,
|
widget.indicatorDown == ExpandableState.collapsed
|
||||||
style: STextStyles.itemSubtitle12(context),
|
? Assets.svg.chevronDown
|
||||||
),
|
: Assets.svg.chevronUp,
|
||||||
const SizedBox(
|
width: 10,
|
||||||
height: 4,
|
height: 5,
|
||||||
),
|
color: Theme.of(context).extension<StackColors>()!.textSubtitle2,
|
||||||
Text(
|
),
|
||||||
coinsString,
|
],
|
||||||
style: STextStyles.label(context),
|
),
|
||||||
),
|
builder: (child) => RoundedWhiteContainer(
|
||||||
],
|
padding: const EdgeInsets.all(4),
|
||||||
),
|
child: RawMaterialButton(
|
||||||
if (isDesktop) const Spacer(),
|
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
|
||||||
// if (isDesktop)
|
padding: const EdgeInsets.all(0),
|
||||||
// SvgPicture.asset(
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||||
// widget.indicatorDown == true
|
shape: RoundedRectangleBorder(
|
||||||
// ? Assets.svg.chevronDown
|
borderRadius: BorderRadius.circular(
|
||||||
// : Assets.svg.chevronUp,
|
Constants.size.circularBorderRadius,
|
||||||
// width: 10,
|
),
|
||||||
// height: 5,
|
),
|
||||||
// color:
|
onPressed: () {
|
||||||
// Theme.of(context).extension<StackColors>()!.textSubtitle2,
|
showDialog<void>(
|
||||||
// ),
|
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