Passing data to another page

hello
can anyone help I’ve been stuck at this for 2 days
using a constructor I passed data from the nowshowing page to moviedetail page successfully i can see the img plot name and cast but right now I want to pass the movie name to the showtimes page so a user can see his ticket summery like date, time and movie name but the name won’t show at all it’s not working and I get this error
what can I do ?
btw i used firebase for my data
thank you!


class ShowtimesPage extends StatefulWidget {

var movie;
ShowtimesPage({Key key,this.movie}) : super(key: key);

  @override
  
  _ShowtimesPageState createState() => _ShowtimesPageState();
}


class _ShowtimesPageState extends State<ShowtimesPage> {




List<ListItem> _dropdownItems = [
    ListItem(1, "11:30 am"),
    ListItem(2, "3:00 pm"),
    ListItem(3, "5:30 pm"),
    ListItem(4, "9:00 pm")
  ];

  List<DropdownMenuItem<ListItem>> _dropdownMenuItems;
  ListItem _selectedItem;

  void initState() {
    super.initState();
    _dropdownMenuItems = buildDropDownMenuItems(_dropdownItems);
    _selectedItem = _dropdownMenuItems[0].value;

  }

  List<DropdownMenuItem<ListItem>> buildDropDownMenuItems(List listItems) {
    List<DropdownMenuItem<ListItem>> items = List();
    for (ListItem listItem in listItems) {
      items.add(
        DropdownMenuItem(
          child: Text(listItem.name),
          value: listItem,
        ),
      );
    }
    return items;
  }


  DateTime chosen = DateTime.now();


  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Color(0xff00bbf9),
        title: Text(" Show Times")
      ),
      body: Column(
        children: [
          Padding(
            padding: const EdgeInsets.only(top: 50),
            child: Container(
              height: 70,
              child: Text(
                "Please Choose a date",
                style: GoogleFonts.poppins(
    fontSize: 20,
    fontWeight: FontWeight.bold,
    color: Colors.black
  ),),
                )
            ),
          Container(
                child: Center(
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.spaceAround,
                    mainAxisSize: MainAxisSize.max,
                    children: <Widget>[
                      CustomHorizontalCalendar(
                        onDateChoosen: (date) {
                          setState(() {
                            chosen = date;
                          });
                        },
                        inintialDate: DateTime.now(),
                        height: 60,
                        builder: (context, i, d, width) {
                          if (i != 2)
                            return DateRow(
                              d,
                              width: width,
                            );
                          else
                            return DateRow(
                              d,
                              background: Colors.pink,
                              selectedDayStyle: TextStyle(color: Colors.white),
                              selectedDayOfWeekStyle:
                                  TextStyle(color: Colors.white),
                              selectedMonthStyle: TextStyle(color: Colors.white),
                              width: width,
                            );
                        },
                      ),
                      
                    ],
                  ),
                )),
                Padding(
                  padding: const EdgeInsets.only(top: 50 ,bottom: 50),
                  child: Container(
                    child: Text(
                  "Please Choose a Time",
                  style: GoogleFonts.poppins(
    fontSize: 20,
    fontWeight: FontWeight.bold,
    color: Colors.black
  ),),
                  ),
                ),
                
             DropdownButton<ListItem>(
            value: _selectedItem,
            items: _dropdownMenuItems,
            onChanged: (value) {
              setState(() {
                _selectedItem = value;
              });
            }),
            Container(
              child: Text( "your chosen time is ${_selectedItem.name}" )
            ),
            Container(
              child: Text( "your chosen date is")
            ),
             Container(
              child: Text(DateFormat.yMd().format(chosen) )
            ),
            Container(
              child: Text( "${widget.movie['name']}" )
            ),
              
             

        ],
      ),
      
    );
  }
}

class ListItem {
  int value;
  String name;

