Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[android] - Multitasking logo background color follows the theme #112012

Closed
Macacoazul01 opened this issue Sep 20, 2022 · 11 comments
Closed

[android] - Multitasking logo background color follows the theme #112012

Macacoazul01 opened this issue Sep 20, 2022 · 11 comments
Labels
found in release: 3.3 Found to occur in 3.3 found in release: 3.4 Found to occur in 3.4 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-android Android applications specifically r: solved Issue is closed as solved

Comments

@Macacoazul01
Copy link
Contributor

Macacoazul01 commented Sep 20, 2022

The multitasking logo background color on android follows the theme of the app instead of having the pre-determined color.

First I had thought that this problem was because of something wrong with flutter_launcher_icons

So there is this issue being tracked: #287

But running the counter app on the android simulator already shows the problem:

theme: ThemeData(
  primarySwatch: Colors.blue,
),

theme: ThemeData(
primarySwatch: Colors.red,
),

this issue isn't new (flutter 3.0 or 3.3 related).

my flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.2, on Microsoft Windows [versao 10.0.22000.978], locale pt-BR)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2021.2)
[√] VS Code (version 1.71.2)
[√] Connected device (4 available)
[√] HTTP Host Availability

! Doctor found issues in 1 category.
@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Sep 21, 2022
@danagbemava-nc danagbemava-nc changed the title [android] - Multitasking logo background color folows the theme [android] - Multitasking logo background color follows the theme Sep 21, 2022
@danagbemava-nc
Copy link
Member

I can reproduce this, but I'm not sure whether or not this is the intended behaviour.

Labeling for further insight from the team.

Note: using the code sample below, after switching the theme primary color, you might have to wait a little while or switch to a different app and come back to the app before you see the color change.

screenshots
primarySwatch: Colors.blue primarySwatch: Colors.green
Screenshot_1663765591 Screenshot_1663765622
code sample
import 'package:flutter/material.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  MaterialColor themeColor = Colors.blue;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Quick Actions Demo',
      theme: ThemeData(
        primarySwatch: themeColor,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: const Text("Changing Theme Color"),
        ),
        body: Center(
          child: Text('current color: $themeColor'),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            setState(() {
              if (themeColor == Colors.blue) {
                themeColor = Colors.green;
              } else {
                themeColor = Colors.blue;
              }
            });
          },
        ),
      ),
    );
  }
}
flutter doctor -v
[✓] Flutter (Channel stable, 3.3.2, on macOS 12.6 21G115 darwin-arm, locale en-GB)
    • Flutter version 3.3.2 on channel stable at /Users/nexus/dev/sdks/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision e3c29ec00c (7 days ago), 2022-09-14 08:46:55 -0500
    • Engine revision a4ff2c53d8
    • Dart version 2.18.1
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14A309
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] Android Studio (version 2021.2)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/212.5712.43.2112.8815526/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.71.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.48.0

[✓] Connected device (3 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64  • Android 13 (API 33) (emulator)
    • macOS (desktop)             • macos         • darwin-arm64   • macOS 12.6 21G115 darwin-arm
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 105.0.5195.125

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
[✓] Flutter (Channel master, 3.4.0-19.0.pre.406, on macOS 12.6 21G115 darwin-arm64, locale en-GB)
    • Flutter version 3.4.0-19.0.pre.406 on channel master at /Users/nexus/dev/sdks/flutters
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d98b0c9c7c (10 hours ago), 2022-09-20 23:35:24 -0400
    • Engine revision 38fef0572f
    • Dart version 2.19.0 (build 2.19.0-223.0.dev)
    • DevTools version 2.17.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14A309
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] Android Studio (version 2021.2)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/212.5712.43.2112.8815526/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.71.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.48.0

[✓] Connected device (3 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64  • Android 13 (API 33) (emulator)
    • macOS (desktop)             • macos         • darwin-arm64   • macOS 12.6 21G115 darwin-arm64
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 105.0.5195.125

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

@danagbemava-nc danagbemava-nc added platform-android Android applications specifically framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on found in release: 3.3 Found to occur in 3.3 found in release: 3.4 Found to occur in 3.4 and removed in triage Presently being triaged by the triage team labels Sep 21, 2022
@Macacoazul01
Copy link
Contributor Author

@danagbemava-nc i partially agree with you that maybe this should be the intended behavior, but only when there isn't a custom config for the logo.
It's bizarre that the mini logo on the menu of the phone/google play is different than the one on multitasking.

@goderbauer goderbauer added the engine flutter/engine repository. See also e: labels. label Sep 27, 2022
@Macacoazul01
Copy link
Contributor Author

@danagbemava-nc on ios this isn't a problem, everything works fine

@chinmaygarde
Copy link
Member

Closing this as working as intended. If you have a feature request on how the existing API can be updated to account for the behavior you are looking for, please file a new issue.

@dnfield dnfield removed the engine flutter/engine repository. See also e: labels. label Oct 3, 2022
@dnfield
Copy link
Contributor

dnfield commented Oct 3, 2022

This happens with the Title widget. You can control it by setting the color property on WidgetsApp or MaterialApp. You can see how that gets set here:

    final Color materialColor = widget.color ?? widget.theme?.primaryColor ?? Colors.blue;

This is documented here: https://api.flutter.dev/flutter/material/MaterialApp/color.html

Please feel free to ping this issue back if you looked somewhere else and expected to find this documentation but didn't.

@Macacoazul01
Copy link
Contributor Author

@chinmaygarde this doesn't make any sense. Why android should work like this and not ios?
Why should the app's logo background change with the theme?

So you're saying that my app on dark mode should have a different multitasking logo than the same app on light mode?🙃

@dnfield
Copy link
Contributor

dnfield commented Oct 3, 2022

Android and iOS work differently. There's no way on iOS to specify this color.

@dnfield dnfield reopened this Oct 3, 2022
@dnfield
Copy link
Contributor

dnfield commented Oct 3, 2022

We should update the docs on color to specify how it falls back.

@dnfield dnfield added the P2 Important issues not at the top of the work list label Oct 3, 2022
@Macacoazul01
Copy link
Contributor Author

@dnfield this will be really nice!
The current behavior is completely unintuitive without more info

@Macacoazul01
Copy link
Contributor Author

This happens with the Title widget. You can control it by setting the color property on WidgetsApp or MaterialApp. You can see how that gets set here:


    final Color materialColor = widget.color ?? widget.theme?.primaryColor ?? Colors.blue;

This is documented here: https://api.flutter.dev/flutter/material/MaterialApp/color.html

Please feel free to ping this issue back if you looked somewhere else and expected to find this documentation but didn't.

It worked!

@danagbemava-nc danagbemava-nc added the r: solved Issue is closed as solved label Oct 13, 2022
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
found in release: 3.3 Found to occur in 3.3 found in release: 3.4 Found to occur in 3.4 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-android Android applications specifically r: solved Issue is closed as solved
Projects
None yet
Development

No branches or pull requests

5 participants