Skip to content

🐛 CommandBar inside PageHeader makes layout crash #642

@h3x4d3c1m4l

Description

@h3x4d3c1m4l

Describe the bug
When adding a CommandBar to a PageHeader using the commandBar property, the layout seems to screw up and Flutter starts spamming errors.

To Reproduce
Minimal repo:

import 'package:fluent_ui/fluent_ui.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return FluentApp(
      title: 'Flutter Demo',
      home: ScaffoldPage(
        header: Text('Meh'),
        content: PageHeader(
          title: Text('My Title'),
          // will crash:
          commandBar: CommandBar(
            primaryItems: [CommandBarButton(onPressed: () {}, label: Text('my label'))],
          ),
          // works fine:
          // commandBar: Row(
          //   children: [
          //     IconButton(icon: const Icon(FluentIcons.globe, size: 16), onPressed: () {})
          //   ],
          // ),
        ),
      ),
    );
  }
}

Expected behavior
CommandBar should work fine inside a PageHeader.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions