---
title: Today's Flutter Windows object model
---
flowchart LR
subgraph "Windows embedder (internal)"
FlutterWindowsEngine
FlutterWindowsView
FlutterDesktopViewControllerState
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class TextFieldSample extends StatelessWidget { | |
const TextFieldSample({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return CallbackShortcuts( | |
bindings: <ShortcutActivator, VoidCallback>{ | |
// This causes the shortcut to handle the 'a' key event |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS C:\Code\f\flutter\packages\flutter\test_fixes> dart --version | |
Dart SDK version: 3.1.0-232.0.dev (dev) (Tue Jun 20 05:07:42 2023 -0700) on "windows_x64" | |
PS C:\Code\f\flutter\packages\flutter\test_fixes> dart fix --compare-to-golden | |
Computing fixes in test_fixes... | |
Error from the analysis server: Exception while getting bulk fixes: Exception generating fix for MISSING_REQUIRED_ARGUMENT in c:\code\f\flutter\packages\flutter\test_fixes\services\services.dart | |
Bad state: No element | |
#0 List.last (dart:core-patch/growable_array.dart:348:5) | |
#1 ModifyParameters.apply (package:analysis_server/src/services/correction/fix/data_driven/modify_parameters.dart:129:36) | |
#2 DataDrivenFix.compute.<anonymous closure> (package:analysis_server/src/services/correction/dart/data_driven.dart:105:20) | |
#3 ChangeBuilderImpl.addDartFileEdit (package:analyzer_plugin/src/utilities/change_builder/change_builder_core.dart:151:26) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Create a view. The view controller takes ownership of the engine. | |
auto controller = FlutterDesktopViewControllerCreate(width, height, engine); | |
auto view = FlutterDesktopViewControllerGetView(controller); | |
HWND hwnd = FlutterDesktopViewGetHWND(view); | |
// Attach the view's HWND to the window... | |
// Run app... | |
// Destroy the view controller. This also destroys the view and the engine. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Net.Http.Json; | |
public class CurrencyRepo : RepoBase, ICurrencyRepo | |
{ | |
private readonly HttpClient _http; | |
private readonly string _baseUrl; | |
public CurrencyRepo( | |
HttpClient http, | |
string baseUrl) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
void main() => runApp(const MyApp()); | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override | |
Widget build(BuildContext context) { |
The Windows Flutter SDK v3.7.12-stable.zip is 873MB. Here are the top 100 largest compressed items:
file: compressed file size
flutter/.pub-preload-cache/flutter_gallery_assets-1.0.2.tar.gz: 82.5MB
flutter/.git/objects/pack/pack-c596e5cc21ec5194eeaf69bf7115fb05e1a47638.pack: 69.8MB
flutter/bin/cache/artifacts/engine/windows-x64/flutter_windows.dll.pdb: 50.7MB
flutter/bin/cache/artifacts/engine/windows-x64-profile/flutter_windows.dll.pdb: 46.6MB
In Flutter 3.7 we introduced a new embedder API for semantics update (flutter/engine#37129):
/// A batch of updates to semantics nodes and custom actions.
typedef struct {
/// The size of the struct. Must be sizeof(FlutterSemanticsUpdate).
Let's say your app is misbehaving because of a Flutter engine bug. Let's debug that!
Let's open your app using Visual Studio:
- Run
flutter build windows
to ensure Flutter has generated a Visual Studio project for your app. - Open
./build/windows/ALL_BUILD.vcxproj
in Visual Studio. This project builds the native entry point for your Flutter app.