When you upgraded flutter to version 1.22.0. It will be conflict between Router class in library 'package:flutter/src/widgets/router.dart' and the generated file 'router.gr.dart'.
If you are not using the Router class from 'package:flutter/src/widgets/router.dart' in the same file you can hide it while importing material package.
import 'package:flutter/material.dart' hide Router;