@@ -245,14 +245,24 @@ class TokenLayoutState extends BaseDynamicState<TokenLayout>
245245 contextMenu: _buildContextMenuButtons (),
246246 child: Selector <AppProvider , bool >(
247247 selector: (context, provider) => provider.dragToReorder,
248- builder: (context, dragToReorder, child) => GestureDetector (
249- onLongPress: dragToReorder && ! ResponsiveUtil .isDesktop ()
250- ? () {
251- showContextMenu ();
252- HapticFeedback .lightImpact ();
253- }
254- : null ,
255- child: PressableAnimation (child: _buildBody ()),
248+ builder: (context, dragToReorder, child) =>
249+ Selector <AppProvider , IssuerAndAccountShowOption >(
250+ selector: (context, provider) => provider.issuerAndAccountShowOption,
251+ builder: (context, issuerAndAccountShowOption, child) {
252+ return GestureDetector (
253+ onLongPress: dragToReorder && ! ResponsiveUtil .isDesktop ()
254+ ? () {
255+ showContextMenu ();
256+ HapticFeedback .lightImpact ();
257+ }
258+ : null ,
259+ child: PressableAnimation (
260+ child: _buildBody (
261+ issuerAndAccountShowOption: issuerAndAccountShowOption,
262+ ),
263+ ),
264+ );
265+ }
256266 ),
257267 ),
258268 );
@@ -351,12 +361,18 @@ class TokenLayoutState extends BaseDynamicState<TokenLayout>
351361 );
352362 }
353363
354- _buildBody () {
364+ _buildBody ({
365+ required IssuerAndAccountShowOption issuerAndAccountShowOption,
366+ }) {
355367 switch (widget.layoutType) {
356368 case LayoutType .Simple :
357- return _buildSimpleLayout ();
369+ return _buildSimpleLayout (
370+ issuerAndAccountShowOption: issuerAndAccountShowOption,
371+ );
358372 case LayoutType .Compact :
359- return _buildCompactLayout ();
373+ return _buildCompactLayout (
374+ issuerAndAccountShowOption: issuerAndAccountShowOption,
375+ );
360376 // case LayoutType.Tile:
361377 // return _buildSlidable(
362378 // startExtentRatio: 0.23,
@@ -366,13 +382,17 @@ class TokenLayoutState extends BaseDynamicState<TokenLayout>
366382 case LayoutType .List :
367383 return _buildSlidable (
368384 simple: true ,
369- child: _buildListLayout (),
385+ child: _buildListLayout (
386+ issuerAndAccountShowOption: issuerAndAccountShowOption,
387+ ),
370388 );
371389 case LayoutType .Spotlight :
372390 return _buildSlidable (
373391 startExtentRatio: 0.21 ,
374392 endExtentRatio: 0.8 ,
375- child: _buildSpotlightLayout (),
393+ child: _buildSpotlightLayout (
394+ issuerAndAccountShowOption: issuerAndAccountShowOption,
395+ ),
376396 );
377397 }
378398 }
@@ -528,7 +548,7 @@ class TokenLayoutState extends BaseDynamicState<TokenLayout>
528548 icon: Icon (
529549 LucideIcons .eye,
530550 size: 20 ,
531- color: color ?? ChewieTheme .labelMedium? .color,
551+ color: color ?? ChewieTheme .labelMedium.color,
532552 ),
533553 )
534554 : emptyWidget,
@@ -561,7 +581,7 @@ class TokenLayoutState extends BaseDynamicState<TokenLayout>
561581 icon: Icon (
562582 Icons .refresh_rounded,
563583 size: 20 ,
564- color: color ?? ChewieTheme .labelMedium? .color,
584+ color: color ?? ChewieTheme .labelMedium.color,
565585 ),
566586 )
567587 : emptyWidget,
@@ -712,7 +732,9 @@ class TokenLayoutState extends BaseDynamicState<TokenLayout>
712732 }
713733 }
714734
715- _buildSimpleLayout () {
735+ _buildSimpleLayout ({
736+ required IssuerAndAccountShowOption issuerAndAccountShowOption,
737+ }) {
716738 return ClickableWrapper (
717739 child: Material (
718740 color: widget.token.pinned
@@ -741,7 +763,9 @@ class TokenLayoutState extends BaseDynamicState<TokenLayout>
741763 const SizedBox (width: 8 ),
742764 Expanded (
743765 child: Text (
744- widget.token.issuer,
766+ issuerAndAccountShowOption.isOnlyShowAccount
767+ ? widget.token.account
768+ : widget.token.issuer,
745769 maxLines: 1 ,
746770 overflow: TextOverflow .ellipsis,
747771 style: Theme .of (context)
@@ -780,7 +804,9 @@ class TokenLayoutState extends BaseDynamicState<TokenLayout>
780804 );
781805 }
782806
783- _buildCompactLayout () {
807+ _buildCompactLayout ({
808+ required IssuerAndAccountShowOption issuerAndAccountShowOption,
809+ }) {
784810 return ClickableWrapper (
785811 child: Material (
786812 color: widget.token.pinned
@@ -809,21 +835,33 @@ class TokenLayoutState extends BaseDynamicState<TokenLayout>
809835 child: Column (
810836 crossAxisAlignment: CrossAxisAlignment .start,
811837 children: [
812- Text (
813- widget.token.issuer,
814- maxLines: 1 ,
815- overflow: TextOverflow .ellipsis,
816- style: Theme .of (context)
817- .textTheme
818- .titleMedium
819- ? .apply (fontWeightDelta: 2 ),
820- ),
821- Text (
822- widget.token.account,
823- maxLines: 1 ,
824- overflow: TextOverflow .ellipsis,
825- style: ChewieTheme .bodySmall,
826- ),
838+ if (issuerAndAccountShowOption.showIssuer)
839+ Text (
840+ widget.token.issuer,
841+ maxLines: 1 ,
842+ overflow: TextOverflow .ellipsis,
843+ style: Theme .of (context)
844+ .textTheme
845+ .titleMedium
846+ ? .apply (fontWeightDelta: 2 ),
847+ ),
848+ if (issuerAndAccountShowOption.showBoth)
849+ Text (
850+ widget.token.account,
851+ maxLines: 1 ,
852+ overflow: TextOverflow .ellipsis,
853+ style: ChewieTheme .bodySmall,
854+ ),
855+ if (issuerAndAccountShowOption.isOnlyShowAccount)
856+ Text (
857+ widget.token.account,
858+ maxLines: 1 ,
859+ overflow: TextOverflow .ellipsis,
860+ style: Theme .of (context)
861+ .textTheme
862+ .titleMedium
863+ ? .apply (fontWeightDelta: 2 ),
864+ ),
827865 ],
828866 ),
829867 ),
@@ -845,7 +883,7 @@ class TokenLayoutState extends BaseDynamicState<TokenLayout>
845883 padding: const EdgeInsets .all (4 ),
846884 icon: Icon (
847885 LucideIcons .ellipsisVertical,
848- color: ChewieTheme .labelSmall? .color,
886+ color: ChewieTheme .labelSmall.color,
849887 size: 20 ,
850888 ),
851889 onTap: showContextMenu,
@@ -868,7 +906,9 @@ class TokenLayoutState extends BaseDynamicState<TokenLayout>
868906 );
869907 }
870908
871- _buildSpotlightLayout () {
909+ _buildSpotlightLayout ({
910+ required IssuerAndAccountShowOption issuerAndAccountShowOption,
911+ }) {
872912 return ClickableWrapper (
873913 child: Material (
874914 color: widget.token.pinned
@@ -902,22 +942,35 @@ class TokenLayoutState extends BaseDynamicState<TokenLayout>
902942 mainAxisSize: MainAxisSize .min,
903943 mainAxisAlignment: MainAxisAlignment .center,
904944 children: [
905- Text (
906- widget.token.issuer,
907- maxLines: 1 ,
908- overflow: TextOverflow .ellipsis,
909- style: Theme .of (context)
910- .textTheme
911- .titleMedium
912- ? .apply (fontWeightDelta: 2 ),
913- ),
914- if (widget.token.account.isNotEmpty)
945+ if (issuerAndAccountShowOption.showIssuer)
946+ Text (
947+ widget.token.issuer,
948+ maxLines: 1 ,
949+ overflow: TextOverflow .ellipsis,
950+ style: Theme .of (context)
951+ .textTheme
952+ .titleMedium
953+ ? .apply (fontWeightDelta: 2 ),
954+ ),
955+ if (widget.token.account.isNotEmpty &&
956+ issuerAndAccountShowOption.showBoth)
915957 Text (
916958 widget.token.account,
917959 maxLines: 1 ,
918960 overflow: TextOverflow .ellipsis,
919961 style: ChewieTheme .bodySmall,
920962 ),
963+ if (widget.token.account.isNotEmpty &&
964+ issuerAndAccountShowOption.isOnlyShowAccount)
965+ Text (
966+ widget.token.account,
967+ maxLines: 1 ,
968+ overflow: TextOverflow .ellipsis,
969+ style: Theme .of (context)
970+ .textTheme
971+ .titleMedium
972+ ? .apply (fontWeightDelta: 2 ),
973+ ),
921974 Container (
922975 constraints: const BoxConstraints (
923976 maxHeight: 45 , minHeight: 45 ),
@@ -945,7 +998,9 @@ class TokenLayoutState extends BaseDynamicState<TokenLayout>
945998 );
946999 }
9471000
948- _buildListLayout () {
1001+ _buildListLayout ({
1002+ required IssuerAndAccountShowOption issuerAndAccountShowOption,
1003+ }) {
9491004 return ClickableWrapper (
9501005 child: Material (
9511006 color: widget.token.pinned
@@ -967,7 +1022,9 @@ class TokenLayoutState extends BaseDynamicState<TokenLayout>
9671022 const SizedBox (width: 8 ),
9681023 Expanded (
9691024 child: Text (
970- widget.token.issuer,
1025+ issuerAndAccountShowOption.isOnlyShowAccount
1026+ ? widget.token.account
1027+ : widget.token.issuer,
9711028 maxLines: 1 ,
9721029 overflow: TextOverflow .ellipsis,
9731030 style: Theme .of (context)
0 commit comments