stryder-dev / flutter_platform_widgets

Target the specific design of Material for Android and Cupertino for iOS widgets through a common set of Platform aware widgets
MIT License
1.57k stars 171 forks source link

`PlatformIconButton` in `PlatformTabScaffold`'s `trailingActions` not using `actionsIconTheme` `IconThemeData` #458

Open martin-braun opened 3 months ago

martin-braun commented 3 months ago

In my theme, I have:

      appBarTheme: base.appBarTheme.copyWith(
        backgroundColor: colorScheme.primary,
        titleTextStyle: textTheme.displaySmall!.copyWith(
          color: colorScheme.onPrimary,
        ),
        centerTitle: false,
        titleSpacing: textTheme.displaySmall!.fontSize! / 4,
        actionsIconTheme: IconThemeData(
          color: envPrimaryContrastColor,
          size: textTheme.displaySmall!.fontSize,
          applyTextScaling: true,
        ),
      ),

Then within my HomeScreen:

  Widget build(BuildContext context) {
    return PlatformTabScaffold(
      appBarBuilder: (_, index) => PlatformAppBar(
        title: Text(widget.title),
        trailingActions: [
          IconButton(
            icon: const Icon(Icons.signal_cellular_alt),
            onPressed: () {},
          ),
        ],
// ...

This works:

image

However, when using the PlatformIconButton:

  Widget build(BuildContext context) {
    return PlatformTabScaffold(
      appBarBuilder: (_, index) => PlatformAppBar(
        title: Text(widget.title),
        trailingActions: [
          PlatformIconButton(
            icon: const Icon(Icons.signal_cellular_alt),
          ),
        ],
// ...

It does not work:

image