build static method

List<Widget> build(
  1. BuildContext context
)

Returns the Widgets of this TilesSection.

Implementation

static List<Widget> build(BuildContext context) {
  final style = Theme.of(context).style;

  return [
    const Headlines(
      children: [
        (
          headline: 'ContextMenu(desktop)',
          widget: ContextMenu(
            actions: [
              ContextMenuButton(label: 'Action 1'),
              ContextMenuButton(label: 'Action 2'),
              ContextMenuButton(label: 'Action 3'),
              ContextMenuDivider(),
              ContextMenuButton(label: 'Action 4'),
            ],
          ),
        ),
        (
          headline: 'ContextMenu(mobile)',
          widget: ContextMenu(
            enlarged: true,
            actions: [
              ContextMenuButton(label: 'Action 1', enlarged: true),
              ContextMenuButton(label: 'Action 2', enlarged: true),
              ContextMenuButton(label: 'Action 3', enlarged: true),
              ContextMenuButton(label: 'Action 4', enlarged: true),
            ],
          ),
        ),
      ],
    ),
    Headlines(
      color: Color.alphaBlend(
        style.sidebarColor,
        style.colors.onBackgroundOpacity7,
      ),
      children: [
        (
          headline: 'RecentChatTile',
          widget: RecentChatTile(DummyRxChat(), onTap: () {}),
        ),
        (
          headline: 'RecentChatTile(selected)',
          widget: RecentChatTile(DummyRxChat(), onTap: () {}, selected: true),
        ),
        (
          headline: 'RecentChatTile(trailing)',
          widget: RecentChatTile(
            DummyRxChat(),
            onTap: () {},
            selected: false,
            trailing: const [SelectedDot(selected: false, size: 20)],
          ),
        ),
      ],
    ),
    Headlines(
      color: Color.alphaBlend(
        style.sidebarColor,
        style.colors.onBackgroundOpacity7,
      ),
      children: [
        (
          headline: 'ChatTile',
          widget: ChatTile(chat: DummyRxChat(), onTap: () {}),
        ),
        (
          headline: 'ChatTile(selected)',
          widget: ChatTile(chat: DummyRxChat(), onTap: () {}, selected: true),
        ),
      ],
    ),
    Builder(
      builder: (context) {
        final MyUser myUser = MyUser(
          id: const UserId('123'),
          num: UserNum('1234123412341234'),
          emails: MyUserEmails(confirmed: []),
          phones: MyUserPhones(confirmed: []),
          presenceIndex: 0,
          online: true,
        );

        return Headlines(
          color: Color.alphaBlend(
            style.sidebarColor,
            style.colors.onBackgroundOpacity7,
          ),
          children: [
            (
              headline: 'ContactTile',
              widget: ContactTile(myUser: myUser, onTap: () {}),
            ),
            (
              headline: 'ContactTile(selected)',
              widget: ContactTile(
                myUser: myUser,
                onTap: () {},
                selected: true,
              ),
            ),
            (
              headline: 'ContactTile(trailing)',
              widget: ContactTile(
                myUser: myUser,
                onTap: () {},
                selected: false,
                trailing: const [SelectedDot(selected: false, size: 20)],
              ),
            ),
          ],
        );
      },
    ),
  ];
}