buildActions method
Optional actions to show in the console toolbar
Implementation
@override
List<Widget> buildActions(BuildContext context) {
return [
IconButton(
tooltip: 'Export Network Logs',
icon: const Icon(Icons.share),
onPressed: () {
final logs = NetworkLogStore.logs;
final json = jsonEncode(logs.map((e) => e.toJson()).toList());
final fileName = 'Network Logs';
ExportUtil.exportData(text: json, title: fileName);
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Exported network logs')),
);
},
),
];
}