Skip to content

Commit a1cf3f7

Browse files
committed
fix: enhance network log tile display with request name and method styling
1 parent cbb9ad9 commit a1cf3f7

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

lib/widgets/terminal_tiles.dart

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import 'package:flutter/material.dart';
2+
import 'package:apidash_design_system/apidash_design_system.dart';
3+
import 'package:apidash_core/apidash_core.dart';
24
import '../consts.dart';
35
import '../models/terminal/models.dart';
6+
import '../utils/ui_utils.dart';
47
import 'expandable_section.dart';
58

69
class SystemLogTile extends StatelessWidget {
@@ -156,15 +159,18 @@ class _NetworkLogTileState extends State<NetworkLogTile> {
156159
@override
157160
Widget build(BuildContext context) {
158161
final n = widget.entry.network!;
159-
final methodUrl = '${n.method.name.toUpperCase()} ${n.url}';
160162
final status = n.responseStatus != null ? '${n.responseStatus}' : null;
161163
final duration =
162164
n.duration != null ? '${n.duration!.inMilliseconds} ms' : null;
163-
final title = [
164-
if (widget.requestName != null && widget.requestName!.isNotEmpty)
165-
'[${widget.requestName}]',
166-
methodUrl,
167-
].join(' ');
165+
final bodyStyle = Theme.of(context).textTheme.bodyMedium;
166+
final methodStyle = kCodeStyle.copyWith(
167+
fontWeight: FontWeight.bold,
168+
color: getAPIColor(
169+
APIType.rest,
170+
method: n.method,
171+
brightness: Theme.of(context).brightness,
172+
),
173+
);
168174
return Column(
169175
children: [
170176
InkWell(
@@ -183,11 +189,22 @@ class _NetworkLogTileState extends State<NetworkLogTile> {
183189
),
184190
],
185191
Expanded(
186-
child: Text(
187-
title,
192+
child: RichText(
193+
text: TextSpan(
194+
style: bodyStyle,
195+
children: [
196+
if (widget.requestName != null &&
197+
widget.requestName!.isNotEmpty) ...[
198+
TextSpan(text: '[${widget.requestName}] '),
199+
],
200+
TextSpan(
201+
text: n.method.name.toUpperCase(),
202+
style: methodStyle),
203+
TextSpan(text: ' ${n.url}'),
204+
],
205+
),
188206
maxLines: 1,
189207
overflow: TextOverflow.ellipsis,
190-
style: Theme.of(context).textTheme.bodyMedium,
191208
),
192209
),
193210
const SizedBox(width: 12),

0 commit comments

Comments
 (0)