Tous les articles
FlutterDartMobile

Flutter 3.41: Dart 3.9, Impeller on Web, and the New Widget APIs

//
·7 min de lecture

Flutter 3.41 ships Dart 3.9 with dot shorthands, brings Impeller to WebAssembly, adds CarouselView builder support, and deprecates color.withOpacity() for good.

Flutter 3.41 landed on February 11, 2026 alongside Dart 3.9 and full support for iOS 26, Xcode 26 and macOS 26. The release expands the windowing API to Linux, macOS and Win32, brings the Impeller renderer to the web via WebAssembly, and ships several Material 3 component improvements. Here is what changed and what you need to migrate.

>Dart 3.9 — dot shorthands

The headline language feature in Dart 3.9 is dot shorthands: when the type is unambiguous from context, you can omit the class name before a static member or constructor.

Dart
// Before Dart 3.9
Text('Hello', style: TextStyle(color: Colors.blue));
Widget build(BuildContext ctx) => Container(alignment: Alignment.center);

// Dart 3.9 — dot shorthands (type inferred from context)
Text('Hello', style: TextStyle(color: .blue));
Widget build(BuildContext ctx) => Container(alignment: .center);

// Works with enums, named constructors, static members
Future<void> request() async {
  final method = HttpMethod.get; // before
  final method = .get;           // after — HttpMethod inferred
}

NOTEDot shorthands are purely syntactic sugar. Run dart fix --apply — the automated migration does not rewrite existing code, but the analyzer will suggest them as hints.

>Breaking: color.withOpacity() deprecated

⚠ BREAKINGcolor.withOpacity() is deprecated in 3.41. Replace it with color.withValues(alpha: x) across your codebase.

Dart
// ✗ Deprecated — triggers lint warning
final overlay = Colors.black.withOpacity(0.5);

// ✓ Correct in 3.41+
final overlay = Colors.black.withValues(alpha: 0.5);

// Bulk migrate with sed or dart fix
// dart fix --apply  (covers most cases automatically)

>New widget APIs

CarouselView.weighted (builder support)

Dart
CarouselView.weighted(
  flexWeights: const [3, 2, 1],   // relative widths of visible items
  itemSnapping: true,
  children: items.map((item) => CarouselCard(item: item)).toList(),
)

RepeatingAnimationBuilder

Declarative repeating animations without managing an AnimationController manually.

Dart
RepeatingAnimationBuilder(
  duration: const Duration(seconds: 2),
  curve: Curves.easeInOut,
  builder: (context, value, child) {
    return Transform.scale(
      scale: 1.0 + 0.2 * value,
      child: child,
    );
  },
  child: const Icon(Icons.favorite),
)

Navigator.popUntilWithResult

Dart
// Pop routes until predicate is met, returning a value to the caller
final result = await Navigator.of(context).popUntilWithResult<String>(
  (route) => route.isFirst,
  result: 'done',
);

Semantics.blockAccessibilityFocus

Dart
Semantics(
  blockAccessibilityFocus: true,  // prevents focus from entering subtree
  child: AnimatedSplashOverlay(),
)

>Impeller on Web (WebAssembly)

Impeller now runs experimentally on Flutter Web via WebAssembly (wimp — WebAssembly IMPeller). It replaces both CanvasKit and the legacy HTML renderer with a single, consistent pipeline.

bash
# Opt in during development
flutter run -d chrome --web-renderer=impeller-wasm

# Check status
flutter build web --web-renderer=impeller-wasm

NOTEImpeller on Web is experimental in 3.41. File issues if you encounter rendering differences versus the CanvasKit baseline.

>Windowing API — desktop expansion

Regular windows, dialog windows and tooltip windows are now implemented for Linux (GTK), macOS and Win32. This API was previously only available on a subset of platforms.

Dart
import 'package:flutter/services.dart';

// Create a secondary window (multi-window apps)
final windowId = await FlutterWindowManager.createWindow(
  options: const WindowOptions(
    title: 'Settings',
    size: Size(480, 640),
    windowType: WindowType.dialog,
  ),
);

>Upgrade path

bash
flutter upgrade                # pull latest stable (3.41.x)
flutter --version             # confirm 3.41
dart --version                # confirm 3.9

# Fix deprecations automatically
dart fix --apply

# Profile on target device — Impeller is default on Android + iOS
flutter run --profile