Call a change notifier function from another change notifier


I have two ChangeNotifier classes in a dart file like this:

class FirstContents extends ChangeNotifier {
// much code...
String myPassword;

void withdraw() {
// code...
myPassword = 'something here';
}

}

class SecondContents extends ChangeNotifier {
// much code...

void callgetrequest() {
// code...
String urlToCall = 'http://myurl.com/?user=mamt&pw=' + Provider.of<FirstContents>(context).myPassword;
}

}

But this code doesn’t work. Is there a way to fix this issue?