Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finished the flash chat app with updated flutter 2.0 #47

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
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
1 change: 1 addition & 0 deletions .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"cloud_firestore","path":"/Users/Osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-2.5.3/","dependencies":["firebase_core"]},{"name":"firebase_auth","path":"/Users/Osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-3.1.3/","dependencies":["firebase_core"]},{"name":"firebase_core","path":"/Users/Osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.7.0/","dependencies":[]}],"android":[{"name":"cloud_firestore","path":"/Users/Osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-2.5.3/","dependencies":["firebase_core"]},{"name":"firebase_auth","path":"/Users/Osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-3.1.3/","dependencies":["firebase_core"]},{"name":"firebase_core","path":"/Users/Osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.7.0/","dependencies":[]}],"macos":[{"name":"cloud_firestore","path":"/Users/Osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-2.5.3/","dependencies":["firebase_core"]},{"name":"firebase_auth","path":"/Users/Osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-3.1.3/","dependencies":["firebase_core"]},{"name":"firebase_core","path":"/Users/Osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.7.0/","dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"cloud_firestore_web","path":"/Users/Osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore_web-2.4.3/","dependencies":["firebase_core_web"]},{"name":"firebase_auth_web","path":"/Users/Osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-3.1.2/","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","path":"/Users/Osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-1.1.0/","dependencies":[]}]},"dependencyGraph":[{"name":"cloud_firestore","dependencies":["cloud_firestore_web","firebase_core"]},{"name":"cloud_firestore_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_auth","dependencies":["firebase_auth_web","firebase_core"]},{"name":"firebase_auth_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]}],"date_created":"2022-02-26 16:15:53.101058","version":"2.2.3"}
81 changes: 81 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Contributing

When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

## Pull Request Process

1. Ensure any install or build dependencies are removed before the end of the layer when doing a
build.
2. Update the README.md with details of changes to the interface, this includes new environment
variables, exposed ports, useful file locations and container parameters.
3. Increase the version numbers in any examples files and the README.md to the new version that this
Pull Request would represent.
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
do not have permission to do that, you may request the second reviewer to merge it for you.

## Code of Conduct

### Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

### Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

### Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainer(s) have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

### Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

### Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

#### THANK YOU, KEEP CONTRIBUTING
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
##### NOTE - Include alternates to deprecated widgets. Needs full null-safety reboot(in-progress).

