Browse Source

fix defaults for TargetPlatform because of new TargetPlatform.aurora

aurora
Марков Сергей Викторович 1 year ago
parent
commit
78c0e9d475
  1. 7
      packages/neon/neon/lib/src/utils/adaptive.dart
  2. 25
      packages/neon/neon/lib/src/widgets/adaptive_widgets/list_tile.dart

7
packages/neon/neon/lib/src/utils/adaptive.dart

@ -7,13 +7,14 @@ bool isCupertino(final BuildContext context) {
final theme = Theme.of(context); final theme = Theme.of(context);
switch (theme.platform) { switch (theme.platform) {
case TargetPlatform.iOS:
case TargetPlatform.macOS:
return true;
case TargetPlatform.android: case TargetPlatform.android:
case TargetPlatform.fuchsia: case TargetPlatform.fuchsia:
case TargetPlatform.linux: case TargetPlatform.linux:
case TargetPlatform.windows: case TargetPlatform.windows:
default:
return false; return false;
case TargetPlatform.iOS:
case TargetPlatform.macOS:
return true;
} }
} }

25
packages/neon/neon/lib/src/widgets/adaptive_widgets/list_tile.dart

@ -88,18 +88,6 @@ class AdaptiveListTile extends StatelessWidget {
final theme = Theme.of(context); final theme = Theme.of(context);
switch (theme.platform) { 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.iOS:
case TargetPlatform.macOS: case TargetPlatform.macOS:
final tile = CupertinoListTile( final tile = CupertinoListTile(
@ -130,6 +118,19 @@ class AdaptiveListTile extends StatelessWidget {
} }
return tile; 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,
);
} }
} }
} }

Loading…
Cancel
Save