Skip to content

Commit 9bc1c9f

Browse files
committed
fix(app): Do not mix up trades tab with orders tab
1 parent dddf292 commit 9bc1c9f

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

mobile/lib/features/trade/trade_screen.dart

+17-17
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ class TradeScreen extends StatelessWidget {
109109
selectedIndex: 0,
110110
keys: const [
111111
tradeScreenTabsPositions,
112-
tradeScreenTabsTrades,
113-
tradeScreenTabsOrders
112+
tradeScreenTabsOrders,
113+
tradeScreenTabsTrades
114114
],
115115
tabBarViewChildren: [
116116
ListView.builder(
@@ -192,13 +192,14 @@ class TradeScreen extends StatelessWidget {
192192
);
193193
},
194194
),
195-
tradeChangeNotifier.trades.isEmpty
195+
// If there are no orders we early-return with placeholder
196+
orderChangeNotifier.orders.isEmpty
196197
? RichText(
197198
text: TextSpan(
198199
style: DefaultTextStyle.of(context).style,
199200
children: <TextSpan>[
200201
const TextSpan(
201-
text: "You don't have any trades yet.\n\n",
202+
text: "You don't have any orders yet.\n\n",
202203
style: TextStyle(color: Colors.grey)),
203204
TextSpan(
204205
text: "Buy",
@@ -215,19 +216,18 @@ class TradeScreen extends StatelessWidget {
215216
: SingleChildScrollView(
216217
physics: const AlwaysScrollableScrollPhysics(),
217218
child: Card(
218-
child: Column(
219-
children: tradeChangeNotifier.trades
220-
.map((trade) => TradeListItem(trade: trade))
221-
.toList(),
222-
))),
223-
// If there are no positions we early-return with placeholder
224-
orderChangeNotifier.orders.isEmpty
219+
child: Column(
220+
children: orderChangeNotifier.orders.values
221+
.map((e) => OrderListItem(order: e))
222+
.toList()),
223+
)),
224+
tradeChangeNotifier.trades.isEmpty
225225
? RichText(
226226
text: TextSpan(
227227
style: DefaultTextStyle.of(context).style,
228228
children: <TextSpan>[
229229
const TextSpan(
230-
text: "You don't have any orders yet.\n\n",
230+
text: "You don't have any trades yet.\n\n",
231231
style: TextStyle(color: Colors.grey)),
232232
TextSpan(
233233
text: "Buy",
@@ -244,11 +244,11 @@ class TradeScreen extends StatelessWidget {
244244
: SingleChildScrollView(
245245
physics: const AlwaysScrollableScrollPhysics(),
246246
child: Card(
247-
child: Column(
248-
children: orderChangeNotifier.orders.values
249-
.map((e) => OrderListItem(order: e))
250-
.toList()),
251-
))
247+
child: Column(
248+
children: tradeChangeNotifier.trades
249+
.map((trade) => TradeListItem(trade: trade))
250+
.toList(),
251+
))),
252252
],
253253
),
254254
)

0 commit comments

Comments
 (0)