0
I wanted the listtile to open a specific page, but it’s giving me an error in the "context". The code is as follows::
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(''),
backgroundColor: const Color(0xFFFFFFFF),
elevation: 0,
),
body: _buildListView(),
);
}
ListView _buildListView() {
return ListView(
children: <Widget>[
ListTile(
leading: CircleAvatar(
radius: 20,
child: CircleAvatar(
backgroundImage: AssetImage('assets/images/image000.jpg'),
radius: 28,
),
),
title: Text('INICIANTE'),
trailing: Icon(Icons.keyboard_arrow_right),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SignUpScreen()),
);
},
],
);
}
}
Can someone help me?