mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
![]() This pull request aims for improved readability, based on issue #146600. ```dart // before List<SupportedPlatform> getSupportedPlatforms({bool includeRoot = false}) { final List<SupportedPlatform> platforms = includeRoot ? <SupportedPlatform>[SupportedPlatform.root] : <SupportedPlatform>[]; if (android.existsSync()) { platforms.add(SupportedPlatform.android); } if (ios.exists) { platforms.add(SupportedPlatform.ios); } if (web.existsSync()) { platforms.add(SupportedPlatform.web); } if (macos.existsSync()) { platforms.add(SupportedPlatform.macos); } if (linux.existsSync()) { platforms.add(SupportedPlatform.linux); } if (windows.existsSync()) { platforms.add(SupportedPlatform.windows); } if (fuchsia.existsSync()) { platforms.add(SupportedPlatform.fuchsia); } return platforms; } // after List<SupportedPlatform> getSupportedPlatforms({bool includeRoot = false}) { return <SupportedPlatform>[ if (includeRoot) SupportedPlatform.root, if (android.existsSync()) SupportedPlatform.android, if (ios.exists) SupportedPlatform.ios, if (web.existsSync()) SupportedPlatform.web, if (macos.existsSync()) SupportedPlatform.macos, if (linux.existsSync()) SupportedPlatform.linux, if (windows.existsSync()) SupportedPlatform.windows, if (fuchsia.existsSync()) SupportedPlatform.fuchsia, ]; } ``` |
||
---|---|---|
.. | ||
analyze_continuously_test.dart | ||
analyze_suggestion_test.dart | ||
analyze_test.dart | ||
android_analyze_test.dart | ||
assemble_test.dart | ||
attach_test.dart | ||
build_aar_test.dart | ||
build_darwin_framework_test.dart | ||
build_ios_test.dart | ||
build_ipa_test.dart | ||
build_linux_test.dart | ||
build_macos_test.dart | ||
build_test.dart | ||
build_web_test.dart | ||
build_windows_test.dart | ||
clean_test.dart | ||
config_test.dart | ||
create_usage_test.dart | ||
custom_devices_test.dart | ||
daemon_test.dart | ||
devices_test.dart | ||
doctor_test.dart | ||
downgrade_test.dart | ||
drive_test.dart | ||
flutter_web_platform_test.dart | ||
generate_localizations_test.dart | ||
http_host_validator_test.dart | ||
ide_config_test.dart | ||
install_test.dart | ||
ios_analyze_test.dart | ||
logs_test.dart | ||
precache_test.dart | ||
proxied_devices_test.dart | ||
proxy_validator_test.dart | ||
pub_test.dart | ||
run_test.dart | ||
screenshot_command_test.dart | ||
shell_completion_test.dart | ||
symbolize_test.dart | ||
test_test.dart | ||
update_packages_test.dart | ||
upgrade_test.dart |