If you want to pass data to your StatefulWidget in flutter you pass the data to the widget itself and store it there and access it via widget.XXX from your state.



See a small sample.

import 'package:flutter/material.dart';
import 'package:signin_example/app/services/song.dart';

class SongDetails extends StatefulWidget {
  final Song song;


  _SongDetailsState createState() => _SongDetailsState();

class _SongDetailsState extends State<SongDetails> {
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.song.name),
      body: Text(""),