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 { Component } from '@angular/core'; | |
@Component({ | |
selector: 'app-recursive-object', | |
template: ` | |
<span *ngIf="isArray(items)">[</span> | |
<span *ngIf="!isArray(items)">{{ '{' }}</span> | |
<div *ngFor="let key of objectKeys(items)" class="ml-3"> | |
<span *ngIf="!isArray(items)">{{ key }}: </span> |
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
function charToNumber(char) { | |
if (char === ' ') { | |
return 58 | |
} else if (!isNaN(char)) { | |
return parseInt(char) | |
} else { | |
return char.toUpperCase().charCodeAt(0) - 55; | |
} | |
} |
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
// imports and the main() function above | |
class WhatsAppClone extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'WhatsApp', | |
theme: ThemeData( | |
primaryColor: Color(0xff075e54), | |
indicatorColor: Colors.white, | |
primaryColorDark: Color(0xFF128C7E), |
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
// above are the imports | |
class Home extends StatelessWidget { | |
final _tabs = <Widget>[ | |
Tab(icon: Icon(Icons.camera_alt)), Tab(text: 'CHATS'), | |
Tab(text: 'STATUS'), Tab(text: 'CALLS'), | |
]; | |
@override | |
Widget build(BuildContext context) { | |
return DefaultTabController( |
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
// Inside the build() method of our ChatRoom() widget | |
return Scaffold( | |
backgroundColor: Color(0xFFECE5DD), | |
appBar: AppBar( | |
title: , // <-- we will do the trick here | |
actions: <Widget>[ | |
IconButton( | |
icon: Icon(Icons.videocam), | |
onPressed: () {}, | |
), |
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
class ChatRoom extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
backgroundColor: Color(0xFFECE5DD), | |
appBar: AppBar( | |
// leading: CircleAvatar(...), <-- remove this avatar | |
title: Row( | |
children: <Widget>[ |
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
// Inside the build() method of our ChatRoom() widget | |
return Scaffold( | |
backgroundColor: Color(0xFFECE5DD), | |
appBar: AppBar( | |
title: SizedBox( | |
width: double.infinity, | |
child: Stack( | |
overflow: Overflow.visible, | |
children: <Widget>[ | |
Positioned( |
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
class ChatRoom extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
backgroundColor: Color(0xFFECE5DD), | |
appBar: AppBar(...), // Title text, action buttons on the right | |
body: Column( | |
children: <Widget>[ | |
Expanded( | |
child: ListView(...), // chat threads |
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
class ChatList extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return ListView.builder( | |
// itemCount: , <-- Normally we put the data array's length. | |
itemBuilder: (context, index) { | |
return ListTile( | |
title: Text('Contact $index'), | |
); | |
}, |
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'; | |
class ChatList extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return ListView.builder(itemBuilder: (context, index) { | |
return ListTile( | |
title: Text('Contact $index'), | |
//// onTap START //// | |
onTap: () { |
OlderNewer