Skip to content

Instantly share code, notes, and snippets.

@yshogo yshogo/home.dart
Created Apr 14, 2019

Embed
What would you like to do?
Create Gmail app UI in 10 minute using Flutter!
import 'package:flutter/material.dart';
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: CustomScrollView(
slivers: <Widget>[
SliverAppBar(
backgroundColor: Colors.white,
title: Material(
elevation: 8,
child: TextFormField(
decoration: InputDecoration(
hintText: "Search Mail",
border: InputBorder.none,
icon: Container(
margin: EdgeInsets.only(left: 10),
child: Icon(Icons.dehaze),
),
suffixIcon: Container(
margin: EdgeInsets.all(5),
child: CircleAvatar(
backgroundImage: AssetImage("assets/profile.jpg"),
),
),
),
),
),
),
SliverList(
delegate: SliverChildListDelegate(
List.generate(
100,
(int i) {
return _listItem(i);
},
),
),
)
],
),
floatingActionButton: FloatingActionButton(
onPressed: () {},
child: Icon(
Icons.add,
color: Colors.red,
),
backgroundColor: Colors.white,
),
);
}
Widget _listItem(int i) {
return ListTile(
leading: CircleAvatar(
child: Text(i.toString()),
backgroundColor: Colors.green,
),
title: Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
"shogo.yamada",
style: TextStyle(fontWeight: FontWeight.bold),
),
Text(
"8:59",
style: TextStyle(fontWeight: FontWeight.bold),
),
],
),
Text(
"Please Subscribe this channel!!!!! Please!!!!!",
overflow: TextOverflow.ellipsis,
style: TextStyle(fontWeight: FontWeight.bold),
),
],
),
subtitle: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text("this is gmail app using flutter !!!!!"),
Icon(Icons.star_border)
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.