execute method

  1. @override
Future<String?> execute(
  1. BuildContext context
)
override

Implementation

@override
Future<String?> execute(BuildContext context) {
  if (kIsWeb) {
    return Future.value('web');
  }

  final platform = Theme.of(context).platform;

  switch (platform) {
    case TargetPlatform.android:
      return Future.value('android');
    case TargetPlatform.iOS:
      return Future.value('ios');
    case TargetPlatform.macOS:
      return Future.value('macos');
    case TargetPlatform.windows:
      return Future.value('windows');
    case TargetPlatform.linux:
      return Future.value('linux');
    case TargetPlatform.fuchsia:
      return Future.value('fuchsia');
    default:
      return Future.value(null);
  }
}