Adding router to Material App

So the last step is adding an instance of the router class we just generated to the material app to manage its routes.

 MaterialApp(
        title: 'Tech camp Flutter',
        debugShowCheckedModeBanner: false,
        //TODO: Add this line
        builder: ExtendedNavigator.builder(router: Router()),
 ),

While doing this step flutter may cause an error that the router class is imported from two libraries. So in order to overcome that change your imports like this.

import 'package:flutter/material.dart' hide Router;

Last updated