Merge: Material host and controls on every platform
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user