#
![App Brewery Banner](https://github.com/londonappbrewery/Images/blob/master/AppBreweryBanner.png)


Expand All @@ -6,6 +9,15 @@
## Our Goal

The objective of this tutorial is to learn how to incorporate Firebase into our Flutter apps. We'll be using Firebase Cloud Firestore as well as the Firebase authentication package to equip our app with a cloud-based NoSQL database and secure authentication methods.
Tutorial Objective: Leveraging Firebase for Enhanced Flutter Apps

Welcome to this comprehensive tutorial where we will dive into the integration of Firebase into your Flutter applications. Our primary goal is to empower you with the knowledge and skills to seamlessly incorporate Firebase Cloud Firestore and Firebase authentication into your apps.

Firebase Cloud Firestore:
We will explore Firebase Cloud Firestore, a real-time cloud-based NoSQL database, which will enable your app to store and retrieve data with lightning speed and efficiency. Say goodbye to the complexities of managing your app's data storage and hello to a scalable and user-friendly cloud solution.

Firebase Authentication:
In addition, we will delve into the world of secure authentication using the Firebase authentication package. You will learn how to implement robust and user-friendly authentication methods, ensuring the safety and privacy of your users' data.


## What you will create
Expand All @@ -26,6 +38,10 @@ We’re going to build a modern messaging app where users can sign up and log in
- How to use Firebase Cloud Firestore to store and retrieve data on the fly.


## NOTE
Original Project had used deprecated widgets which I have replaced with latest changes.



>This is a companion project to The App Brewery's Complete Flutter Development Bootcamp, check out the full course at [www.appbrewery.co](https://www.appbrewery.co/)

Expand Down
5 changes: 4 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if (localPropertiesFile.exists()) {

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
throw FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
Expand Down Expand Up @@ -57,4 +57,7 @@ flutter {

dependencies {
implementation 'androidx.multidex:multidex:2.0.0'
implementation platform('com.google.firebase:firebase-bom:28.4.2')
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
47 changes: 47 additions & 0 deletions android/app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"project_info": {
"project_number": "487652220417",
"project_id": "flash-chat-b30c9",
"storage_bucket": "flash-chat-b30c9.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:487652220417:android:51cce7925fdeb1066dea00",
"android_client_info": {
"package_name": "co.appbrewery.flash_chat"
}
},
"oauth_client": [
{
"client_id": "487652220417-aibu2qgr8npiqug0gg5khlmbnefm42uf.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "co.appbrewery.flash_chat",
"certificate_hash": "8eb82205f28effd3ca328fbb0a38b0cefd093cad"
}
},
{
"client_id": "487652220417-t8uf2tbfnt6r1509hkrof1j1640ovngr.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyB_xNXSZsXFcvSaNiR6IbgcIKrYcvkAID4"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "487652220417-t8uf2tbfnt6r1509hkrof1j1640ovngr.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
3 changes: 2 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="flash_chat"
android:label="Flash Chat"
android:usesCleartextTraffic="true"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
Expand Down
1 change: 1 addition & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ buildscript {

dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.google.gms:google-services:4.3.10'
}
}

Expand Down
Binary file added flutter_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flutter_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flutter_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flutter_04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/Osama/Developer/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/Osama/StudioProjects/flash-chat-flutter"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
21 changes: 20 additions & 1 deletion lib/constants.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
import 'package:flutter/material.dart';

const kButtonDecoration = InputDecoration(
hintText: 'Enter your info',
hintStyle: TextStyle(
color: Colors.lightBlueAccent,
),
contentPadding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 20.0),
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(32.0)),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.lightBlueAccent, width: 1.0),
borderRadius: BorderRadius.all(Radius.circular(32.0)),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.lightBlueAccent, width: 2.0),
borderRadius: BorderRadius.all(Radius.circular(32.0)),
),
);

const kSendButtonTextStyle = TextStyle(
color: Colors.lightBlueAccent,
fontWeight: FontWeight.bold,
Expand All @@ -14,6 +33,6 @@ const kMessageTextFieldDecoration = InputDecoration(

const kMessageContainerDecoration = BoxDecoration(
border: Border(
top: BorderSide(color: Colors.lightBlueAccent, width: 2.0),
top: BorderSide(color: Colors.blue, width: 2.0),
),
);
29 changes: 22 additions & 7 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,34 @@ import 'package:flash_chat/screens/welcome_screen.dart';
import 'package:flash_chat/screens/login_screen.dart';
import 'package:flash_chat/screens/registration_screen.dart';
import 'package:flash_chat/screens/chat_screen.dart';
import 'package:firebase_core/firebase_core.dart';

void main() => runApp(FlashChat());
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(FlashChat());
}

class FlashChat extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith(
textTheme: TextTheme(
body1: TextStyle(color: Colors.black54),
),
),
home: WelcomeScreen(),
theme: ThemeData.light().copyWith(),
initialRoute: '/',
routes: {
WelcomeScreen.id: (context) {
return WelcomeScreen(); // Navigate to Welcome Screen
},
LoginScreen.id: (context) {
return LoginScreen(); // Navigate to Login Screen
},
RegistrationScreen.id: (context) {
return RegistrationScreen(); // Navigate to Registration Screen
},
ChatScreen.id: (context) {
return ChatScreen(); // Navigate to Chat Screen
}
},
);
}
}
33 changes: 33 additions & 0 deletions lib/navigate_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import 'package:flutter/material.dart';

class NavigateButton extends StatelessWidget {
// const NavigateButton({
// Key key,
// }) : super(key: key);
NavigateButton({this.color, @required this.onPressed, this.title});

final Color color;
final Function onPressed;
final String title;

@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 16.0),
child: Material(
elevation: 5.0,
color: color, //Colors.lightBlueAccent
borderRadius: BorderRadius.circular(30.0),
child: MaterialButton(
onPressed: onPressed,
minWidth: 200.0,
height: 42.0,
child: Text(
title,
style: TextStyle(color: Colors.white),
),
),
),
);
}
}
Loading