main function

void main()

Implementation

void main() {
  // Ensures that an instance of the widgets library is initialized.
  WidgetsFlutterBinding.ensureInitialized();

  // Set the preferred orientation to landscape.
  SystemChrome.setPreferredOrientations([
    DeviceOrientation.landscapeLeft,
    DeviceOrientation.landscapeRight,
  ]);

  // Set the app in fullscreen mode, hiding the system UI overlays.
  SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);

  // Set the default NASA API key to the DEMO_KEY.
  SharedPreferences.getInstance().then((prefs) {
    if (!prefs.containsKey('nasa_api_key_unchecked')) {
      prefs.setString('nasa_api_key_unchecked', 'DEMO_KEY');
    }
  });

  runApp(const Launcher());
}