-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Workaround
If your Flutter Windows application is affected by this issue, please update your windows/runner/main.cpp file:
flutter::DartProject project(L"data");
+ // TODO: Remove this.
+ // This forces Flutter to use a separate thread for Dart.
+ // This mode will be removed in a future version of Flutter.
+ project.set_ui_thread_policy(flutter::UIThreadPolicy::RunOnSeparateThread);This is a temporary workaround until we fix this issue.
Issue
FPS chart (from MSI Afterburner) shows that release version of the same flutter app works good on previous stable release and bad on new stable release.
Screen.Recording.2025-11-21.at.11.51.56.mp4
Old stable release: constant 120fps during animations
New stable release: up to 40fps during animations
Also, the task manager shows that overall GPU usage on new flutter version is x3-4 times lower then on previous stable version (for some reason flutter does not use all gpu power now and limits itself), while cpu usage is very low on both versions.
flutter run -d windows --profile tests:
dart_devtools_2025-11-21_11_59_04.351.json
dart_devtools_2025-11-21_12_07_01.041.json
Issue is NOT linked to this specific code sample, i can reproduce it with any flutter app, but this is the code that was used to demonstrate regression
import 'package:flutter/material.dart';
void main() {
runApp(const MaterialApp(
debugShowCheckedModeBanner: false,
home: WindowsPerformanceDemo(),
));
}
class WindowsPerformanceDemo extends StatelessWidget {
const WindowsPerformanceDemo({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xFFF0F2F5),
body: Center(
child: SizedBox(
width: 1000,
height: 600,
child: GridView.builder(
padding: const EdgeInsets.all(20),
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4,
crossAxisSpacing: 20,
mainAxisSpacing: 20,
childAspectRatio: 16 / 9,
),
itemCount: 8,
itemBuilder: (context, index) {
return DesktopHoverCard(index: index);
},
),
),
),
);
}
}
class DesktopHoverCard extends StatefulWidget {
final int index;
const DesktopHoverCard({super.key, required this.index});
@override
State<DesktopHoverCard> createState() => _DesktopHoverCardState();
}
class _DesktopHoverCardState extends State<DesktopHoverCard> {
bool _isHovered = false;
@override
Widget build(BuildContext context) {
return MouseRegion(
onEnter: (_) => setState(() => _isHovered = true),
onExit: (_) => setState(() => _isHovered = false),
cursor: SystemMouseCursors.click,
child: AnimatedScale(
scale: _isHovered ? 1.05 : 1.0,
duration: const Duration(milliseconds: 200),
curve: Curves.easeOutCubic,
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(_isHovered ? 0.2 : 0.1),
blurRadius: _isHovered ? 20 : 10,
offset: const Offset(0, 4),
),
],
),
clipBehavior: Clip.antiAlias,
child: Stack(
fit: StackFit.expand,
children: [
Image.network(
'https://picsum.photos/id/${widget.index + 50}/500/300',
fit: BoxFit.cover,
),
Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [Colors.transparent, Colors.black54],
),
),
),
Align(
alignment: Alignment.bottomLeft,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
'Windows Item ${widget.index + 1}',
style: const TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
),
),
],
),
),
),
);
}
}Doctor v
[√] Flutter (Channel stable, 3.38.2, on Microsoft Windows [Version 10.0.26100.6899], locale en-US) [359ms]
• Flutter version 3.38.2 on channel stable at C:\SDKS\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f5a8537f90 (3 days ago), 2025-11-18 09:27:21 -0500
• Engine revision b5990e5ccc
• Dart version 3.10.0
• DevTools version 2.51.1
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file,
enable-lldb-debugging
[√] Windows Version (Windows 11 or higher, 24H2, 2009) [4.5s]
[X] Android toolchain - develop for Android devices [239ms]
X 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/windows-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.
[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe) [161ms]
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[√] Visual Studio - develop Windows apps (Visual Studio Professional 2022 17.14.21 (November 2025)) [158ms]
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Professional
• Visual Studio Professional 2022 version 17.14.36717.8
• Windows 10 SDK version 10.0.26100.0
[√] Connected device (2 available) [196ms]
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.26100.6899]
• Edge (web) • edge • web-javascript • Microsoft Edge 142.0.3595.90
[√] Network resources [380ms]
• All expected network resources are available.
! Doctor found issues in 2 categories.
