largeMemoryFilesNotice top-level property
Large memory files notice.
Implementation
final StatusNoticeDefinition largeMemoryFilesNotice = StatusNoticeDefinition(
id: 'large-memory-files',
type: StatusNoticeType.warning,
isActive: (ctx) => getLargeMemoryFiles(ctx.memoryFiles).isNotEmpty,
render: (ctx, context) {
final theme = Theme.of(context);
final largeFiles = getLargeMemoryFiles(ctx.memoryFiles);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: largeFiles.map((file) {
return Padding(
padding: const EdgeInsets.only(bottom: 4),
child: Row(
children: [
Icon(
Icons.warning_amber,
size: 16,
color: theme.colorScheme.error,
),
const SizedBox(width: 6),
Expanded(
child: Text.rich(
TextSpan(
children: [
const TextSpan(text: 'Large '),
TextSpan(
text: _displayPath(file.path),
style: const TextStyle(fontWeight: FontWeight.bold),
),
TextSpan(
text:
' will impact performance (${_formatNumber(file.content.length)} chars'
' > ${_formatNumber(maxMemoryCharacterCount)})',
),
TextSpan(
text: ' \u00B7 /memory to edit',
style: TextStyle(
color: theme.colorScheme.onSurfaceVariant.withValues(
alpha: 0.6,
),
),
),
],
),
style: TextStyle(
fontSize: 12,
color: theme.colorScheme.error,
),
),
),
],
),
);
}).toList(),
);
},
);