import 'package:screens/Login.dart';
import 'package:flutter/material.dart';
import 'dart:ui' as prefix1;
class AppDrawer extends StatelessWidget {
@override Widget
build(BuildContext context)
{
return Drawer(
child: ListView(
children: <Widget>[
Container(
child: new Stack(
children: <Widget>[
ClipPath(
child: Container(
color: Colors.blue.shade900,
),
clipper: getClipper(),
),
Container(
child: Positioned(
width: 300.0,
top: MediaQuery.of(context).size.height/6.7,
child: Column(
children: <Widget>[
Container(
width: 100.0,
height: 100.0,
decoration: BoxDecoration(
color: Colors.white,
image: DecorationImage(
image: AssetImage('assets/app1.jpg'),
fit: BoxFit.cover
),
borderRadius:
BorderRadius.all(Radius.circular(100.0)),
boxShadow: [
BoxShadow(blurRadius: 20.0, color: Colors.black)
]
// border: Border.all(color: Colors.black, width:
1.0, style: BorderStyle.solid)
),
),
SizedBox(height: 10),
Text('Samuel',textAlign: TextAlign.center,
style: TextStyle(
fontSize: 25.0,
fontFamily: 'Monseratti',
fontWeight: FontWeight.bold
),),
SizedBox(height: 5),
Text('07031024787',textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12.0,
fontFamily: 'Monseratti',
fontStyle: FontStyle.normal
),),
SizedBox(height: 10),
Text('Your license will expire by ', textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12.0,
fontFamily: 'Monseratti',
fontStyle: FontStyle.italic,
color: Colors.red
),)
],
),
),
),
Positioned(
top: MediaQuery.of(context).size.height/2.1,
width: 300.0,
child: new Column(
children: <Widget>[
CustomListTile(Icons.dashboard, 'Login', ()=>{
Navigator.push(context, MaterialPageRoute(builder: (context){
return Login();
}))
}),
CustomListTile(Icons.home, 'My Profile', ()=>{
Navigator.push(context, MaterialPageRoute(builder: (context){
return FeedBack();
}))
}),
CustomListTile(Icons.account_box, 'About', ()=>{
Navigator.push(context, MaterialPageRoute(builder: (context){
return About();
}))
}),
],
),
)
],
),
),
],
),
);
} }
class CustomListTile extends StatelessWidget{ IconData icon; String text; Function onTap;
CustomListTile(this.icon, this.text, this.onTap);
@override Widget build(BuildContext context) { return Padding(
padding: EdgeInsets.only(left: 15.0,top: 6.0), child: Container(
decoration: BoxDecoration(
border: Border( bottom: BorderSide(color: Colors.grey.shade400)),
),
child: InkWell(
splashColor: Colors.blueAccent,
onTap: onTap,
child: Container(
height: 40.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Row(
children: <Widget>[
Icon(icon, color: Colors.blue),
Padding(
padding: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
child: Text(text, style: TextStyle(
fontSize: 14.0,
fontFamily: 'Monseratti'
),) ,
)
],
),
Icon(Icons.arrow_right)
],
),
),
) ,
),
);
} }
答案 0 :(得分:0)
在您的 ListView 下,您必须添加属性 shrinkwrap:true
示例:
ListView(
shrinkWrap: true,
children: <Widget>[
答案 1 :(得分:0)
您可以使用:
SingleChildScrollView(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[]))),
OR
Builder(
builder: (context) => ListView(
shrinkWrap: true,
reverse: false,
children: <Widget>[]));