Skip to content

Instantly share code, notes, and snippets.

@vijayinyoutube
Created Mar 28, 2020
Embed
What would you like to do?
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: MyPage(),
);
}
}
class MyPage extends StatefulWidget {
@override
_MyPageState createState() => _MyPageState();
}
class _MyPageState extends State<MyPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
child: Wrap(
direction: Axis.horizontal,
spacing: 10,
runSpacing: 10,
children: <Widget>[
Row(children: <Widget>[
new Text("\n\nCards.,",
style: TextStyle(color: Colors.pink, fontSize: 25)),
]),
GestureDetector(
child: new Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15.0),
),
elevation: 10,
color: Colors.lightBlue,
child: Container(
width: 150,
height: 60,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const ListTile(
leading: Icon(Icons.home, size: 40),
title: Text("Home Card"),
)
],
)),
),
),
new Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15.0),
),
elevation: 10,
color: Colors.red,
child: Container(
width: 150,
height: 60,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const ListTile(
leading: Icon(Icons.message, size: 40),
title: Text("Message Card"),
)
],
)),
),
new Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15.0),
),
elevation: 10,
color: Colors.orangeAccent,
child: Container(
width: 150,
height: 60,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const ListTile(
leading: Icon(Icons.phone, size: 40),
title: Text("Phone Card"),
)
],
)),
),
],
),
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment