flutter Chip 组件


前言

Chip 组件,是一个简单而精美的组件,但是它有几个变体,例如InputChip、ChoiceChip、FilterChip 和ActionChip。记录一下


Chip() 及变体的简单使用

Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: [
            Chip(
              avatar: CircleAvatar(
                backgroundColor: Colors.grey.shade800,
                child: const Text('AB'),   ),
              label: const Text('Aaron Burr'),
            ),

            InputChip(
              avatar: CircleAvatar(
                backgroundColor: Colors.grey.shade800,
                child: const Text('AB'),   ),
              label: const Text('Aaron Burr'),
            ),

            ChoiceChip(
              avatar: CircleAvatar(
                backgroundColor: Colors.grey.shade800,
                child: const Text('AB'),   ),
              label: const Text('Aaron Burr'), selected: false,
            ),

            FilterChip(
              avatar: CircleAvatar(
                backgroundColor: Colors.grey.shade800,
                child: const Text('AB'),   ),
              label: const Text('Aaron Burr'), onSelected: (bool value) {
    
      },
            ),

            ActionChip(
              avatar: CircleAvatar(
                backgroundColor: Colors.grey.shade800,
                child: const Text('AB'),   ),
              label: const Text('Aaron Burr'),
            ),
          ],
        )

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/u010755471/article/details/127981510