desi-programmer/flutter-firebase

How to navigate to ViewNote screen from another screen?

akshatAgain opened this issue · 1 comments

FlatButton(
              minWidth: 200,
              color: Colors.white,
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) => //Navigate from here
                  ),
                );
              },
              child: Text(
                'Check your notes',
                style: TextStyle(color: Colors.blue),
              ),
            ),

As long as you have access to the reference, pass it and use it.
You can extract data and format time, Right then and there,

ViewNote(
    data,
    formattedTime,
    snapshot.data.docs[index].reference,
),