Question: I want to redirect from **<https://www.example.net>** to **<https://www.example.net/dd>**
but I cannot find any solution to do this.

Answer: 
You are not assigning the subscription into the right variable. 

```
StreamSubscription<QuerySnapshot> subscription;

@override
void initState() {
super.initState();

    print("Creating a streamSubscription...");
    subscription=Firestore.collection("name").document("d1").collection("d1")
        .snapshots().listen((data){
            //It will display items
        }, onDone: () { // Not excecuting
            print("Task Done");
        }, onError: (error) {
            print("Some Error");
    });

     subscription.cancel(); //It will work but cancel stream before loading

}

@override
void dispose() {
 subscription.cancel(); //Not working
super.dispose();
}

```
I was experiencing the same problem and it turns out that the stream seems to keep listening for events for a while before canceling, but if you debug you will see that after dispose is called it will stop listening at some point. 
Therefore, [Gunter's](https://stackoverflow.com/a/54901093/7606929) solution works fine, since you can prevent your callback function from being called if mount is false, which means your page is no longer there.