title: Flutter - undefined name of class parameter
body: <p>I'm having difficulties in this part of my code. It looks preety simple, however there is one thing I just don't understand.
  This is my class, it looks rather basic:</p>
  <pre><code>class _ChangePageItem extends StatelessWidget {
    final String label;
    final bool isActive;
    final int pageIndex;
    final Function handlePagination;
  
    _ChangePageItem(this.label, this.isActive, this.pageIndex, this.handlePagination);
    @override
    Widget build(BuildContext context) {
      return Container(
        width: 35.0,
        height: 35.0,
        margin: EdgeInsets.only(right: 10.0),
        decoration: BoxDecoration(
          border: Border.all(
            width: 1.0,
            color: Colors.grey,
            style: BorderStyle.solid,
          ),
        ),
        child: RaisedButton(
          color: Colors.white,
          child: Text('$label'),
          onPressed:
              isActive ? () =&gt; handlePagination(int.parse('${label}')) : null,
        ),
      );
    }
  }
  </code></pre>
  <p>then I'm using this class in the same file:</p>
  <pre><code>return Row(
    mainAxisAlignment: MainAxisAlignment.end,
    children: [
      _ChangePageItem(label, isActive, pageIndex, handlePagination),
      paginationsItems(), _PaginationItem(label: '&gt;')],
  );
  </code></pre>
  <p>This is the error that I'm getting:
  <a href="https://i.stack.imgur.com/5VYbb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5VYbb.png" alt="enter image description here" /></a></p>
  <p>Adding value doesn't help:
  <a href="https://i.stack.imgur.com/Qscvp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Qscvp.png" alt="enter image description here" /></a></p>