import 'package:flutter/material.dart'; /// Modern null-safe widget list compaction. /// Filters out null values from a list of nullable widgets. /// Example: compactWidgets([widget1, null, widget2]) → [widget1, widget2] List compactWidgets(List children) => children.whereType().toList(); /// String truncation for debug output and logging. /// Truncates a string to [end] characters and appends '...' /// Example: ellipse('abcdefgh', 4) → 'abcd...' String ellipse(String s, [int end = 4]) => s.length > end ? '${s.substring(0, end)}...' : s;