A Pen by Sripal K Jain on CodePen.
Last active
July 5, 2020 14:24
-
-
Save skj-skj/25cc372bc582249eb11bbfeac2c444c9 to your computer and use it in GitHub Desktop.
Whatsapp Clone Light Theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
debugShowCheckedModeBanner: false, | |
theme: ThemeData( | |
primaryColor: Color(0xff075E54), | |
indicatorColor: Colors.white, | |
textTheme: TextTheme( | |
bodyText2: TextStyle( | |
fontSize: 30.0, | |
)), | |
primaryIconTheme: IconThemeData( | |
color: Colors.white, | |
), | |
primaryTextTheme: TextTheme( | |
headline6: TextStyle(color: Colors.white), | |
bodyText1: TextStyle( | |
fontWeight: FontWeight.bold, | |
),),), | |
home: MyHomePage(), | |
); | |
} | |
} | |
class MyHomePage extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
double width = MediaQuery.of(context).size.width; | |
return DefaultTabController( | |
length: 4, | |
initialIndex: 1, | |
child: Scaffold( | |
appBar: AppBar( | |
title: Text("WhatsApp"), | |
actions: <Widget>[ | |
Padding( | |
padding: EdgeInsets.symmetric(horizontal: 8.0), | |
child: IconButton( | |
icon: Icon(Icons.search), | |
onPressed: () {}, | |
), | |
), | |
Padding( | |
padding: EdgeInsets.symmetric(horizontal: 8.0), | |
child: IconButton( | |
icon: Icon(Icons.more_vert), | |
onPressed: () {}, | |
), | |
), | |
], | |
bottom: TabBar( | |
isScrollable: true, | |
tabs: <Widget>[ | |
Container( | |
child: Tab(icon: Icon(Icons.camera_alt)), | |
), | |
Container( | |
child: Tab(text: 'CHATS'), | |
width: (width * 0.2), | |
), | |
Container( | |
child: Tab(text: 'STATUS'), | |
width: (width * 0.2), | |
), | |
Container( | |
child: Tab(text: 'CALLS'), | |
width: (width * 0.2), | |
), | |
], | |
), | |
), | |
body: TabBarView( | |
children: <Widget>[ | |
Container( | |
child: Center( | |
child: Icon( | |
Icons.camera_alt, | |
size: 150.0, | |
), | |
), | |
), | |
Center(child: Text('Chats')), | |
Center(child: Text('Status')), | |
Center(child: Text('Calls')), | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment