UiDrawer.compact constructor

UiDrawer.compact({
  1. Key? key,
  2. required String title,
  3. String? subtitle,
  4. Widget? avatar,
  5. required List<Widget> items,
  6. Widget? footer,
})

Compact variant (minimalist, no background color in header)

Implementation

factory UiDrawer.compact({
  Key? key,
  required String title,
  String? subtitle,
  Widget? avatar,
  required List<Widget> items,
  Widget? footer,
}) {
  return UiDrawer(
    key: key,
    items: items,
    footer: footer,
    header: Padding(
      padding: const EdgeInsets.all(16),
      child: Row(
        children: [
          avatar ??
              const CircleAvatar(
                radius: 24,
                child: Icon(Icons.person, size: 28),
              ),
          const SizedBox(width: 12),
          Expanded(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  title,
                  style: const TextStyle(
                    fontSize: 16,
                    fontWeight: FontWeight.bold,
                  ),
                ),
                if (subtitle != null)
                  Text(
                    subtitle,
                    style: const TextStyle(fontSize: 13, color: Colors.grey),
                  ),
              ],
            ),
          ),
        ],
      ),
    ),
  );
}