import 'package:flutter/material.dart'; import '../../../ui/text/plural.dart'; /// The gallery's secondary, collapsed entry for a run's debugging files. /// /// It follows the deliverables (or stands alone when there are none), so a /// run that recorded only runner-internal files says how many there are and /// opens them in place instead of leaving the page apparently empty. class ArtifactDebugReveal extends StatelessWidget { const ArtifactDebugReveal({ super.key, required this.count, required this.showing, required this.onToggle, }); /// The recorded debugging files the section holds. final int count; /// Whether the debugging files are currently listed. final bool showing; final VoidCallback onToggle; @override Widget build(BuildContext context) { return Material( type: MaterialType.transparency, child: ListTile( key: const Key('artifact-debug-reveal'), leading: Icon(showing ? Icons.bug_report : Icons.bug_report_outlined), title: Text(showing ? 'Hide debugging files' : 'Show debugging files'), subtitle: Text( '${countLabel(count, 'file')}: turn documents, history and ' 'private scratch', ), trailing: Icon(showing ? Icons.expand_less : Icons.expand_more), onTap: onToggle, ), ); } }