From 78c0e9d475257ff9a4dc79eaa9dc61a16e6a0c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=80=D0=BA=D0=BE=D0=B2=20=D0=A1=D0=B5=D1=80?= =?UTF-8?q?=D0=B3=D0=B5=D0=B9=20=D0=92=D0=B8=D0=BA=D1=82=D0=BE=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B8=D1=87?= Date: Mon, 27 Nov 2023 09:49:00 +0300 Subject: [PATCH] fix defaults for TargetPlatform because of new TargetPlatform.aurora --- .../neon/neon/lib/src/utils/adaptive.dart | 7 +++--- .../widgets/adaptive_widgets/list_tile.dart | 25 ++++++++++--------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/packages/neon/neon/lib/src/utils/adaptive.dart b/packages/neon/neon/lib/src/utils/adaptive.dart index f2c3a4de..928d3436 100644 --- a/packages/neon/neon/lib/src/utils/adaptive.dart +++ b/packages/neon/neon/lib/src/utils/adaptive.dart @@ -7,13 +7,14 @@ bool isCupertino(final BuildContext context) { final theme = Theme.of(context); switch (theme.platform) { + case TargetPlatform.iOS: + case TargetPlatform.macOS: + return true; case TargetPlatform.android: case TargetPlatform.fuchsia: case TargetPlatform.linux: case TargetPlatform.windows: + default: return false; - case TargetPlatform.iOS: - case TargetPlatform.macOS: - return true; } } diff --git a/packages/neon/neon/lib/src/widgets/adaptive_widgets/list_tile.dart b/packages/neon/neon/lib/src/widgets/adaptive_widgets/list_tile.dart index e0392fe7..ea69c50d 100644 --- a/packages/neon/neon/lib/src/widgets/adaptive_widgets/list_tile.dart +++ b/packages/neon/neon/lib/src/widgets/adaptive_widgets/list_tile.dart @@ -88,18 +88,6 @@ class AdaptiveListTile extends StatelessWidget { final theme = Theme.of(context); switch (theme.platform) { - case TargetPlatform.android: - case TargetPlatform.fuchsia: - case TargetPlatform.linux: - case TargetPlatform.windows: - return ListTile( - title: title, - subtitle: subtitle, - leading: leading, - trailing: trailing, - onTap: onTap, - enabled: enabled, - ); case TargetPlatform.iOS: case TargetPlatform.macOS: final tile = CupertinoListTile( @@ -130,6 +118,19 @@ class AdaptiveListTile extends StatelessWidget { } return tile; + case TargetPlatform.android: + case TargetPlatform.fuchsia: + case TargetPlatform.linux: + case TargetPlatform.windows: + default: + return ListTile( + title: title, + subtitle: subtitle, + leading: leading, + trailing: trailing, + onTap: onTap, + enabled: enabled, + ); } } }