Repository: flutter
Issue: Flutter detects animations as disabled on Ubuntu (when they're not)
Labels: engine,a: animation,platform-linux,P2,team-linux,triaged-linux

### Steps to reproduce

1. Install clean Ubuntu 24.04.1 LTS (latest long-term support version)
1. `flutter create` a new application
2. `flutter run` as a Linux app
3. Notice that there are no animations (such as when tapping a button)
4. Add the following lines to `lib/main.dart`'s `main()` function:

```dart
  final binding = WidgetsFlutterBinding.ensureInitialized();
  debugPrint('disable_animations=${binding.disableAnimations}');
```
5. Run again on Ubuntu and notice it says `disable_animations=true`. Run anywhere else and it says `disable_animations=false`.
6. Check that animations are _not_ disabled in the system:
  
![Screenshot 2024-10-01 at 08 53 21](https://github.com/user-attachments/assets/13085a9c-edf2-4731-bd1a-cc95c1623f70)


### Expected results

App runs according to system settings. (Other apps do show animations.)

### Actual results

Flutter app doesn't detect animations as disabled when they're not.

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  final binding = WidgetsFlutterBinding.ensureInitialized();
  debugPrint('disable_animations=${binding.disableAnimations}');

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}

```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

Sorry, I don't have time to figure out how to record the screen on Ubuntu right now but there's an old, related issue here: https://github.com/flutter/flutter/issues/116511. That one has the video of an animation going too fast on Linux.

That issue was closed because the user was happy with switching animations on with `gdbus call --session --dest org.freedesktop.portal.Desktop --object-path /org/freedesktop/portal/desktop --method org.freedesktop.portal.Settings.Read org.gnome.desktop.interface enable-animations`. But that only solves the issue on their own computer. 

I think the issue is that Flutter detects a different `animations_enabled` setting than the rest of Ubuntu apps. Or maybe Ubuntu just disables animations (at some level) by default and most apps choose to ignore it? In any case, the end result is that Flutter apps look like they were on fast forward on Ubuntu.

This might be an issue on other Linux distros than Ubuntu, but Ubuntu being the most popular makes it bad enough even if it's just Ubuntu.

</details>





### Logs

_No response_

### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
flutter doctor -v
[✓] Flutter (Channel stable, 3.24.3, on Ubuntu 24.04.1 LTS 6.8.0-45-generic, locale en_US.UTF-8)
    • Flutter version 3.24.3 on channel stable at /home/filip/SDKs/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2663184aa7 (3 weeks ago), 2024-09-11 16:27:48 -0500
    • Engine revision 36335019a8
    • Dart version 3.5.3
    • DevTools version 2.37.3

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/to/linux-android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 18.1.3 (1ubuntu1)
    • cmake version 3.28.3
    • ninja version 1.11.1
    • pkg-config version 1.8.1

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/to/linux-android-setup for detailed instructions).

[✓] VS Code (version 1.93.1)
    • VS Code at /usr/share/code
    • Flutter extension version 3.98.0

[✓] Connected device (1 available)
    • Linux (desktop) • linux • linux-x64 • Ubuntu 24.04.1 LTS 6.8.0-45-generic

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 3 categories.
```

</details>