Skip to content

Instantly share code, notes, and snippets.

@AdnaneX
Forked from lvh1g15/FlutterStack.dart
Created August 7, 2020 23:58
Show Gist options
  • Save AdnaneX/e5375a63211fa4dcb36fd919bed788d7 to your computer and use it in GitHub Desktop.
Save AdnaneX/e5375a63211fa4dcb36fd919bed788d7 to your computer and use it in GitHub Desktop.
Flutter Material Custom Card Stack View
class HousePickerView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new GradientAppBar('Houses',
new ListView(
children: <Widget>[
new HouseListTile(url: [
'https://statusandphoto.weebly.com/uploads/6/0/1/5/60158603/8347592_orig.png',
'http://globalmedicalco.com/photos/globalmedicalco/20/98181.jpg',
'https://allinonetricks.com/wp-content/uploads/2017/08/5-7.png'
],),
new HouseListTile(url: [
'https://statusandphoto.weebly.com/uploads/6/0/1/5/60158603/8347592_orig.png',
'http://globalmedicalco.com/photos/globalmedicalco/20/98181.jpg',
'https://allinonetricks.com/wp-content/uploads/2017/08/5-7.png'
],)
],
)
);
}
}
class HouseListTile extends StatelessWidget {
final List<String> url;
HouseListTile({this.url});
@override
Widget build(BuildContext context) {
final screenwidth = MediaQuery
.of(context).size.width;
return new Container(
margin: new EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 20.0),
decoration: new BoxDecoration(
borderRadius: new BorderRadius.circular(15.0),
image: new DecorationImage(
fit: BoxFit.fill,
image: new AssetImage('add appropriate asset'),
),
),
height: screenwidth/2,
child: new Stack(
children: <Widget>[
new Container(
margin: new EdgeInsets.fromLTRB(0.0, screenwidth/4, 0.0, 0.0),
height: screenwidth/4,
decoration: new BoxDecoration(
boxShadow: [
new BoxShadow(color: Colors.grey[300], offset: new Offset(0.0, 1.0), spreadRadius: 1.0, blurRadius: 1.0)
],
borderRadius: new BorderRadius.only(bottomLeft: Radius.circular(15.0), bottomRight: Radius.circular(15.0)),
color: Colors.white,
),
child: new Container(
height: screenwidth/4,
width: screenwidth,
padding: new EdgeInsets.fromLTRB(15.0, 0.0, 0.0, 0.0),
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
new Container(
padding: new EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 7.0),
child: new Text(
'Some random text',
style: new TextStyle(fontFamily: "Montserrat-SemiBold", fontSize: 20.0),
),
),
new ProfileImageRow(urls: url),
]
,)
)
),
new Container(
margin: new EdgeInsets.fromLTRB(screenwidth*0.7, screenwidth/4 - 28.0, 0.0, 0.0),
child: new FloatingActionButton(onPressed: (){},
backgroundColor: Colors.green[400],
child: new ImageIcon(new AssetImage('add appropriate asset'), color: Colors.white, size: 25.0),
)
),
]
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment