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);
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;
}
}

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);
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,
);
}
}
}

Loading…
Cancel
Save