Getting this error with this code:
void main() => runApp(RouteTestApp());
class RouteTestApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Demo',
home: FirstScreen(),
initialRoute: '/',
routes: {
'/': (context) => FirstScreen(),
'/second': (context) => SecondScreen(),
},
);
}
}
The following assertion was thrown building MaterialApp(dirty, state: _MaterialAppState#a959e): I/flutter (24918): If the home property is specified, the routes table cannot include an entry for "/", since it would I/flutter (24918): be redundant. I/flutter (24918): 'package:flutter/src/widgets/app.dart': I/flutter (24918): Failed assertion: line 172 pos 10: 'home == null || I/flutter (24918): !routes.containsKey(Navigator.defaultRouteName)'