Quantcast
Viewing latest article 2
Browse Latest Browse All 2

Flutter - undefined name of class parameter

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:

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 ? () => handlePagination(int.parse('${label}')) : null,      ),    );  }}

then I'm using this class in the same file:

return Row(  mainAxisAlignment: MainAxisAlignment.end,  children: [    _ChangePageItem(label, isActive, pageIndex, handlePagination),    paginationsItems(), _PaginationItem(label: '>')],);

This is the error that I'm getting:Image may be NSFW.
Clik here to view.
enter image description here

Adding value doesn't help:Image may be NSFW.
Clik here to view.
enter image description here


Viewing latest article 2
Browse Latest Browse All 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>