  ListItem(this.value, this.name);
} ```

Your code seems to be fine. Could you share the part wherr you call ShowTimePage()?

Also, please print widget.movie in initstate and share the result!!

hi this is the MovieDetail page which i call showtimepage in it

class MovieDetail extends StatefulWidget {


dynamic movie;
MovieDetail({Key key,this.movie}) : super(key: key);

  @override
  _MovieDetailState createState() => _MovieDetailState();
    }
    
  class _MovieDetailState extends State<MovieDetail> {

  @override
    Widget build(BuildContext context) {
        return StreamBuilder<QuerySnapshot>(
          stream: Firestore.instance.collection("nowshowing").snapshots(),
          builder: (context , snapshot ){
                         if(snapshot.data == null) return Loading();
            return Scaffold(
                appBar: PreferredSize(
                preferredSize: Size.fromHeight(30.0),
                child: AppBar(
                elevation: 0,
                backgroundColor: Colors.transparent,
                          ),),
                backgroundColor: Color(0xff00bbf9),
                body: ListView(
                                  children: <Widget> [
                                    Center(
                                      child: Container(
                                          decoration: BoxDecoration(
                                            borderRadius: BorderRadius.circular(45),
                                            image: DecorationImage(
                                              image:  NetworkImage("${widget.movie['img']}", ),fit: BoxFit.cover),
                                              boxShadow:[ 
                                                        BoxShadow(
                                                          offset: Offset(0, 4),
                                                          blurRadius: 4,
                            color: Colors.black26,
                          )
                        ]
                        ),
                        height: 370,
                        width: 400,
                        ),
                        ),
                                  
                                    Center(
                                      child: Container(
                                        transform: Matrix4.translationValues(0, 20, 1),
                                        decoration: BoxDecoration(
                                          color: Colors.white,
                                          borderRadius: BorderRadius.circular(45),
                                        ),
                                        height: 400,
                                        width: 400,
                                          child: ListView(
                                        children: <Widget>[
                                          SizedBox(
                                            height: 20,
                                          ),
                                          Container(
                                            width: 100,
                                            child: Text("${widget.movie['name']}" , 
                                            textAlign: TextAlign.center,
                                  style: GoogleFonts.poppins(
                                          letterSpacing: 2,
                                          color: Colors.black,
                                          fontSize: 30,
                                          fontWeight: FontWeight.w800
                              ),),
                                            ),
                                          Row(
                                              children: [
                                                  SizedBox(
                                                      width: 40,
                                                      height: 20,),
                                                      Container(
                                                        alignment: Alignment.center,
                                                        height: 20,
                                                        width: 130,
                                                        decoration: BoxDecoration(
                                                          color: Colors.pink,
                                                          border: Border.all(color: Colors.pink),
                                                          borderRadius: BorderRadius.circular(36)
                                                        ),
                                                        child: Text("${widget.movie['genre']}" , style: GoogleFonts.poppins(
                                                          fontSize: 12,
                                                          color: Colors.black,
                                                          fontWeight: FontWeight.w800
                              ),),),
                                                      SizedBox(
                                                      width: 20,
                                                      height: 20,),
                                                    Container(
                                                    alignment: Alignment.center,
                                                    height: 20,
                                                    width: 90,
                                                    decoration: BoxDecoration(
                                                      color: Colors.pink,
                                                      border: Border.all(color: Colors.pink),
                                                      borderRadius: BorderRadius.circular(36)
                                                    ),
                                                    child: Text("${widget.movie['year']}" , style: GoogleFonts.poppins(
                                                      fontSize: 12,
                                                      color: Colors.black,
                                                      fontWeight: FontWeight.w800
                              ),)),
                              SizedBox(
                                                      width: 20,
                                                      height: 20,),
                                                    Container(
                                                    alignment: Alignment.center,
                                                    height: 20,
                                                    width: 60,
                                                    decoration: BoxDecoration(
                                                      color: Colors.pink,
                                                      border: Border.all(color: Colors.pink),
                                                      borderRadius: BorderRadius.circular(36)
                                                    ),
                                                    child: Text("${widget.movie['lang']}" , style: GoogleFonts.poppins(
                                                      fontSize: 12,
                                                      color: Colors.black,
                                                      fontWeight: FontWeight.w800
                              ),)),

                                              ],),
                                            SizedBox(
                                            height: 10,
                                          ),
                                                    Padding(
                                                      padding: const EdgeInsets.all(30.0),
                                                      child: Container(                   
                                                            width: 50,
                                                            child: Text(
                                                              "${widget.movie['plot']}" ,
                                                              textAlign: TextAlign.justify, 
                                                              style: GoogleFonts.poppins(
                                                              color: Colors.black,
                                                              fontSize: 13,
                                                              fontWeight: FontWeight.w600
                              ),),
                                                          ),
                                                    ),       
                                                    SizedBox(
                                            height: 1,
                                          ),
                                                    Padding(
                                                      padding: const EdgeInsets.only(left: 20),
                                                      child: Container(
                                                        width: 350,
                                                        child: Text(
                                                          "Director: ${widget.movie['Director']}" ,
                                                          textAlign: TextAlign.center, 
                                                          style: GoogleFonts.poppins(
                                                          color: Colors.black,
                                                          fontSize: 10,
                                                          fontWeight: FontWeight.w800
                              ),),
                                                      ),
                                                    ),
                                                    Padding(
                                                      padding: const EdgeInsets.only(left: 30 ,bottom: 30),
                                                      child: Container(
                                                        width: 350,
                                                        child: Text(
                                                          "Cast: ${widget.movie['Cast']}" ,
                                                          textAlign: TextAlign.center, 
                                                          style: GoogleFonts.poppins(
                                                          color: Colors.black,
                                                          fontSize: 10,
                                                          fontWeight: FontWeight.w800
                              ),),
                                                      ),
                                                    ),
                                                    Padding(
                                                      padding: const EdgeInsets.only(left: 100, right: 100),
                                                      child: Container(
                                                        child: RaisedButton(
                                    shape: RoundedRectangleBorder(
                        borderRadius: BorderRadius.circular(40.0),
                        side: BorderSide(color: Colors.pink)),
                                    color: Colors.pink[400],
                                    child: Text(
                                      'Book Ticket',
                                      style: TextStyle(color: Colors.white) ,
                                    ),
                                    onPressed: (){
                                      Navigator.push(context, MaterialPageRoute(
                                        builder:(context){
                                          RouteSettings(
                                            arguments: widget.movie);
                                          return ShowtimesPage(); 
                                        }));
                                    },
                                                      )

                                                      ),
                                                    )],
                                      ),
                                        ),
                                    ),
                                    
                                  
                                    
                                    ],
                                    
                              
                          ),
                                
                        );
          }
        );
              }
            }


also I did the this in moviedetails and nothing happened
initState() {
super.initState();
print(widget.movie);
}

thank you.

I still don’t see the call to ShowTimePage(). Have you renamed anything?

import 'package:cinema_project/screens/nowshowing.dart';
import 'package:cinema_project/screens/showtimes.dart';
import 'package:cinema_project/shared/loading.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:custom_horizontal_calendar/custom_horizontal_calendar.dart';
import 'package:custom_horizontal_calendar/date_row.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:intl/intl.dart';

class MovieDetail extends StatefulWidget {


dynamic movie;
MovieDetail({Key key,this.movie}) : super(key: key);

  @override
  _MovieDetailState createState() => _MovieDetailState();
    }
    
  class _MovieDetailState extends State<MovieDetail> {
 
    initState() {
    super.initState();
    print('widget.movie');
  }


  @override
    Widget build(BuildContext context) {
        return StreamBuilder<QuerySnapshot>(
          stream: Firestore.instance.collection("nowshowing").snapshots(),
          builder: (context , snapshot ){
                         if(snapshot.data == null) return Loading();
            return Scaffold(
                appBar: PreferredSize(
                preferredSize: Size.fromHeight(30.0),
                child: AppBar(
                elevation: 0,
                backgroundColor: Colors.transparent,
                          ),),
                backgroundColor: Color(0xff00bbf9),
                body: ListView(
                                  children: <Widget> [
                                    Center(
                                      child: Container(
                                          decoration: BoxDecoration(
                                            borderRadius: BorderRadius.circular(45),
                                            image: DecorationImage(
                                              image:  NetworkImage("${widget.movie['img']}", ),fit: BoxFit.cover),
                                              boxShadow:[ 
                                                        BoxShadow(
                                                          offset: Offset(0, 4),
                                                          blurRadius: 4,
                            color: Colors.black26,
                          )
                        ]
                        ),
                        height: 370,
                        width: 400,
                        ),
                        ),
                                  
                                    Center(
                                      child: Container(
                                        transform: Matrix4.translationValues(0, 20, 1),
                                        decoration: BoxDecoration(
                                          color: Colors.white,
                                          borderRadius: BorderRadius.circular(45),
                                        ),
                                        height: 400,
                                        width: 400,
                                          child: ListView(
                                        children: <Widget>[
                                          SizedBox(
                                            height: 20,
                                          ),
                                          Container(
                                            width: 100,
                                            child: Text("${widget.movie['name']}" , 
                                            textAlign: TextAlign.center,
                                  style: GoogleFonts.poppins(
                                          letterSpacing: 2,
                                          color: Colors.black,
                                          fontSize: 30,
                                          fontWeight: FontWeight.w800
                              ),),
                                            ),
                                          Row(
                                              children: [
                                                  SizedBox(
                                                      width: 40,
                                                      height: 20,),
                                                      Container(
                                                        alignment: Alignment.center,
                                                        height: 20,
                                                        width: 130,
                                                        decoration: BoxDecoration(
                                                          color: Colors.pink,
                                                          border: Border.all(color: Colors.pink),
                                                          borderRadius: BorderRadius.circular(36)
                                                        ),
                                                        child: Text("${widget.movie['genre']}" , style: GoogleFonts.poppins(
                                                          fontSize: 12,
                                                          color: Colors.black,
                                                          fontWeight: FontWeight.w800
                              ),),),
                                                      SizedBox(
                                                      width: 20,
                                                      height: 20,),
                                                    Container(
                                                    alignment: Alignment.center,
                                                    height: 20,
                                                    width: 90,
                                                    decoration: BoxDecoration(
                                                      color: Colors.pink,
                                                      border: Border.all(color: Colors.pink),
                                                      borderRadius: BorderRadius.circular(36)
                                                    ),
                                                    child: Text("${widget.movie['year']}" , style: GoogleFonts.poppins(
                                                      fontSize: 12,
                                                      color: Colors.black,
                                                      fontWeight: FontWeight.w800
                              ),)),
                              SizedBox(
                                                      width: 20,
                                                      height: 20,),
                                                    Container(
                                                    alignment: Alignment.center,
                                                    height: 20,
                                                    width: 60,
                                                    decoration: BoxDecoration(
                                                      color: Colors.pink,
                                                      border: Border.all(color: Colors.pink),
                                                      borderRadius: BorderRadius.circular(36)
                                                    ),
                                                    child: Text("${widget.movie['lang']}" , style: GoogleFonts.poppins(
                                                      fontSize: 12,
                                                      color: Colors.black,
                                                      fontWeight: FontWeight.w800
                              ),)),

                                              ],),
                                            SizedBox(
                                            height: 10,
                                          ),
                                                    Padding(
                                                      padding: const EdgeInsets.all(30.0),
                                                      child: Container(                   
                                                            width: 50,
                                                            child: Text(
                                                              "${widget.movie['plot']}" ,
                                                              textAlign: TextAlign.justify, 
                                                              style: GoogleFonts.poppins(
                                                              color: Colors.black,
                                                              fontSize: 13,
                                                              fontWeight: FontWeight.w600
                              ),),
                                                          ),
                                                    ),       
                                                    SizedBox(
                                            height: 1,
                                          ),
                                                    Padding(
                                                      padding: const EdgeInsets.only(left: 20),
                                                      child: Container(
                                                        width: 350,
                                                        child: Text(
                                                          "Director: ${widget.movie['Director']}" ,
                                                          textAlign: TextAlign.center, 
                                                          style: GoogleFonts.poppins(
                                                          color: Colors.black,
                                                          fontSize: 10,
                                                          fontWeight: FontWeight.w800
                              ),),
                                                      ),
                                                    ),
                                                    Padding(
                                                      padding: const EdgeInsets.only(left: 30 ,bottom: 30),
                                                      child: Container(
                                                        width: 350,
                                                        child: Text(
                                                          "Cast: ${widget.movie['Cast']}" ,
                                                          textAlign: TextAlign.center, 
                                                          style: GoogleFonts.poppins(
                                                          color: Colors.black,
                                                          fontSize: 10,
                                                          fontWeight: FontWeight.w800
                              ),),
                                                      ),
                                                    ),
                                                    Padding(
                                                      padding: const EdgeInsets.only(left: 100, right: 100),
                                                      child: Container(
                                                        child: RaisedButton(
                                    shape: RoundedRectangleBorder(
                        borderRadius: BorderRadius.circular(40.0),
                        side: BorderSide(color: Colors.pink)),
                                    color: Colors.pink[400],
                                    child: Text(
                                      'Book Ticket',
                                      style: TextStyle(color: Colors.white) ,
                                    ),
                                    onPressed: (){
**                                      Navigator.push(context, MaterialPageRoute(**
**                                        builder:(context){**
**                                          return ShowtimesPage(); **
**                                        }));
**                                    },
                                                      )

                                                      ),
                                                    )],
                                      ),
                                        ),
                                    ),
                                    
                                  
                                    
                                    ],
                                    
                              
                          ),
                                
                        );
          }
        );
              }
            }



onPressed: (){
** Navigator.push(context, MaterialPageRoute(**
** builder:(context){**
** return ShowtimesPage(); **
** }));
** },

this one