ubuntu / yaru.dart

Ubuntu Yaru Flutter widgets and themes for building desktop and web applications
https://ubuntu.github.io/yaru.dart/
Mozilla Public License 2.0
179 stars 33 forks source link

fix(YaruMasterDetailPage): bring back sidebar color option #826

Closed Feichtmeier closed 5 months ago

Feichtmeier commented 5 months ago

I am not entirely sure what removed the sidebar color, but I think it was the undershot :thinking:

However, it is back (if changed in the theme) The default remains as in master.

Result of

  @override
  Widget build(BuildContext context) {
    return YaruMasterDetailTheme(
      data: YaruMasterDetailTheme.of(context)
          .copyWith(sideBarColor: Colors.pink.withOpacity(0.2)),
      child: YaruMasterDetailPage(
        initialIndex: 1,
        layoutDelegate: const YaruMasterResizablePaneDelegate(
          initialPaneWidth: 280,
          minPageWidth: kYaruMasterDetailBreakpoint / 2,
          minPaneWidth: 175,
        ),
        length: pageItems.length,
        tileBuilder: (context, index, selected, availableWidth) =>
            YaruMasterTile(
          leading: pageItems[index].iconBuilder(context, selected),
          title: buildTitle(context, pageItems[index]),
        ),
        pageBuilder: (context, index) => YaruDetailPage(
          appBar: YaruWindowTitleBar(
            backgroundColor: Colors.transparent,
            border: BorderSide.none,
            leading:
                Navigator.of(context).canPop() ? const YaruBackButton() : null,
            title: buildTitle(context, pageItems[index]),
          ),
          body: pageItems[index].pageBuilder(context),
          floatingActionButton: CodeSnippedButton(
            pageItem: pageItems[index],
          ),
        ),
        appBar: const YaruWindowTitleBar(
          title: Text('Yaru Widgets'),
          backgroundColor: Colors.transparent,
          border: BorderSide.none,
        ),
        bottomBar: Padding(
          padding: const EdgeInsets.symmetric(vertical: 8.0),
          child: YaruMasterTile(
            leading: const Icon(YaruIcons.gear),
            title: const Text('Settings'),
            onTap: () => showSettingsDialog(context),
          ),
        ),
      ),
    );
  }

grafik