gurleensethi / sailor

Easy page navigation and management in Flutter apps.
https://pub.dev/packages/sailor
MIT License
145 stars 24 forks source link

Custom navigatorObserver #32

Open intraector opened 4 years ago

intraector commented 4 years ago

Hi. This is a great peace of code, thanks for that.

And my question is: we can use SailorLoggingObserver() for logging purposes, obviously. But I need to use a navigatorObserver to monitor user's movements from screen to screen in order to check if user is currently on chat's screen. So I can mark chat as 'unread' otherwise.

I managed to get this info this way: var screenargs = route.settings.arguments as ArgumentsWrapper;

But in order to do that I need to import: import 'package:sailor/src/models/arguments_wrapper.dart';

And dart analyzer complains:

'Don't import implementation files from another package.

It would be nice to have an observer not only for logging but actually for getting routes' params.