@@ -68,16 +68,15 @@ class _MasternodeCard extends StatelessWidget {
6868 ),
6969 );
7070 } else {
71- await Navigator .of (
72- context,
73- ).pushNamed (MasternodeDetailsView .routeName, arguments: node);
71+ await Navigator .of (context)
72+ .pushNamed (MasternodeDetailsView .routeName, arguments: node);
7473 }
7574 }
7675
7776 @override
7877 Widget build (BuildContext context) {
7978 final stack = Theme .of (context).extension < StackColors > ()! ;
80- final isActive = node.revocationReason == 0 ;
79+ final status = node.status ;
8180
8281 return RoundedWhiteContainer (
8382 padding: const EdgeInsets .all (16 ),
@@ -97,9 +96,8 @@ class _MasternodeCard extends StatelessWidget {
9796 const SizedBox (height: 2 ),
9897 Text (
9998 "Last paid height: ${node .lastPaidHeight }" ,
100- style: STextStyles .baseXS (
101- context,
102- ).copyWith (color: stack.textSubtitle1),
99+ style: STextStyles .baseXS (context)
100+ .copyWith (color: stack.textSubtitle1),
103101 ),
104102 ],
105103 ),
@@ -108,14 +106,17 @@ class _MasternodeCard extends StatelessWidget {
108106 Container (
109107 padding: const EdgeInsets .symmetric (horizontal: 8 , vertical: 4 ),
110108 decoration: BoxDecoration (
111- color: isActive ? stack.accentColorGreen : stack.accentColorRed,
109+ color: switch (status) {
110+ MasternodeStatus .active => stack.accentColorGreen,
111+ MasternodeStatus .banned => stack.accentColorOrange,
112+ MasternodeStatus .revoked => stack.accentColorRed,
113+ },
112114 borderRadius: BorderRadius .circular (8 ),
113115 ),
114116 child: Text (
115- isActive ? "ACTIVE" : "REVOKED" ,
116- style: STextStyles .w600_12 (
117- context,
118- ).copyWith (color: stack.textWhite),
117+ status.label,
118+ style: STextStyles .w600_12 (context)
119+ .copyWith (color: stack.textWhite),
119120 ),
120121 ),
121122 ],
0 commit comments