💄 Optimize runtime log screen
This commit is contained in:
parent
ae9743c84f
commit
e933058338
@ -77,23 +77,25 @@ class DebugLoggingScreen extends StatelessWidget {
|
|||||||
'${log.requestOptions.method} ${log.displayMessage}',
|
'${log.requestOptions.method} ${log.displayMessage}',
|
||||||
style: GoogleFonts.robotoMono(fontSize: 13),
|
style: GoogleFonts.robotoMono(fontSize: 13),
|
||||||
),
|
),
|
||||||
Theme(
|
if (log.requestOptions.data != null)
|
||||||
data: Theme.of(context).copyWith(
|
Theme(
|
||||||
dividerColor: Colors.transparent,
|
data: Theme.of(context).copyWith(
|
||||||
|
dividerColor: Colors.transparent,
|
||||||
|
),
|
||||||
|
child: ExpansionTile(
|
||||||
|
title: Text('Payload').fontSize(13),
|
||||||
|
minTileHeight: 0,
|
||||||
|
tilePadding: EdgeInsets.zero,
|
||||||
|
expandedCrossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
log.requestOptions.data.toString(),
|
||||||
|
style: GoogleFonts.robotoMono(fontSize: 13),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: ExpansionTile(
|
|
||||||
title: Text('Payload').fontSize(13),
|
|
||||||
minTileHeight: 0,
|
|
||||||
tilePadding: EdgeInsets.zero,
|
|
||||||
expandedCrossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
log.requestOptions.data.toString(),
|
|
||||||
style: GoogleFonts.robotoMono(fontSize: 13),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
else if (log is DioResponseLog)
|
else if (log is DioResponseLog)
|
||||||
@ -104,23 +106,25 @@ class DebugLoggingScreen extends StatelessWidget {
|
|||||||
'${log.response.statusCode} ${log.displayMessage}',
|
'${log.response.statusCode} ${log.displayMessage}',
|
||||||
style: GoogleFonts.robotoMono(fontSize: 13),
|
style: GoogleFonts.robotoMono(fontSize: 13),
|
||||||
),
|
),
|
||||||
Theme(
|
if (log.response.data != null)
|
||||||
data: Theme.of(context).copyWith(
|
Theme(
|
||||||
dividerColor: Colors.transparent,
|
data: Theme.of(context).copyWith(
|
||||||
|
dividerColor: Colors.transparent,
|
||||||
|
),
|
||||||
|
child: ExpansionTile(
|
||||||
|
title: Text('Payload').fontSize(13),
|
||||||
|
minTileHeight: 0,
|
||||||
|
tilePadding: EdgeInsets.zero,
|
||||||
|
expandedCrossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
log.response.data.toString(),
|
||||||
|
style: GoogleFonts.robotoMono(fontSize: 13),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: ExpansionTile(
|
|
||||||
title: Text('Payload').fontSize(13),
|
|
||||||
minTileHeight: 0,
|
|
||||||
tilePadding: EdgeInsets.zero,
|
|
||||||
expandedCrossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
log.response.data.toString(),
|
|
||||||
style: GoogleFonts.robotoMono(fontSize: 13),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
@ -151,9 +155,7 @@ class DebugLoggingScreen extends StatelessWidget {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(
|
Clipboard.setData(
|
||||||
ClipboardData(
|
ClipboardData(
|
||||||
text: ['[${log.time}]', log.message, log.error?.toString()]
|
text: log.generateTextMessage(),
|
||||||
.where((ele) => ele != null)
|
|
||||||
.join('\n'),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user