Merge: Material host and controls on every platform

This commit is contained in:
2026-11-03 16:08:08 +00:00
13 changed files with 139 additions and 130 deletions
+8 -8
View File
@@ -1,8 +1,8 @@
import 'package:flutter/foundation.dart';
/// Browsers use Material consistently, regardless of their host OS.
bool prefersCupertino({bool web = kIsWeb, TargetPlatform? platform}) {
final target = platform ?? defaultTargetPlatform;
return !web &&
(target == TargetPlatform.iOS || target == TargetPlatform.macOS);
}
/// The app renders the same Material layout and design on every platform:
/// web, Android, iOS and macOS. The Cupertino host and controls remain
/// available only when a caller asks for them explicitly (`cupertino: true`);
/// they are never chosen from the target platform.
///
/// Flutter's automatic platform behaviours (scroll physics, text selection,
/// page transitions and back-swipe) still follow the target platform.
bool prefersCupertino() => false;