Repository: flutter
Issue: Changing MaterialApp to CupertinoApp exceptions on routes.
Labels: framework,f: material design,d: api docs,has reproducible steps,found in release: 3.0,found in release: 3.1,team-design,triaged-design

Hi, I have changed my flutter app from MaterialApp to CupertinoApp. It has error on routes.

Tested on Android Device and Android Emulator.

Following codes works with MaterialApp.

```
import 'package:flutter/material.dart';
import 'package:wasd/onboarding.dart';
import 'strings.dart';

void main() => runApp(WASD());

class WASD extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: Strings.appTitle,
      initialRoute: Strings.navOnboarding,
      routes: {
        Strings.navOnboarding: (context) => Onboarding()
      },
    );
  }
}
```

However, when I changed to CupertinoApp like following. It shows error.

```
import 'package:flutter/cupertino.dart';
import 'package:wasd/onboarding.dart';
import 'strings.dart';

void main() => runApp(WASD());

class WASD extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return CupertinoApp(
      title: Strings.appTitle,
      initialRoute: Strings.navOnboarding,
      routes: {
        Strings.navOnboarding: (context) => Onboarding()
      },
    );
  }
}
```

<details>
  <summary>Logs</summary>

```
Performing hot reload...
Syncing files to device Android SDK built for x86...

════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following assertion was thrown building Builder(dirty, dependencies: [CupertinoUserInterfaceLevel, _InheritedCupertinoTheme]):
Either the home property must be specified, or the routes table must include an entry for "/", or there must be on onGenerateRoute callback specified, or there must be an onUnknownRoute callback specified, or the builder property must be specified, because otherwise there is nothing to fall back on if the app is started with an intent that specifies an unknown route.
'package:flutter/src/widgets/app.dart':
Failed assertion: line 178 pos 10: 'builder != null ||
         home != null ||
         routes.containsKey(Navigator.defaultRouteName) ||
         onGenerateRoute != null ||
         onUnknownRoute != null'


Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=BUG.md

The relevant error-causing widget was: 
  CupertinoApp file:///Users/abdullahbalta/StudioProjects/wasd-flutter/lib/main.dart:11:12
When the exception was thrown, this was the stack: 
#2      new WidgetsApp (package:flutter/src/widgets/app.dart:178:10)
#3      _CupertinoAppState.build.<anonymous closure> (package:flutter/src/cupertino/app.dart:278:22)
#4      Builder.build (package:flutter/src/widgets/basic.dart:6757:41)
#5      StatelessElement.build (package:flutter/src/widgets/framework.dart:4291:28)
#6      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4223:15)
...
════════════════════════════════════════════════════════════════════════════════════════════════════
Reloaded 1 of 639 libraries in 418ms.
```
</details>

<details>
  <summary>strings.dart</summary>

```
class Strings {

  static String appTitle = "WASD";

  //routes
  static String navOnboarding = '/onboarding';

}
```
</details>

So, assertion error message is very clear, but why this is not working?