flutter_platform_widgets icon indicating copy to clipboard operation
flutter_platform_widgets copied to clipboard

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

Open martin-braun opened this issue 1 month ago • 0 comments

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

martin-braun avatar May 20 '24 17:05 martin-braun