From ef25477de9dbc27cd121b8fc76b589d36c9fd2d7 Mon Sep 17 00:00:00 2001 From: Lucas Gabriel <90lucasgabriel@gmail.com> Date: Sat, 17 Apr 2021 11:10:29 -0300 Subject: [PATCH 01/12] 01 - New: Firebase settings; --- android/app/build.gradle | 4 +- android/app/google-services.json | 47 +++++ android/app/src/debug/AndroidManifest.xml | 2 +- android/app/src/main/AndroidManifest.xml | 2 +- .../lucasgabriel/chat/chat/MainActivity.kt | 2 +- android/app/src/profile/AndroidManifest.xml | 2 +- android/build.gradle | 3 +- ios/Flutter/Debug.xcconfig | 1 + ios/Flutter/Release.xcconfig | 1 + ios/Podfile | 41 ++++ ios/Runner.xcodeproj/project.pbxproj | 6 +- lib/main.dart | 31 ++- pubspec.lock | 190 +++++++++++++++++- pubspec.yaml | 6 + 14 files changed, 327 insertions(+), 11 deletions(-) create mode 100644 android/app/google-services.json create mode 100644 ios/Podfile diff --git a/android/app/build.gradle b/android/app/build.gradle index d48950c..cb9f0dd 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -24,6 +24,7 @@ if (flutterVersionName == null) { apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" +apply plugin: 'com.google.gms.google-services' android { compileSdkVersion rootProject.ext.compileSdkVersion @@ -35,7 +36,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "br.com.lucasgabriel.chat.chat" + applicationId "br.com.lucasgabriel.chat" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode flutterVersionCode.toInteger() @@ -57,4 +58,5 @@ flutter { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation platform('com.google.firebase:firebase-bom:27.0.0') } diff --git a/android/app/google-services.json b/android/app/google-services.json new file mode 100644 index 0000000..58e65ed --- /dev/null +++ b/android/app/google-services.json @@ -0,0 +1,47 @@ +{ + "project_info": { + "project_number": "778715077891", + "project_id": "chat-flutter-4b882", + "storage_bucket": "chat-flutter-4b882.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:778715077891:android:412992c89d51e6389a5d36", + "android_client_info": { + "package_name": "br.com.lucasgabriel.chat" + } + }, + "oauth_client": [ + { + "client_id": "778715077891-8cv2tokv7al69c8ldsjnoasmsss7dsri.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "br.com.lucasgabriel.chat", + "certificate_hash": "cf92da8cda5bb3d00b5db8f4f0928682a7e4b2e0" + } + }, + { + "client_id": "778715077891-9g4hol2rhrqbl0ss1trhnjoorv3fce7g.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyCR46JXpr2WfdgJU6N_rPcJ3WWhYPcoduc" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "778715077891-9g4hol2rhrqbl0ss1trhnjoorv3fce7g.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 16ecf4a..50cc583 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="br.com.lucasgabriel.chat"> diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index f23b03f..3cc240a 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="br.com.lucasgabriel.chat"> diff --git a/android/app/src/main/kotlin/br/com/lucasgabriel/chat/chat/MainActivity.kt b/android/app/src/main/kotlin/br/com/lucasgabriel/chat/chat/MainActivity.kt index cf743df..fe46ba5 100644 --- a/android/app/src/main/kotlin/br/com/lucasgabriel/chat/chat/MainActivity.kt +++ b/android/app/src/main/kotlin/br/com/lucasgabriel/chat/chat/MainActivity.kt @@ -1,4 +1,4 @@ -package br.com.lucasgabriel.chat.chat +package br.com.lucasgabriel.chat import io.flutter.embedding.android.FlutterActivity diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml index 16ecf4a..50cc583 100644 --- a/android/app/src/profile/AndroidManifest.xml +++ b/android/app/src/profile/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="br.com.lucasgabriel.chat"> diff --git a/android/build.gradle b/android/build.gradle index dab0e2a..23831dd 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,7 +2,7 @@ buildscript { ext.kotlin_version = '1.3.50' ext { // buildToolsVersion = "29.0.2" - minSdkVersion = 16 + minSdkVersion = 21 compileSdkVersion = 30 targetSdkVersion = 30 ndkVersion = "23.0.7196353" @@ -16,6 +16,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:4.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'com.google.gms:google-services:4.3.5' } } diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index 592ceee..ec97fc6 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index 592ceee..c4855bf 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Podfile b/ios/Podfile new file mode 100644 index 0000000..1e8c3c9 --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,41 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '9.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 139513d..3182f06 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -291,7 +291,7 @@ ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = br.com.lucasgabriel.chat.chat; + PRODUCT_BUNDLE_IDENTIFIER = br.com.lucasgabriel.chat; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -415,7 +415,7 @@ ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = br.com.lucasgabriel.chat.chat; + PRODUCT_BUNDLE_IDENTIFIER = br.com.lucasgabriel.chat; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -434,7 +434,7 @@ ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = br.com.lucasgabriel.chat.chat; + PRODUCT_BUNDLE_IDENTIFIER = br.com.lucasgabriel.chat; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/lib/main.dart b/lib/main.dart index e04130f..d6b5e65 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,3 +1,32 @@ import 'package:flutter/material.dart'; +import 'package:firebase_core/firebase_core.dart'; +import 'package:cloud_firestore/cloud_firestore.dart'; -void main() {} +void main() async { + WidgetsFlutterBinding.ensureInitialized(); + await Firebase.initializeApp(); + + runApp(App()); +} + +class App extends StatelessWidget { + final firestore = FirebaseFirestore.instance; + + Future addUser() async { + return firestore.collection('users').add({ + 'name': 'Lucas Gabriel Teixeira', + }); + } + + @override + Widget build(BuildContext context) { + return MaterialApp( + home: TextButton( + onPressed: addUser, + child: Text( + "Add User", + ), + ), + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index 763ea98..94d0656 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -36,6 +36,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0" + cloud_firestore: + dependency: "direct main" + description: + name: cloud_firestore + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.5" + cloud_firestore_platform_interface: + dependency: transitive + description: + name: cloud_firestore_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.1" + cloud_firestore_web: + dependency: transitive + description: + name: cloud_firestore_web + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.5" collection: dependency: transitive description: @@ -57,16 +78,161 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + firebase_auth: + dependency: "direct main" + description: + name: firebase_auth + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + firebase_auth_platform_interface: + dependency: transitive + description: + name: firebase_auth_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.0" + firebase_auth_web: + dependency: transitive + description: + name: firebase_auth_web + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.6" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + firebase_storage: + dependency: "direct main" + description: + name: firebase_storage + url: "https://pub.dartlang.org" + source: hosted + version: "8.0.3" + firebase_storage_platform_interface: + dependency: transitive + description: + name: firebase_storage_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + firebase_storage_web: + dependency: transitive + description: + name: firebase_storage_web + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + google_sign_in: + dependency: "direct main" + description: + name: google_sign_in + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.2" + google_sign_in_platform_interface: + dependency: transitive + description: + name: google_sign_in_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + google_sign_in_web: + dependency: transitive + description: + name: google_sign_in_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.0" + http: + dependency: transitive + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.13.1" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0" + image_picker: + dependency: "direct main" + description: + name: image_picker + url: "https://pub.dartlang.org" + source: hosted + version: "0.7.4" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + image_picker_platform_interface: + dependency: transitive + description: + name: image_picker_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + intl: + dependency: transitive + description: + name: intl + url: "https://pub.dartlang.org" + source: hosted + version: "0.17.0" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3" matcher: dependency: transitive description: @@ -88,6 +254,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.8.0" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + quiver: + dependency: transitive + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" sky_engine: dependency: transitive description: flutter @@ -150,4 +337,5 @@ packages: source: hosted version: "2.1.0" sdks: - dart: ">=2.12.0-0.0 <3.0.0" + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.20.0" diff --git a/pubspec.yaml b/pubspec.yaml index 01495aa..9659d31 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,6 +28,12 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 + firebase_core: ^1.0.3 + cloud_firestore: ^1.0.5 + firebase_auth: ^1.1.0 + google_sign_in: ^5.0.2 + firebase_storage: ^8.0.3 + image_picker: ^0.7.4 dev_dependencies: flutter_test: From e115c2e03b9e27d9b6a42ac21accfc67b0357435 Mon Sep 17 00:00:00 2001 From: Lucas Gabriel <90lucasgabriel@gmail.com> Date: Sat, 17 Apr 2021 12:14:43 -0300 Subject: [PATCH 02/12] 01 - Update: Firebase initialization; --- lib/main.dart | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index d6b5e65..1303050 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,20 +2,20 @@ import 'package:flutter/material.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; -void main() async { +void main() { WidgetsFlutterBinding.ensureInitialized(); - await Firebase.initializeApp(); - + Firebase.initializeApp(); runApp(App()); } class App extends StatelessWidget { - final firestore = FirebaseFirestore.instance; - Future addUser() async { - return firestore.collection('users').add({ - 'name': 'Lucas Gabriel Teixeira', - }); + return FirebaseFirestore.instance + .collection('COLLECTION_NAME') + .doc('DOC_ID') + .collection('SUBCOLLECTION_NAME') + .doc() + .set({'file': 'filename'}); } @override @@ -28,5 +28,23 @@ class App extends StatelessWidget { ), ), ); + + // return FutureBuilder( + // future: _firebaseInit(), + // builder: (context, snapshot) { + // if (snapshot.connectionState == ConnectionState.done) { + // return MaterialApp( + // home: TextButton( + // onPressed: addUser, + // child: Text( + // "Add User", + // ), + // ), + // ); + // } + + // return MaterialApp(home: CircularProgressIndicator()); + // }, + // ); } } From 4687e2e440defc017e440bcb59e01d226ce00b6b Mon Sep 17 00:00:00 2001 From: Lucas Gabriel <90lucasgabriel@gmail.com> Date: Sat, 17 Apr 2021 13:25:34 -0300 Subject: [PATCH 03/12] 03 - Update: Read firebase data; --- lib/main.dart | 89 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 57 insertions(+), 32 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 1303050..9363e5b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -4,47 +4,72 @@ import 'package:cloud_firestore/cloud_firestore.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); - Firebase.initializeApp(); - runApp(App()); + runApp(Home()); } -class App extends StatelessWidget { - Future addUser() async { - return FirebaseFirestore.instance - .collection('COLLECTION_NAME') - .doc('DOC_ID') - .collection('SUBCOLLECTION_NAME') +class Home extends StatefulWidget { + @override + _HomeState createState() => _HomeState(); +} + +class _HomeState extends State { + void firebaseInit() async { + await Firebase.initializeApp(); + checkUpdates(); + } + + void addUser() async { + FirebaseFirestore.instance + .collection('users') .doc() - .set({'file': 'filename'}); + .set({'name': 'Name Lastname'}); + } + + void getData() async { + QuerySnapshot messages = + await FirebaseFirestore.instance.collection('messages').get(); + messages.docs.forEach((element) { + print(element.data()); + }); + } + + void checkUpdates() { + FirebaseFirestore.instance + .collection('messages') + .snapshots() + .listen((event) { + event.docs.forEach((element) { + print(element.data()); + }); + }); + } + + @override + void initState() { + super.initState(); + firebaseInit(); } @override Widget build(BuildContext context) { return MaterialApp( - home: TextButton( - onPressed: addUser, - child: Text( - "Add User", - ), + home: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + TextButton( + onPressed: addUser, + child: Text( + "Add User", + ), + ), + TextButton( + onPressed: getData, + child: Text( + "Read User documents", + ), + ), + ], ), ); - - // return FutureBuilder( - // future: _firebaseInit(), - // builder: (context, snapshot) { - // if (snapshot.connectionState == ConnectionState.done) { - // return MaterialApp( - // home: TextButton( - // onPressed: addUser, - // child: Text( - // "Add User", - // ), - // ), - // ); - // } - - // return MaterialApp(home: CircularProgressIndicator()); - // }, - // ); } } From 2b473e01f18630f11cc5f5cbce28c4ffbc71a065 Mon Sep 17 00:00:00 2001 From: Lucas Gabriel <90lucasgabriel@gmail.com> Date: Sat, 17 Apr 2021 14:49:00 -0300 Subject: [PATCH 04/12] 04 - New: Textfield; --- lib/main.dart | 70 +++++------------------------------------ lib/ui/chat_screen.dart | 26 +++++++++++++++ lib/widgets/input.dart | 40 +++++++++++++++++++++++ 3 files changed, 74 insertions(+), 62 deletions(-) create mode 100644 lib/ui/chat_screen.dart create mode 100644 lib/widgets/input.dart diff --git a/lib/main.dart b/lib/main.dart index 9363e5b..9b053b4 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,75 +1,21 @@ import 'package:flutter/material.dart'; -import 'package:firebase_core/firebase_core.dart'; -import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:chat/ui/chat_screen.dart'; void main() { - WidgetsFlutterBinding.ensureInitialized(); runApp(Home()); } -class Home extends StatefulWidget { - @override - _HomeState createState() => _HomeState(); -} - -class _HomeState extends State { - void firebaseInit() async { - await Firebase.initializeApp(); - checkUpdates(); - } - - void addUser() async { - FirebaseFirestore.instance - .collection('users') - .doc() - .set({'name': 'Name Lastname'}); - } - - void getData() async { - QuerySnapshot messages = - await FirebaseFirestore.instance.collection('messages').get(); - messages.docs.forEach((element) { - print(element.data()); - }); - } - - void checkUpdates() { - FirebaseFirestore.instance - .collection('messages') - .snapshots() - .listen((event) { - event.docs.forEach((element) { - print(element.data()); - }); - }); - } - - @override - void initState() { - super.initState(); - firebaseInit(); - } - +class Home extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - home: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - TextButton( - onPressed: addUser, - child: Text( - "Add User", - ), - ), - TextButton( - onPressed: getData, - child: Text( - "Read User documents", - ), - ), - ], + title: 'Chat Flutter', + debugShowCheckedModeBanner: false, + theme: ThemeData( + primarySwatch: Colors.green, + iconTheme: IconThemeData(color: Colors.green), ), + home: ChatScreen(), ); } } diff --git a/lib/ui/chat_screen.dart b/lib/ui/chat_screen.dart new file mode 100644 index 0000000..c66f7a3 --- /dev/null +++ b/lib/ui/chat_screen.dart @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; +import 'package:chat/widgets/input.dart'; + +class ChatScreen extends StatefulWidget { + @override + _ChatScreenState createState() => _ChatScreenState(); +} + +class _ChatScreenState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Chat Flutter'), + ), + body: Column( + children: [ + Expanded( + child: Container(), + ), + Input(), + ], + ), + ); + } +} diff --git a/lib/widgets/input.dart b/lib/widgets/input.dart new file mode 100644 index 0000000..0179162 --- /dev/null +++ b/lib/widgets/input.dart @@ -0,0 +1,40 @@ +import 'package:flutter/material.dart'; + +class Input extends StatefulWidget { + @override + _InputState createState() => _InputState(); +} + +class _InputState extends State { + bool _isSendEnabled = false; + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.all(8), + child: Row( + children: [ + IconButton( + icon: Icon(Icons.photo_camera), + onPressed: () {}, + ), + Expanded( + child: TextField( + decoration: InputDecoration.collapsed(hintText: 'Send a message'), + onChanged: (value) { + setState(() { + _isSendEnabled = value.isNotEmpty; + }); + }, + // onSubmitted: () {}, + ), + ), + IconButton( + icon: Icon(Icons.send), + onPressed: _isSendEnabled ? () {} : null, + ), + ], + ), + ); + } +} From 8b4b8d55a01d41cf855efffc309da22083f035bc Mon Sep 17 00:00:00 2001 From: Lucas Gabriel <90lucasgabriel@gmail.com> Date: Sat, 17 Apr 2021 20:08:04 -0300 Subject: [PATCH 05/12] 05 - New: Send message to Firebase; --- lib/main.dart | 20 +++++++++++++++++++- lib/ui/chat_screen.dart | 8 +++++++- lib/widgets/input.dart | 31 +++++++++++++++++++++++++++++-- 3 files changed, 55 insertions(+), 4 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 9b053b4..08a676a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,11 +1,29 @@ import 'package:flutter/material.dart'; +import 'package:firebase_core/firebase_core.dart'; + import 'package:chat/ui/chat_screen.dart'; void main() { + WidgetsFlutterBinding.ensureInitialized(); runApp(Home()); } -class Home extends StatelessWidget { +class Home extends StatefulWidget { + @override + _HomeState createState() => _HomeState(); +} + +class _HomeState extends State { + void firebaseInit() async { + await Firebase.initializeApp(); + } + + @override + void initState() { + super.initState(); + firebaseInit(); + } + @override Widget build(BuildContext context) { return MaterialApp( diff --git a/lib/ui/chat_screen.dart b/lib/ui/chat_screen.dart index c66f7a3..505a296 100644 --- a/lib/ui/chat_screen.dart +++ b/lib/ui/chat_screen.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:cloud_firestore/cloud_firestore.dart'; + import 'package:chat/widgets/input.dart'; class ChatScreen extends StatefulWidget { @@ -7,6 +9,10 @@ class ChatScreen extends StatefulWidget { } class _ChatScreenState extends State { + void _sendMessage(String value) { + FirebaseFirestore.instance.collection('messages').add({'value': value}); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -18,7 +24,7 @@ class _ChatScreenState extends State { Expanded( child: Container(), ), - Input(), + Input(_sendMessage), ], ), ); diff --git a/lib/widgets/input.dart b/lib/widgets/input.dart index 0179162..178b789 100644 --- a/lib/widgets/input.dart +++ b/lib/widgets/input.dart @@ -1,12 +1,30 @@ import 'package:flutter/material.dart'; class Input extends StatefulWidget { + /** + * Send message to Firebase + */ + final Function(String) sendMessage; + + /** + * Constructor + */ + Input(this.sendMessage); + @override _InputState createState() => _InputState(); } class _InputState extends State { bool _isSendEnabled = false; + final TextEditingController _messageController = TextEditingController(); + + void _reset() { + _messageController.clear(); + setState(() { + _isSendEnabled = false; + }); + } @override Widget build(BuildContext context) { @@ -20,18 +38,27 @@ class _InputState extends State { ), Expanded( child: TextField( + controller: _messageController, decoration: InputDecoration.collapsed(hintText: 'Send a message'), onChanged: (value) { setState(() { _isSendEnabled = value.isNotEmpty; }); }, - // onSubmitted: () {}, + onSubmitted: (value) { + widget.sendMessage(value); + _reset(); + }, ), ), IconButton( icon: Icon(Icons.send), - onPressed: _isSendEnabled ? () {} : null, + onPressed: _isSendEnabled + ? () { + widget.sendMessage(_messageController.text); + _reset(); + } + : null, ), ], ), From 5f8dcf9342fb8893988c2be594a3f0271414d189 Mon Sep 17 00:00:00 2001 From: Lucas Gabriel <90lucasgabriel@gmail.com> Date: Sat, 17 Apr 2021 21:16:13 -0300 Subject: [PATCH 06/12] 06 - New: Pick image; 06 - New: Send image to Firebase; --- lib/ui/chat_screen.dart | 23 +++++++++++++++++++++-- lib/widgets/input.dart | 18 ++++++++++++++---- web/index.html | 3 +++ 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/lib/ui/chat_screen.dart b/lib/ui/chat_screen.dart index 505a296..023e015 100644 --- a/lib/ui/chat_screen.dart +++ b/lib/ui/chat_screen.dart @@ -1,5 +1,7 @@ import 'package:flutter/material.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:firebase_storage/firebase_storage.dart'; +import 'dart:io'; import 'package:chat/widgets/input.dart'; @@ -9,8 +11,25 @@ class ChatScreen extends StatefulWidget { } class _ChatScreenState extends State { - void _sendMessage(String value) { - FirebaseFirestore.instance.collection('messages').add({'value': value}); + void _sendMessage({String value, File file}) async { + Map data = {}; + + if (file != null) { + UploadTask task = FirebaseStorage.instance + .ref() + .child(DateTime.now().millisecondsSinceEpoch.toString()) + .putFile(file); + + TaskSnapshot taskSnapshot = await task.whenComplete(() {}); + String url = await taskSnapshot.ref.getDownloadURL(); + data['imageUrl'] = url; + } + + if (value != null) { + data['value'] = value; + } + + FirebaseFirestore.instance.collection('messages').add(data); } @override diff --git a/lib/widgets/input.dart b/lib/widgets/input.dart index 178b789..97df97e 100644 --- a/lib/widgets/input.dart +++ b/lib/widgets/input.dart @@ -1,10 +1,12 @@ import 'package:flutter/material.dart'; +import 'dart:io'; +import 'package:image_picker/image_picker.dart'; class Input extends StatefulWidget { /** * Send message to Firebase */ - final Function(String) sendMessage; + final Function({String value, File file}) sendMessage; /** * Constructor @@ -34,7 +36,15 @@ class _InputState extends State { children: [ IconButton( icon: Icon(Icons.photo_camera), - onPressed: () {}, + onPressed: () async { + final ImagePicker _picker = ImagePicker(); + final PickedFile response = + await _picker.getImage(source: ImageSource.camera); + final File file = File(response.path); + + if (response == null) return; + widget.sendMessage(file: file); + }, ), Expanded( child: TextField( @@ -46,7 +56,7 @@ class _InputState extends State { }); }, onSubmitted: (value) { - widget.sendMessage(value); + widget.sendMessage(value: value); _reset(); }, ), @@ -55,7 +65,7 @@ class _InputState extends State { icon: Icon(Icons.send), onPressed: _isSendEnabled ? () { - widget.sendMessage(_messageController.text); + widget.sendMessage(value: _messageController.text); _reset(); } : null, diff --git a/web/index.html b/web/index.html index 951a703..70e8d40 100644 --- a/web/index.html +++ b/web/index.html @@ -40,6 +40,9 @@ }); } + + + From 4a609d1c659cf8c686ae116d0f814d094133feba Mon Sep 17 00:00:00 2001 From: Lucas Gabriel <90lucasgabriel@gmail.com> Date: Sun, 18 Apr 2021 09:41:12 -0300 Subject: [PATCH 07/12] 07 - New: List messages; --- lib/ui/chat_screen.dart | 27 ++++++++++++++++++++++++++- lib/widgets/input.dart | 8 ++------ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/lib/ui/chat_screen.dart b/lib/ui/chat_screen.dart index 023e015..93d3363 100644 --- a/lib/ui/chat_screen.dart +++ b/lib/ui/chat_screen.dart @@ -41,7 +41,32 @@ class _ChatScreenState extends State { body: Column( children: [ Expanded( - child: Container(), + child: StreamBuilder( + stream: + FirebaseFirestore.instance.collection('messages').snapshots(), + builder: (context, snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.none: + case ConnectionState.waiting: + return Center( + child: CircularProgressIndicator(), + ); + default: + List documentList = + snapshot.data.docs.reversed.toList(); + + return ListView.builder( + itemCount: documentList.length, + reverse: true, + itemBuilder: (context, index) { + return ListTile( + title: Text(documentList[index].data()['value']), + ); + }, + ); + } + }, + ), ), Input(_sendMessage), ], diff --git a/lib/widgets/input.dart b/lib/widgets/input.dart index 97df97e..adff8ac 100644 --- a/lib/widgets/input.dart +++ b/lib/widgets/input.dart @@ -3,14 +3,10 @@ import 'dart:io'; import 'package:image_picker/image_picker.dart'; class Input extends StatefulWidget { - /** - * Send message to Firebase - */ + /// Send message to Firebase final Function({String value, File file}) sendMessage; - /** - * Constructor - */ + /// Constructor Input(this.sendMessage); @override From 3b160c0f09e7e3fc7b5974ac828015be7a1cc550 Mon Sep 17 00:00:00 2001 From: Lucas Gabriel <90lucasgabriel@gmail.com> Date: Sun, 18 Apr 2021 10:38:36 -0300 Subject: [PATCH 08/12] 08 - New: Auth; --- lib/main.dart | 42 ++++++++++++++----------------- lib/ui/chat_screen.dart | 56 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 74 insertions(+), 24 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 08a676a..0ec8e82 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -8,32 +8,28 @@ void main() { runApp(Home()); } -class Home extends StatefulWidget { - @override - _HomeState createState() => _HomeState(); -} - -class _HomeState extends State { - void firebaseInit() async { - await Firebase.initializeApp(); - } - - @override - void initState() { - super.initState(); - firebaseInit(); - } +class Home extends StatelessWidget { + final Future _firebaseInit = Firebase.initializeApp(); @override Widget build(BuildContext context) { - return MaterialApp( - title: 'Chat Flutter', - debugShowCheckedModeBanner: false, - theme: ThemeData( - primarySwatch: Colors.green, - iconTheme: IconThemeData(color: Colors.green), - ), - home: ChatScreen(), + return FutureBuilder( + future: _firebaseInit, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.done) { + return MaterialApp( + title: 'Chat Flutter', + debugShowCheckedModeBanner: false, + theme: ThemeData( + primarySwatch: Colors.green, + iconTheme: IconThemeData(color: Colors.green), + ), + home: ChatScreen(), + ); + } + + return CircularProgressIndicator(); + }, ); } } diff --git a/lib/ui/chat_screen.dart b/lib/ui/chat_screen.dart index 93d3363..9c6613e 100644 --- a/lib/ui/chat_screen.dart +++ b/lib/ui/chat_screen.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:firebase_storage/firebase_storage.dart'; +import 'package:firebase_auth/firebase_auth.dart'; +import 'package:google_sign_in/google_sign_in.dart'; import 'dart:io'; import 'package:chat/widgets/input.dart'; @@ -11,8 +13,51 @@ class ChatScreen extends StatefulWidget { } class _ChatScreenState extends State { + final GoogleSignIn googleSignin = GoogleSignIn(); + User _user; + + Future _getUser() async { + try { + if (_user != null) return _user; + + final GoogleSignInAccount googleUser = await GoogleSignIn().signIn(); + final GoogleSignInAuthentication googleAuth = + await googleUser.authentication; + + final GoogleAuthCredential credential = GoogleAuthProvider.credential( + accessToken: googleAuth.accessToken, + idToken: googleAuth.idToken, + ); + + final UserCredential userCredential = + await FirebaseAuth.instance.signInWithCredential(credential); + + final User user = userCredential.user; + + return user; + } catch (error) { + return null; + } + } + void _sendMessage({String value, File file}) async { - Map data = {}; + final User user = await _getUser(); + + if (user == null) { + Widget snackbar = SnackBar( + content: Text('Não foi possível realizar o login. Tente novamente.'), + backgroundColor: Colors.red, + ); + + ScaffoldMessenger.of(context).removeCurrentSnackBar(); + ScaffoldMessenger.of(context).showSnackBar(snackbar); + } + + Map data = { + 'senderUid': user.uid, + 'senderName': user.displayName, + 'senderPhotoUrl': user.photoURL, + }; if (file != null) { UploadTask task = FirebaseStorage.instance @@ -32,6 +77,15 @@ class _ChatScreenState extends State { FirebaseFirestore.instance.collection('messages').add(data); } + @override + void initState() { + super.initState(); + + FirebaseAuth.instance.authStateChanges().listen((user) { + _user = user; + }); + } + @override Widget build(BuildContext context) { return Scaffold( From 7f94271ea2f77dbacc200cda6971b7c0c8ce0892 Mon Sep 17 00:00:00 2001 From: Lucas Gabriel <90lucasgabriel@gmail.com> Date: Sun, 18 Apr 2021 11:35:53 -0300 Subject: [PATCH 09/12] 09 - New: Chat message info; --- lib/ui/chat_screen.dart | 8 +++-- lib/widgets/chat_message.dart | 60 +++++++++++++++++++++++++++++++++++ lib/widgets/input.dart | 1 + web/index.html | 1 + 4 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 lib/widgets/chat_message.dart diff --git a/lib/ui/chat_screen.dart b/lib/ui/chat_screen.dart index 9c6613e..a1ad98b 100644 --- a/lib/ui/chat_screen.dart +++ b/lib/ui/chat_screen.dart @@ -5,6 +5,7 @@ import 'package:firebase_auth/firebase_auth.dart'; import 'package:google_sign_in/google_sign_in.dart'; import 'dart:io'; +import 'package:chat/widgets/chat_message.dart'; import 'package:chat/widgets/input.dart'; class ChatScreen extends StatefulWidget { @@ -51,8 +52,11 @@ class _ChatScreenState extends State { ScaffoldMessenger.of(context).removeCurrentSnackBar(); ScaffoldMessenger.of(context).showSnackBar(snackbar); + + return; } + print(user); Map data = { 'senderUid': user.uid, 'senderName': user.displayName, @@ -113,9 +117,7 @@ class _ChatScreenState extends State { itemCount: documentList.length, reverse: true, itemBuilder: (context, index) { - return ListTile( - title: Text(documentList[index].data()['value']), - ); + return ChatMessage(documentList[index].data(), true); }, ); } diff --git a/lib/widgets/chat_message.dart b/lib/widgets/chat_message.dart new file mode 100644 index 0000000..643ac95 --- /dev/null +++ b/lib/widgets/chat_message.dart @@ -0,0 +1,60 @@ +import 'package:flutter/material.dart'; + +class ChatMessage extends StatelessWidget { + /// Props + /// Message info + final Map data; + + /// Check if message is mine + final bool isOwner; + + /// Constructor + ChatMessage(this.data, this.isOwner); + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.symmetric(vertical: 8, horizontal: 8), + child: Row( + children: [ + if (!isOwner) + Container( + padding: EdgeInsets.only(right: 8), + child: CircleAvatar( + backgroundImage: NetworkImage(data['senderPhotoUrl']), + ), + ), + Expanded( + child: Column( + crossAxisAlignment: + isOwner ? CrossAxisAlignment.end : CrossAxisAlignment.start, + children: [ + data['imageUrl'] != null + ? Image.network( + data['imageUrl'], + width: 250, + ) + : Text( + data['value'], + textAlign: isOwner ? TextAlign.end : TextAlign.start, + style: TextStyle(fontSize: 14), + ), + Text( + data['senderName'], + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w300), + ), + ], + ), + ), + if (isOwner) + Container( + padding: EdgeInsets.only(left: 8), + child: CircleAvatar( + backgroundImage: NetworkImage(data['senderPhotoUrl']), + ), + ), + ], + ), + ); + } +} diff --git a/lib/widgets/input.dart b/lib/widgets/input.dart index adff8ac..d2c9c32 100644 --- a/lib/widgets/input.dart +++ b/lib/widgets/input.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'package:image_picker/image_picker.dart'; class Input extends StatefulWidget { + /// Props /// Send message to Firebase final Function({String value, File file}) sendMessage; diff --git a/web/index.html b/web/index.html index 70e8d40..a0e3802 100644 --- a/web/index.html +++ b/web/index.html @@ -43,6 +43,7 @@ + From 783761f46b71db91f36052ad7a3840710e78a17f Mon Sep 17 00:00:00 2001 From: Lucas Gabriel <90lucasgabriel@gmail.com> Date: Sun, 18 Apr 2021 12:17:49 -0300 Subject: [PATCH 10/12] 10 - New: Logout; 10 - New: Alignment by owner; 10 - New: Order by created; 10 - New: Image upload loader; --- lib/ui/chat_screen.dart | 50 +++++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/lib/ui/chat_screen.dart b/lib/ui/chat_screen.dart index a1ad98b..74b5f32 100644 --- a/lib/ui/chat_screen.dart +++ b/lib/ui/chat_screen.dart @@ -15,7 +15,9 @@ class ChatScreen extends StatefulWidget { class _ChatScreenState extends State { final GoogleSignIn googleSignin = GoogleSignIn(); + User _user; + bool _isLoading = false; Future _getUser() async { try { @@ -46,7 +48,7 @@ class _ChatScreenState extends State { if (user == null) { Widget snackbar = SnackBar( - content: Text('Não foi possível realizar o login. Tente novamente.'), + content: Text('Login error. Try again.'), backgroundColor: Colors.red, ); @@ -56,14 +58,18 @@ class _ChatScreenState extends State { return; } - print(user); Map data = { 'senderUid': user.uid, 'senderName': user.displayName, 'senderPhotoUrl': user.photoURL, + 'createdAt': Timestamp.now(), }; if (file != null) { + setState(() { + _isLoading = true; + }); + UploadTask task = FirebaseStorage.instance .ref() .child(DateTime.now().millisecondsSinceEpoch.toString()) @@ -72,6 +78,10 @@ class _ChatScreenState extends State { TaskSnapshot taskSnapshot = await task.whenComplete(() {}); String url = await taskSnapshot.ref.getDownloadURL(); data['imageUrl'] = url; + + setState(() { + _isLoading = false; + }); } if (value != null) { @@ -86,7 +96,9 @@ class _ChatScreenState extends State { super.initState(); FirebaseAuth.instance.authStateChanges().listen((user) { - _user = user; + setState(() { + _user = user; + }); }); } @@ -94,14 +106,34 @@ class _ChatScreenState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: Text('Chat Flutter'), + title: Text( + _user != null ? 'Hello, ${_user.displayName}' : 'Chat Flutter'), + actions: [ + if (_user != null) + IconButton( + icon: Icon(Icons.logout), + onPressed: () { + FirebaseAuth.instance.signOut(); + GoogleSignIn().signOut(); + + Widget snackbar = SnackBar( + content: Text('You logged out.'), + ); + + ScaffoldMessenger.of(context).removeCurrentSnackBar(); + ScaffoldMessenger.of(context).showSnackBar(snackbar); + }, + ), + ], ), body: Column( children: [ Expanded( child: StreamBuilder( - stream: - FirebaseFirestore.instance.collection('messages').snapshots(), + stream: FirebaseFirestore.instance + .collection('messages') + .orderBy('createdAt') + .snapshots(), builder: (context, snapshot) { switch (snapshot.connectionState) { case ConnectionState.none: @@ -117,13 +149,17 @@ class _ChatScreenState extends State { itemCount: documentList.length, reverse: true, itemBuilder: (context, index) { - return ChatMessage(documentList[index].data(), true); + return ChatMessage( + documentList[index].data(), + documentList[index].data()['senderUid'] == + _user?.uid); }, ); } }, ), ), + if (_isLoading) LinearProgressIndicator(), Input(_sendMessage), ], ), From 0f5bb337a881ebc1c792a62f3fb288a3ffaaf8d1 Mon Sep 17 00:00:00 2001 From: Lucas Gabriel <90lucasgabriel@gmail.com> Date: Sun, 18 Apr 2021 15:02:54 -0300 Subject: [PATCH 11/12] 11 - New: iOS settings; --- .vscode/launch.json | 13 + android/app/src/main/AndroidManifest.xml | 3 +- ios/Podfile | 2 +- ios/Podfile.lock | 421 ++++++++++++++++++ ios/Runner.xcodeproj/project.pbxproj | 110 ++++- .../contents.xcworkspacedata | 3 + ios/Runner/GoogleService-Info.plist | 36 ++ ios/Runner/Info.plist | 18 + lib/ui/chat_screen.dart | 3 +- web/index.html | 90 ++-- 10 files changed, 656 insertions(+), 43 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 ios/Podfile.lock create mode 100644 ios/Runner/GoogleService-Info.plist diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..d60b2e2 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,13 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "chat", + "request": "launch", + "type": "dart" + } + ] +} \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 3cc240a..b21b59e 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -2,7 +2,8 @@ package="br.com.lucasgabriel.chat"> + android:icon="@mipmap/ic_launcher" + android:requestLegacyExternalStorage="true"> 7.3.0) + - Firebase/CoreOnly (7.3.0): + - FirebaseCore (= 7.3.0) + - Firebase/Firestore (7.3.0): + - Firebase/CoreOnly + - FirebaseFirestore (~> 7.3.0) + - Firebase/Storage (7.3.0): + - Firebase/CoreOnly + - FirebaseStorage (~> 7.3.0) + - firebase_auth (1.1.0): + - Firebase/Auth (= 7.3.0) + - firebase_core + - Flutter + - firebase_core (1.0.3): + - Firebase/CoreOnly (= 7.3.0) + - Flutter + - firebase_storage (8.0.3): + - Firebase/Storage (= 7.3.0) + - firebase_core + - Flutter + - FirebaseAuth (7.3.0): + - FirebaseCore (~> 7.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.0) + - GoogleUtilities/Environment (~> 7.0) + - GTMSessionFetcher/Core (~> 1.4) + - FirebaseCore (7.3.0): + - FirebaseCoreDiagnostics (~> 7.0) + - GoogleUtilities/Environment (~> 7.0) + - GoogleUtilities/Logger (~> 7.0) + - FirebaseCoreDiagnostics (7.3.0): + - GoogleDataTransport (~> 8.0) + - GoogleUtilities/Environment (~> 7.0) + - GoogleUtilities/Logger (~> 7.0) + - nanopb (~> 2.30906.0) + - FirebaseFirestore (7.3.0): + - abseil/algorithm (= 0.20200225.0) + - abseil/base (= 0.20200225.0) + - abseil/memory (= 0.20200225.0) + - abseil/meta (= 0.20200225.0) + - abseil/strings/strings (= 0.20200225.0) + - abseil/time (= 0.20200225.0) + - abseil/types (= 0.20200225.0) + - FirebaseCore (~> 7.0) + - "gRPC-C++ (~> 1.28.0)" + - leveldb-library (~> 1.22) + - nanopb (~> 2.30906.0) + - FirebaseStorage (7.3.0): + - FirebaseCore (~> 7.0) + - GTMSessionFetcher/Core (~> 1.4) + - Flutter (1.0.0) + - google_sign_in (0.0.1): + - Flutter + - GoogleSignIn (~> 5.0) + - GoogleDataTransport (8.1.0): + - nanopb (~> 2.30906.0) + - GoogleSignIn (5.0.2): + - AppAuth (~> 1.2) + - GTMAppAuth (~> 1.0) + - GTMSessionFetcher/Core (~> 1.1) + - GoogleUtilities/AppDelegateSwizzler (7.3.1): + - GoogleUtilities/Environment + - GoogleUtilities/Logger + - GoogleUtilities/Network + - GoogleUtilities/Environment (7.3.1): + - PromisesObjC (~> 1.2) + - GoogleUtilities/Logger (7.3.1): + - GoogleUtilities/Environment + - GoogleUtilities/Network (7.3.1): + - GoogleUtilities/Logger + - "GoogleUtilities/NSData+zlib" + - GoogleUtilities/Reachability + - "GoogleUtilities/NSData+zlib (7.3.1)" + - GoogleUtilities/Reachability (7.3.1): + - GoogleUtilities/Logger + - "gRPC-C++ (1.28.2)": + - "gRPC-C++/Implementation (= 1.28.2)" + - "gRPC-C++/Interface (= 1.28.2)" + - "gRPC-C++/Implementation (1.28.2)": + - abseil/container/inlined_vector (= 0.20200225.0) + - abseil/memory/memory (= 0.20200225.0) + - abseil/strings/str_format (= 0.20200225.0) + - abseil/strings/strings (= 0.20200225.0) + - abseil/types/optional (= 0.20200225.0) + - "gRPC-C++/Interface (= 1.28.2)" + - gRPC-Core (= 1.28.2) + - "gRPC-C++/Interface (1.28.2)" + - gRPC-Core (1.28.2): + - gRPC-Core/Implementation (= 1.28.2) + - gRPC-Core/Interface (= 1.28.2) + - gRPC-Core/Implementation (1.28.2): + - abseil/container/inlined_vector (= 0.20200225.0) + - abseil/memory/memory (= 0.20200225.0) + - abseil/strings/str_format (= 0.20200225.0) + - abseil/strings/strings (= 0.20200225.0) + - abseil/types/optional (= 0.20200225.0) + - BoringSSL-GRPC (= 0.0.7) + - gRPC-Core/Interface (= 1.28.2) + - gRPC-Core/Interface (1.28.2) + - GTMAppAuth (1.2.1): + - AppAuth/Core (~> 1.4) + - GTMSessionFetcher/Core (~> 1.5) + - GTMSessionFetcher/Core (1.5.0) + - image_picker (0.0.1): + - Flutter + - leveldb-library (1.22.1) + - nanopb (2.30906.0): + - nanopb/decode (= 2.30906.0) + - nanopb/encode (= 2.30906.0) + - nanopb/decode (2.30906.0) + - nanopb/encode (2.30906.0) + - PromisesObjC (1.2.12) + +DEPENDENCIES: + - cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) + - firebase_auth (from `.symlinks/plugins/firebase_auth/ios`) + - firebase_core (from `.symlinks/plugins/firebase_core/ios`) + - firebase_storage (from `.symlinks/plugins/firebase_storage/ios`) + - Flutter (from `Flutter`) + - google_sign_in (from `.symlinks/plugins/google_sign_in/ios`) + - image_picker (from `.symlinks/plugins/image_picker/ios`) + +SPEC REPOS: + trunk: + - abseil + - AppAuth + - BoringSSL-GRPC + - Firebase + - FirebaseAuth + - FirebaseCore + - FirebaseCoreDiagnostics + - FirebaseFirestore + - FirebaseStorage + - GoogleDataTransport + - GoogleSignIn + - GoogleUtilities + - "gRPC-C++" + - gRPC-Core + - GTMAppAuth + - GTMSessionFetcher + - leveldb-library + - nanopb + - PromisesObjC + +EXTERNAL SOURCES: + cloud_firestore: + :path: ".symlinks/plugins/cloud_firestore/ios" + firebase_auth: + :path: ".symlinks/plugins/firebase_auth/ios" + firebase_core: + :path: ".symlinks/plugins/firebase_core/ios" + firebase_storage: + :path: ".symlinks/plugins/firebase_storage/ios" + Flutter: + :path: Flutter + google_sign_in: + :path: ".symlinks/plugins/google_sign_in/ios" + image_picker: + :path: ".symlinks/plugins/image_picker/ios" + +SPEC CHECKSUMS: + abseil: 6c8eb7892aefa08d929b39f9bb108e5367e3228f + AppAuth: 31bcec809a638d7bd2f86ea8a52bd45f6e81e7c7 + BoringSSL-GRPC: 8edf627ee524575e2f8d19d56f068b448eea3879 + cloud_firestore: 8887a0c9657c09ca73c9273939c5e6bdb5d7aff2 + Firebase: 26223c695fe322633274198cb19dca8cb7e54416 + firebase_auth: d09964a120e218411768f5ca2d3ce938abd319f2 + firebase_core: b5d81dfd4fb2d6f700e67de34d9a633ae325c4e9 + firebase_storage: 2ce2146c1fa764e68330e6998fa386522c95d199 + FirebaseAuth: c224a0cf1afa0949bd5c7bfcf154b4f5ce8ddef2 + FirebaseCore: 4d3c72622ce0e2106aaa07bb4b2935ba2c370972 + FirebaseCoreDiagnostics: d50e11039e5984d92c8a512be2395f13df747350 + FirebaseFirestore: 1906bf163afdb7c432d2e3b5c40ceb9dd2df5820 + FirebaseStorage: 5002b1895bfe74a5ce92ad54f966e6162d0da2e5 + Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c + google_sign_in: 6bd214b9c154f881422f5fe27b66aaa7bbd580cc + GoogleDataTransport: 116c84c4bdeb76be2a7a46de51244368f9794eab + GoogleSignIn: 7137d297ddc022a7e0aa4619c86d72c909fa7213 + GoogleUtilities: e1d9ed4e544fc32a93e00e721400cbc3f377200d + "gRPC-C++": 13d8ccef97d5c3c441b7e3c529ef28ebee86fad2 + gRPC-Core: 4afa11bfbedf7cdecd04de535a9e046893404ed5 + GTMAppAuth: 5b53231ef6920f149ab84b2969cb0ab572da3077 + GTMSessionFetcher: b3503b20a988c4e20cc189aa798fd18220133f52 + image_picker: 50e7c7ff960e5f58faa4d1f4af84a771c671bc4a + leveldb-library: 50c7b45cbd7bf543c81a468fe557a16ae3db8729 + nanopb: 1bf24dd71191072e120b83dd02d08f3da0d65e53 + PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97 + +PODFILE CHECKSUM: fe0e1ee7f3d1f7d00b11b474b62dd62134535aea + +COCOAPODS: 1.10.1 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 3182f06..4304ceb 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,13 +3,15 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 50; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 8968AC637E32B9BA53AA4AD6 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 893B39976F17BF7174A7E5E3 /* Pods_Runner.framework */; }; + 8CD293C9262C973D0028C733 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 8CD293C8262C973D0028C733 /* GoogleService-Info.plist */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; @@ -29,12 +31,17 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 02DA1C7D3C2E155E0D902DF8 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 0461B6A1F2CCA3F2A880A396 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 65EBBEEF26CB070A5DD623DE /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 893B39976F17BF7174A7E5E3 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8CD293C8262C973D0028C733 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -49,12 +56,24 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 8968AC637E32B9BA53AA4AD6 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 6CA65B1BD1675C0FFB65FDF7 /* Pods */ = { + isa = PBXGroup; + children = ( + 0461B6A1F2CCA3F2A880A396 /* Pods-Runner.debug.xcconfig */, + 65EBBEEF26CB070A5DD623DE /* Pods-Runner.release.xcconfig */, + 02DA1C7D3C2E155E0D902DF8 /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -72,6 +91,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, + 6CA65B1BD1675C0FFB65FDF7 /* Pods */, + DB293E7CC7A099CCF9269844 /* Frameworks */, ); sourceTree = ""; }; @@ -86,6 +107,7 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( + 8CD293C8262C973D0028C733 /* GoogleService-Info.plist */, 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, @@ -98,6 +120,14 @@ path = Runner; sourceTree = ""; }; + DB293E7CC7A099CCF9269844 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 893B39976F17BF7174A7E5E3 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -105,12 +135,15 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + 58385400E981462675A46B9A /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + AD19B4B70A0F6C002C291B94 /* [CP] Embed Pods Frameworks */, + 79A1CC9D3F00DE8A4AA9D815 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -161,6 +194,7 @@ files = ( 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 8CD293C9262C973D0028C733 /* GoogleService-Info.plist in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, ); @@ -183,6 +217,45 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; + 58385400E981462675A46B9A /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 79A1CC9D3F00DE8A4AA9D815 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -197,6 +270,23 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + AD19B4B70A0F6C002C291B94 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -290,7 +380,10 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = br.com.lucasgabriel.chat; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -399,7 +492,8 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -414,7 +508,10 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = br.com.lucasgabriel.chat; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -433,7 +530,10 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = br.com.lucasgabriel.chat; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a1..21a3cc1 100644 --- a/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/ios/Runner/GoogleService-Info.plist b/ios/Runner/GoogleService-Info.plist new file mode 100644 index 0000000..daee6fe --- /dev/null +++ b/ios/Runner/GoogleService-Info.plist @@ -0,0 +1,36 @@ + + + + + CLIENT_ID + 778715077891-3gi3aopno8dm4kqid3de06mq7c02ps2m.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.778715077891-3gi3aopno8dm4kqid3de06mq7c02ps2m + ANDROID_CLIENT_ID + 778715077891-8cv2tokv7al69c8ldsjnoasmsss7dsri.apps.googleusercontent.com + API_KEY + AIzaSyA7l7Hq0KeWq99qCzlyeBPlQIhMUL5-o30 + GCM_SENDER_ID + 778715077891 + PLIST_VERSION + 1 + BUNDLE_ID + br.com.lucasgabriel.chat + PROJECT_ID + chat-flutter-4b882 + STORAGE_BUCKET + chat-flutter-4b882.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:778715077891:ios:4baf94117a6526039a5d36 + + \ No newline at end of file diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 5bec9d5..9bee527 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -41,5 +41,23 @@ UIViewControllerBasedStatusBarAppearance + NSPhotoLibraryUsageDescription + Select picture to send message + NSCameraUsageDescription + Take a picture to send message + NSMicrophoneUsageDescription + Take a picture to send message + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLSchemes + + + com.googleusercontent.apps.778715077891-3gi3aopno8dm4kqid3de06mq7c02ps2m + + + diff --git a/lib/ui/chat_screen.dart b/lib/ui/chat_screen.dart index 74b5f32..25eab6f 100644 --- a/lib/ui/chat_screen.dart +++ b/lib/ui/chat_screen.dart @@ -39,6 +39,7 @@ class _ChatScreenState extends State { return user; } catch (error) { + print(error); return null; } } @@ -72,7 +73,7 @@ class _ChatScreenState extends State { UploadTask task = FirebaseStorage.instance .ref() - .child(DateTime.now().millisecondsSinceEpoch.toString()) + .child(user.uid + DateTime.now().millisecondsSinceEpoch.toString()) .putFile(file); TaskSnapshot taskSnapshot = await task.whenComplete(() {}); diff --git a/web/index.html b/web/index.html index a0e3802..14c8970 100644 --- a/web/index.html +++ b/web/index.html @@ -1,7 +1,7 @@ - - - - - - - - - - - - - - - - - - chat - - - - + + + + + + + + + chat + + + + - - - - - - - + + + + + + + + + + + + + + From 97c386ad4296bd43c6772ea372d1ba64a6c65e6d Mon Sep 17 00:00:00 2001 From: Lucas Gabriel <90lucasgabriel@gmail.com> Date: Sun, 18 Apr 2021 16:26:54 -0300 Subject: [PATCH 12/12] 11 - Update: Gallery; --- lib/widgets/input.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/input.dart b/lib/widgets/input.dart index d2c9c32..7025805 100644 --- a/lib/widgets/input.dart +++ b/lib/widgets/input.dart @@ -36,7 +36,7 @@ class _InputState extends State { onPressed: () async { final ImagePicker _picker = ImagePicker(); final PickedFile response = - await _picker.getImage(source: ImageSource.camera); + await _picker.getImage(source: ImageSource.gallery); final File file = File(response.path); if (response == null) return;