1
1
import 'package:flutter/material.dart' ;
2
+ import 'package:apidash_design_system/apidash_design_system.dart' ;
3
+ import 'package:apidash_core/apidash_core.dart' ;
2
4
import '../consts.dart' ;
3
5
import '../models/terminal/models.dart' ;
6
+ import '../utils/ui_utils.dart' ;
4
7
import 'expandable_section.dart' ;
5
8
6
9
class SystemLogTile extends StatelessWidget {
@@ -156,15 +159,18 @@ class _NetworkLogTileState extends State<NetworkLogTile> {
156
159
@override
157
160
Widget build (BuildContext context) {
158
161
final n = widget.entry.network! ;
159
- final methodUrl = '${n .method .name .toUpperCase ()} ${n .url }' ;
160
162
final status = n.responseStatus != null ? '${n .responseStatus }' : null ;
161
163
final duration =
162
164
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
+ );
168
174
return Column (
169
175
children: [
170
176
InkWell (
@@ -183,11 +189,22 @@ class _NetworkLogTileState extends State<NetworkLogTile> {
183
189
),
184
190
],
185
191
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
+ ),
188
206
maxLines: 1 ,
189
207
overflow: TextOverflow .ellipsis,
190
- style: Theme .of (context).textTheme.bodyMedium,
191
208
),
192
209
),
193
210
const SizedBox (width: 12 ),
0 commit comments