Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=C:\SDKS\flutter"
export "FLUTTER_APPLICATION_PATH=C:\PROJECTS\FlutterWhatsAppClone"
export "FLUTTER_ROOT=C:\development\flutter"
export "FLUTTER_APPLICATION_PATH=C:\Users\ahmed\StudioProjects\FlutterWhatsAppClone"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build\ios"
export "OTHER_LDFLAGS=$(inherited) -framework Flutter"
export "FLUTTER_FRAMEWORK_DIR=C:\SDKS\flutter\bin\cache\artifacts\engine\ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
export "PACKAGE_CONFIG=.dart_tool/package_config.json"
19 changes: 9 additions & 10 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
import 'dart:async';

import 'package:camera/camera.dart';
import 'package:flutter/material.dart';
import 'package:flutterwhatsapp/whatsapp_home.dart';

List<CameraDescription> cameras;
late List<CameraDescription> cameras;

Future<Null> main() async {
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
cameras = await availableCameras();
runApp(new MyApp());
runApp(MyApp());
}

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: "WhatsApp",
theme: new ThemeData(
primaryColor: new Color(0xff075E54),
accentColor: new Color(0xff25D366),
return MaterialApp(
title: "WhatsAppChatDemo",
theme: ThemeData(
primaryColor: Color(0xff075E54),
hintColor: Color(0xff25D366),
),
debugShowCheckedModeBanner: false,
home: new WhatsAppHome(cameras:cameras),
home: WhatsAppHome(cameras: cameras),
);
}
}
2 changes: 1 addition & 1 deletion lib/models/chat_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class ChatModel {
final String time;
final String avatarUrl;

ChatModel({this.name, this.message, this.time, this.avatarUrl});
ChatModel({required this.name, required this.message, required this.time, required this.avatarUrl});
}

List<ChatModel> dummyData = [
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/camera_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CameraScreen extends StatefulWidget {
}

class CameraScreenState extends State<CameraScreen> {
CameraController controller;
late CameraController controller;

@override
void initState() {
Expand Down
36 changes: 13 additions & 23 deletions lib/whatsapp_home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@ import 'package:flutterwhatsapp/pages/status_screen.dart';

class WhatsAppHome extends StatefulWidget {
final List<CameraDescription> cameras;
WhatsAppHome({this.cameras});
WhatsAppHome({required this.cameras});

@override
_WhatsAppHomeState createState() => _WhatsAppHomeState();
}

class _WhatsAppHomeState extends State<WhatsAppHome>
with SingleTickerProviderStateMixin {
TabController _tabController;
late TabController _tabController;
bool showFab = true;

@override
void initState() {
super.initState();

_tabController = TabController(vsync: this, initialIndex: 1, length: 4);
_tabController.addListener(() {
if (_tabController.index == 1) {
Expand All @@ -42,28 +41,22 @@ class _WhatsAppHomeState extends State<WhatsAppHome>
bottom: TabBar(
controller: _tabController,
indicatorColor: Colors.white,
tabs: <Widget>[
tabs: const [
Tab(icon: Icon(Icons.camera_alt)),
Tab(text: "CHATS"),
Tab(
text: "STATUS",
),
Tab(
text: "CALLS",
),
Tab(text: "STATUS"),
Tab(text: "CALLS"),
],
),
actions: <Widget>[
actions: const [
Icon(Icons.search),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 5.0),
),
Icon(Icons.more_vert)
SizedBox(width: 5),
Icon(Icons.more_vert),
],
),
body: TabBarView(
controller: _tabController,
children: <Widget>[
children: [
CameraScreen(widget.cameras),
ChatScreen(),
StatusScreen(),
Expand All @@ -72,13 +65,10 @@ class _WhatsAppHomeState extends State<WhatsAppHome>
),
floatingActionButton: showFab
? FloatingActionButton(
backgroundColor: Theme.of(context).accentColor,
child: Icon(
Icons.message,
color: Colors.white,
),
onPressed: () => print("open chats"),
)
backgroundColor: Theme.of(context).primaryColor,
child: const Icon(Icons.message, color: Colors.white),
onPressed: () => print("open chats"),
)
: null,
);
}
Expand Down
Loading