i am trying to put a drawer here but i keep getting an error. i have put a comment where the error is.Please check it out and help me.
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
AppBar appBar(String name) {
return AppBar(
leading: Text(""),
title: Text(
name,
style: TextStyle(color: Colors.blue),
),
// centerTitle: true,
elevation: 0,
backgroundColor: Colors.transparent,
actions: <Widget>[
IconButton(
icon: Icon(
Icons.notification_important,
color: Colors.blue,
),
onPressed: () {}),
],
);
}
class Drawer extends StatefulWidget {
@override
_DrawerState createState() => _DrawerState ();
}
class _DrawerState extends State <Drawer> {
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: new Drawer (
i get an error here that states that: The named parameter 'child' isn't defined. Try correcting the name to an existing named parameter's name, or defining a named parameter with the name 'child'. Can i please get some help in fixing this.
child: <Widget>[
ListView(
children : <Widget>[
ListTile(
onTap: (){},
leading: Icon(Icons.arrow_back),
title: Text("Back"),
),
ListTile(
onTap: (){},
leading: Icon(Icons.home),
title: Text("Home"),
),
ListTile(
onTap: (){},
leading: Icon(Icons.settings),
title: Text("Settings"),
),
ListTile(
onTap: (){},
leading: Icon(Icons.mood_bad),
title: Text("Logout"),
),
]
),
],
),
);
}
}